Re: SCSI device numbering (was: Re: Ideas for v2.1

Leonard N. Zubkoff (lnz@dandelion.com)
Mon, 1 Jul 1996 23:43:21 -0700


Date: Tue, 2 Jul 1996 08:15:29 +0300 (EET DST)
From: Linus Torvalds <torvalds@cs.Helsinki.FI>

So something like this:
- one major number for each SCSI bus (= usually one controller)
- 4 (8?) bits SCSI ID
- 7 bits SCSI LUN
- 4 bits partition information
- ???

Yuk. Why should the dev_t need to encode these subsystem specific details?
I'd much rather see:

- 12 bits for the major number of each device type pretty much as we
have now.
(device types are the things that have a common set of properties)
- 16 bits for an index into a dynamically allocated dense array of
pointers to objects of that type
- 4 bits for partition information or other specialization

I think that it's the *devices* that are the central objects here, not their
implementation on specific SCSI channels. I don't see any reason that a dev_t
needs to map directly to any SCSI details. Each SCSI Device can refer to the
specific bus, the driver that handles that bus, and whatever details are
necessary to address that device.

I think 65536 devices of each type is probably sufficient for the moment. If
not, we can shrink the major number a bit more. The reason 32 bits aren't
enough in most of the suggestions I've seen is that we're trying to encode
irrelevant and unnecessary information into the minor numbers. dev_t does not
need to be the way of naming devices from the user's perspective.

Leonard