What's to become of devfs?
[Posted November 13, 2002 by corbet]
From
a recent posting by Alexander Viro:
During the last couple of weeks I'd done a lot of digging in
devfs-related code. Results are interesting, and not in a good
sense
He continues with a long list of changes he would like to make to the devfs
code; it's a massive set of cleanups which would, it is claimed, shrink the
devfs code base considerably and make things work better. Comments were
requested on the proposal; the few that came in were favorable.
The posting led to an entirely different sort of discussion, however. As
Ted Ts'o asked, how many people are actually
using devfs?
In any case, if there aren't all that many people using devfs, I
can think of a really easy way in which we could simplify and clean
up its API by slimming it down by 100%......
The question is worth asking. Despite the fact that devfs has been in the
2.4 kernel since it first shipped, very few distributions are turning it on
for their customers. The devfs way of doing things has failed to take over
the world.
And, perhaps more to the point, there is a new approach to dynamic device
management that, while not yet actually implemented, is attracting
interest. The combination of the /sbin/hotplug mechanism and the
device model provides (or can provide) everything that is needed to create
devfs-like filesystems in user space. The device model, via the sysfs
(formerly driverfs) filesystem, provides a complete view of the state of
the system, including all attached hardware. /sbin/hotplug gives
user space the ability to know about (and react to) changes in the system
state. Using that information, user-space code can populate a device
directory hierarchy that implements just about any kind of policy that one
could imagine.
All it takes is somebody to hack up the remaining pieces; a user-space
devfs could easily be a reality in the 2.5 development series. And, since
it lives in user space, there are no real issues with the feature freeze.
Of course, none of this points to a removal of devfs in this development
series. Removal of features violates the feature freeze as surely as
additions do. It is also standard practice to leave such features in place
(though "deprecated") for one stable series to give users time to make the
transition. So, even if the decision to remove devfs is made (and that
certainly has not happened at this point), it will be around for a while.
(
Log in to post comments)