[EMAIL PROTECTED] writes:
> >OK, I think I wasn't clear enough in a previous message, where I went
> >on about inode lookups in directories and so on. What happens (for
> >example with the SCSI CD-ROM driver) is this:
> >
> >- lookup on /dev/sr which doesn't yet exist will call kmod with
> > "/dev/sr" which should be aliased to load sr_mod
> >
> >- sr_mod identifies CD-ROM devices and populates /dev/sr with entries
> > as appropriate.
>
> *OH*! I thought I'd asked something like that, whoops. Well, gee,
> since accessing /dev/sr loads the mod there's not problem at all. The
> rest of my mail completely missed what actually went on.
I think it's my fault: when I was explaining things I had in mind
devices like the PC watchdog (/dev/pcwd), where a speculative inode
lookup results in a module load which results in a device entry being
created. I don't know why I didn't think directly about the CD-ROM
cases. Ah, well. Brainlock.
> >I don't think devfs introduces the same problems, because it groups
> >things by device class. So a single inode lookup attempt will cause
> >the appropriate module to be loaded, which in turn populates the
> >directory.
>
> Yes, I'd missed where the module load happened and the fact that
> classing was consistent. This handles all my needs and wildest device
> identification desires. Granted, I didn't want *that* much :-)
Good. A happy customer ;-)
One thing to note: this scheme will even work for the old-style names
(/dev/sr0) because the devices are still grouped. You're not forced to
use the new-style names, since you "know" that /dev/sr0 is the first
SCSI CD-ROM, /dev/sr1 is the second and so on. You can still scan /dev
in this way after you've speculatively looked up /dev/sr0 (say with
stat(2)).
Nevertheless, I'd urge the use of the new names, because:
- it simplifies the searching (directory scanning) code: every entry
except "." and ".." is a device you care about
- scanning the directory is faster (since you don't have all the /dev
crud)
- people can configure devfs to disable the old-style names, but you
can't disable the new-style names.
Also, a tip: if devfs is mounted onto /dev, a simple test is to look
for /dev/.devfsd. You can't rely on its file type, but you can rely on
its existence.
Regards,
Richard....
-
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to [EMAIL PROTECTED]