Large device numbers (was Re: disk naming proposal & devfs)

Ian Burrell (iburrell@thegrid.net)
Tue, 13 Jan 1998 22:50:40 -0800 (PST)


>
> Various problems related to the current indirect device referencing
> scheme, including (but not necessarily limited to):
> -8bit minors,
> -major/minor table lookup times
> -filesystem rewriting necessary to go to 16 or 32 bit minors.
> -major number conflict resolution
>

I thought devfs was a solution to the problems of large directories
and dynamic creation of device files. There really should be a common
system for going from device number to device that is independent of
whether it is an on-disk device node or purely virtual inode. The
device registration could be made distinct from the inodes and
directories entry in devfs and normal devices nodes. Opening a file
goes filename -> dentry -> inode -> dev_t -> device. A new lookup
would be needed for dev_t to device driver.

The easy way to split 64-bit device numbers in half and use the 32-bit
major number to identify the device driver and the 32-bit minor number
used to identify the specific device. Drivers would register
themselves with the driver table, and the minor number and canonical
name with device table/devfs.

A better way might be use the entire 64-bit value as the device id and
scrap the major/minor separation. Then the driver is identified by
variable-length prefix. Overlapping drivers could be accomplished
with a longest-matching-prefix search. This would be inefficient but
could be speeded up by caching the resolved devices in inodes.

- Ian

-- 
          -- Ian Burrell == iburrell@leland.stanford.edu **
           <URL:http://www-leland.stanford.edu/~iburrell/>
All programmers are playwrights and all computers are lousy actors.