Given that netlink sockets and specialized tools are already needed and will continue to be needed for many parts of the kernel, what is the benefit of having sysfs at all? All subsystems and modules could simply use a "generic" configuration protocol over netlink and standard tools for querying and setting those values could be part of the Linux userspace utilities.
Really, what's the benefit of 'cat /sys/foo' over 'linux-config --get foo' ? Is it because C code has an easier time reading a value from a file than from another program's output? That's also easily solvable with a really simple C library liblinuxconfig or somesuch.
Using a special tool like linux-config could easily make atomic writes possible, assuming the actual netlink-based configuration protocol supports them, by simply allowing multiple keys to be set on the command line or piping some specially formatted lines to linux-config's stdin.
A separate tool would also allow much better error reports than sysfs by allowing errors to be sent to stderr.
Is sysfs really that great of an idea, or was it just another case of someone pushing something into the kernel without *really* thinking things through, a lot like how devfs is (now) recognized to be?
Copyright © 2017, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds