Subject: Re: devfs, was Re: ptyfs fully working now...
To: Eric Haszlakiewicz <firstname.lastname@example.org>
From: Bill Studenmund <email@example.com>
Date: 11/19/2004 11:51:55
Content-Type: text/plain; charset=us-ascii
On Thu, Nov 18, 2004 at 08:26:27PM -0600, Eric Haszlakiewicz wrote:
> On Thu, Nov 18, 2004 at 10:29:38AM -0800, Bill Studenmund wrote:
> > Why is that better? That would be a very messy to code, and we have som=
> > very messy naming issues. We seem to have two name spaces, that of node=
> > on the disk and that of devices. Sometimes the namespace for devices sh=
> > up, sometimes it doesn't.
> I don't think it would be any messier than writing code to store
> the information in a file instead of a filesystem. With the file
> as the backing for persistent state you have two name spaces: that
> described by the file and that described by the devices the kernel
> has at a particular moment. Regardless of what the backing store is
> those two need to be merged.
I think it would be messier in two ways. 1) you have two file systems
involved. So you have up to two vnodes involved in everything. And you
have three classes of vnodes: devfs-only vnodes with no underlying node,
devfs device nodes with an underlying node, and devfs other-nodes with an
underlying vnode. While an overlay file system can do that, it's messy. 2) =
You're still relying on "traditional" node names to identify the device. =
One of the big advantages I see of a devfs is that we can now use locators
to identify devices. I mainly see it in terms of disks on a SAN, but using
locators can make a lot of stuff work quite nicely. Like you can have an
office/work group machine that different folks hook USB sticks into. We
remember device permissions and tie them to the S/N of the stick (I admit
I am assuming they are sticks with real S/Ns). When Alice plugs her stick=
in, it gets set up so she gets exclusive access (which is how she wants=20
it). When Bob sticks his stick into the computer, he has exclusive access.=
Doesn't matter if the sticks show up as sd0, sd10, or sd32.
> > I uesd to think some idea using on-disk device nodes would work, but I=
> > don't anymore. Why shouldn't we just synthesize the whole thing from=20
> > scratch?
> I think you're missing my point. There _aren't_ any on-disk device
> nodes. The only time a device node appears is when it is synthesized
> by the devfs. devfs uses the on-disk state to modify how the in-kernel
> devices appear to userland. Let's take the rename a device node example:
No, I got that point. I had that point, and I argued it for years. I now=20
think it isn't a good one. I think it ends up being quite cumbersome.
Read my reference to "on-disk device node" to mean a node on the disk,=20
either a file or symlink, that contains info for a device node. I did not=
specifically mean that it has to be a char or block dev node in the=20
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (NetBSD)
-----END PGP SIGNATURE-----