sysfs is dumb - that depends
Posted Oct 18, 2009 20:03 UTC (Sun) by
quotemstr (subscriber, #45331)
In reply to:
sysfs is dumb - that depends by jageorge
Parent article:
Infrastructure unification in the block layer
sysfs IS the strategic direction already taken by Linux
It does seem that we're stuck with it for now, though it
could be deprecated as many other interfaces have been.
So I agree, there's a need for atomic operations on sysfs. Your ideas seem over-engineered to me though. What's wrong with the following scheme? An application would create a temporary directory anywhere it liked. Under this temporary directory, an application would create a sysfs tree corresponding to the nodes to change, and after that, would write the name of the temporarily directory to a new special file, /sys/commit. If the commit is successful, the kernel would remove the temporary directory; if there's an error, it would leave the directory in place and return an error from write, or leave an error file in the temporary directory describing what went wrong.
This scheme doesn't require any new system calls or VFS infrastructure, and it's shell-script compatible.
(
Log in to post comments)