Re: devfs patch v3

Richard Gooch (rgooch@atnf.CSIRO.AU)
Sun, 11 Jan 1998 19:58:06 +1100


Jakub Jelinek writes:
> > sd_hHcCiIlL
> >
> > where <H> is the host controller number, <C> is the channel number,
> > <I> is the SCSI disc ID, <L> is the LUN.
> > For a single partition it looks like this:
> >
> > sd_hHcCiIlLpP
> >
> > where <P> is the partition number. So, for example sd_h0c0i3l0p2
> > corresponds to sdd2 on my system.
>
> Wouldn't it be better to use subdirectories as much as possible?
> I know it will be more difficult to implement, but will make things look
> nicer, readdir faster, etc.
> What about
> /dev/sd/hHcCiIlL
> /dev/sd/hHcCiIlLpP
> /dev/pts/N
> /dev/scd/hHcCiIlL /* current cdrom code doesn't use partitions */
> ...

Probably. Given that one of my arguments for devfs is that directory
scanning times cost a bit (not a whole lot though, for most current
systems), I should put my money where my mouth is :-)

However, this raises an issue that's been troubling me: how deep a
directory structure should be implemented for SCSI discs? If you
imagine a system with 8 SCSI hosts each with 8 SCSI channels (buses)
with 8 drives per channel and 8 partitions per drive (let's leave the
number of LUNs to a measly 1), that's 4096 directory entries in
/dev/sd, which is painful to <ls>. Note that is a rather large system
(someone with a huge disc farm), but the point is valid.
So perhaps it would be better to have:
/dev/sd/H/CciIlLpP

But that's still 512 entries in each /dev/sd/*, so instead we could
have:
/dev/sd/H/C/iIlLpL

which brings it down to 64. But then you can argue that you may have
only 1 host with 8 channels, 8 targets per channel and 8 LUNs per
target, each with 8 partitions. And on it goes.

So, before I make any changes towards subdirectories in /dev, I want
to get some kind of consensus (at least from those not implacably
opposed to devfs) as to how deep these directory structures should go.

Regards,

Richard....