Re: scsi naming (was: devfs patch v3)

James Mastros (root@jennifer-unix.dyn.ml.org)
Sun, 11 Jan 1998 14:16:46 -0500 (EST)


On Sun, 11 Jan 1998, Richard Gooch wrote:
[...]
> 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.

I should think that we want them as deep as we can go. After-all, there is
an overhead of one dentry and one inode in memory for each one, but we only
have that overhead for directories that we acatually have... So my
suggested directory structure looks like:

SCSI/
c/
controller
b/
bus
id/
id
lun/
lun
partition

(where the direcories c, b, id, and lun (and the node partition) are
numbers, and the nodes controller, bus, id, and lun are nodes for ioctls
that effect the entire controller, bus, id, or lun). Indeed, perhaps the
partitions should be directories that mirror the partition structure on-disk
(so exteneded dos partitions would be directories.) Note that my scheme
dosn't diferincate between hard-drives, tape-drives, cdrom-drives, and
generics -- I think that they should be merged: does anybody know why they
weren't in the first place? (I don't have any SCSI devices, so I don't
really know.)

-=- James Mastros