LWN.net Logo

Advertisement

Front, Kernel, Security, Distributions, Development. See your byline here on LWN.net.

Advertise here

Block layer: integrity checking and lots of partitions

Block layer: integrity checking and lots of partitions

Posted Jul 19, 2008 11:01 UTC (Sat) by garloff (subscriber, #319)
Parent article: Block layer: integrity checking and lots of partitions

The current mapping of SCSI disks is documented in sd.c:

/*
 * Device no to disk mapping:
 * 
 *       major         disc2     disc  p1
 *   |............|.............|....|....| <- dev_t
 *    31        20 19          8 7  4 3  0
 * 
 * Inside a major, we have 16k disks, however mapped non-
 * contiguously. The first 16 disks are for major0, the next
 * ones with major1, ... Disk 256 is for major0 again, disk 272 
 * for major1, ... 
 * As we stay compatible with our numbering scheme, we can reuse 
 * the well-know SCSI majors 8, 65--71, 136--143.
 */

With some more bit shuffling, support for 64 partitions would be
possible without breaking backwards compatibility. For this, the two
upper bits of disc2 could be taken, limiting us to 4k disks per major
(or 32k disks in total). That's fine, the naming scheme 
(sda->sdz,sdaa->sdaz,sdbX->sdzX,sdaaa->sdzzz) only
works for up to 18k disks only anyway.

Ugly of course ...


(Log in to post comments)

Copyright © 2012, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds