Subject: Re: devfs, was Re: ptyfs fully working now...
To: Robert Elz <kre@munnari.OZ.AU>
From: Bill Studenmund <firstname.lastname@example.org>
Date: 11/27/2004 14:21:51
Content-Type: text/plain; charset=us-ascii
On Fri, Nov 26, 2004 at 04:08:09PM +0700, Robert Elz wrote:
> Date: Thu, 18 Nov 2004 10:29:38 -0800
> From: Bill Studenmund <wrstuden@NetBSD.org>
> Message-ID: <20041118182938.GD8951@netbsd.org>
> | 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
> | scratch?
> I'm rather behind on my NetBSD mail (yet again), so maybe this has already
> been discussed (in which case I will find it eventually) - but how are any
> of the devfs schemes that have been tossed around proposing to handle the
> various time fields from the (current) inodes?
My thoughts were that, with the binary file idea, we have explicit atime,
mtime, and ctime fields. When the node gets updated, we note the change=20
and mark the internal entry dirty. We then either immediately write the=20
data out, or write it out say once every minute. Thus we keep stat info=20
> ctime is probably not important (but that one would take some thinking ab=
> birthtime is uselsss in all cases (for all inode types, but that's not
> relevant to this discussion), but knowing atime & mtime for some devices
> is incredibly useful. It isn't for ptys, so I don't care whether ptyfs
> does anything with this (haven't yet tried it), but for printers, real
> terminals, tapes, and some other stuff, knowing when it was last written =
> or read from, (even many reboots into the past) can be useful.
> I mean, do I know my tape drive is still OK, when was the last time I
> used it? Hmm ... 18 months ago, then perhaps I shouldn't be relying upon
> it working tomorrow...
> Schemes which simply invent nodes (of some kind) at boot, even if they ap=
> owner/permission fixes from some file that holds this information, just
> aren't good enough. None of that kind of thing is suitable for holding
> data that is subject to being updated (by the kernel) as frequently as an
> inode atime.
Why is getting info from a file insufficient for keeping track of inode=20
atime? Obviously we have to have a field that includes the data, but once=
we do, how is there a problem?
> If the only real rational for a devfs is to clean up clutter in /dev
> (for those too lazy to cleanit up themselves, and who nevertheless care
> about it), then I'd suggest not bothering if a side effect would be to
> lose the information from the time fields.
I think we want devfs for much more than just reducing clutter. The main=20
reason I'd like a devfs is so that we can maintain device permissions and=
info that is independent of major & minor number. While major number will=
probably not change and we have ways of tying minor numbers down, it would=
be nice to be able to tie device identity (and permissions and access=20
times and ownership) down in ways we can't now.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (NetBSD)
-----END PGP SIGNATURE-----