linux-sg2042/drivers/block
Ilya Dryomov 9b60e70b3b rbd: add support for single-major device number allocation scheme
Currently each rbd device is allocated its own major number, which
leads to a hard limit of 230-250 images mapped at once.  This commit
adds support for a new single-major device number allocation scheme,
which is hidden behind a new single_major boolean module parameter and
is disabled by default for backwards compatibility reasons.  (Old
userspace cannot correctly unmap images mapped under single-major
scheme and would essentially just unmap a random image, if that.)

$ rbd showmapped
id pool image snap device
0  rbd  b100  -    /dev/rbd0
1  rbd  b101  -    /dev/rbd1
2  rbd  b102  -    /dev/rbd2
3  rbd  b103  -    /dev/rbd3

Old scheme (modprobe rbd):

$ ls -l /dev/rbd*
brw-rw---- 1 root disk 253, 0 Dec 10 12:24 /dev/rbd0
brw-rw---- 1 root disk 252, 0 Dec 10 12:28 /dev/rbd1
brw-rw---- 1 root disk 252, 1 Dec 10 12:28 /dev/rbd1p1
brw-rw---- 1 root disk 252, 2 Dec 10 12:28 /dev/rbd1p2
brw-rw---- 1 root disk 252, 3 Dec 10 12:28 /dev/rbd1p3
brw-rw---- 1 root disk 251, 0 Dec 10 12:28 /dev/rbd2
brw-rw---- 1 root disk 251, 1 Dec 10 12:28 /dev/rbd2p1
brw-rw---- 1 root disk 250, 0 Dec 10 12:24 /dev/rbd3

New scheme (modprobe rbd single_major=Y):

$ ls -l /dev/rbd*
brw-rw---- 1 root disk 253,   0 Dec 10 12:30 /dev/rbd0
brw-rw---- 1 root disk 253, 256 Dec 10 12:30 /dev/rbd1
brw-rw---- 1 root disk 253, 257 Dec 10 12:30 /dev/rbd1p1
brw-rw---- 1 root disk 253, 258 Dec 10 12:30 /dev/rbd1p2
brw-rw---- 1 root disk 253, 259 Dec 10 12:30 /dev/rbd1p3
brw-rw---- 1 root disk 253, 512 Dec 10 12:30 /dev/rbd2
brw-rw---- 1 root disk 253, 513 Dec 10 12:30 /dev/rbd2p1
brw-rw---- 1 root disk 253, 768 Dec 10 12:30 /dev/rbd3

(major 253 was assigned dynamically at module load time)

The new limit is 4096 images mapped at once, and it comes from the fact
that, as before, 256 minor numbers are reserved for each mapping.
(A follow-up commit changes the number of minors reserved and the way
we deal with partitions over that number.)

If single_major is set to true, two new sysfs interfaces show up:
/sys/bus/rbd/{add,remove}_single_major.  These are to be used instead
of /sys/bus/rbd/{add,remove}, which are disabled for backwards
compatibility reasons outlined above.

Signed-off-by: Ilya Dryomov <ilya.dryomov@inktank.com>
Reviewed-by: Alex Elder <elder@linaro.org>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
2013-12-31 20:31:59 +02:00
..
aoe aoe: do not BUG if memory pressure prevented debugfs file creation 2013-09-11 15:59:28 -07:00
drbd drbd: avoid to shrink max_bio_size due to peer re-configuration 2013-11-08 09:10:29 -07:00
mtip32xx mtip32xx: dynamically allocate buffer in debugfs functions 2013-11-08 09:10:28 -07:00
paride block_device_operations->release() should return void 2013-05-07 02:16:21 -04:00
rsxx rsxx: Fix possible kernel panic with invalid config. 2013-11-08 09:10:29 -07:00
xen-blkback xen/blkback: fix reference counting 2013-11-08 09:10:27 -07:00
DAC960.c procfs: new helper - PDE_DATA(inode) 2013-04-09 14:13:32 -04:00
DAC960.h
Kconfig Merge branch 'for-3.13/post-mq-drivers' into for-linus 2013-11-14 08:29:01 -07:00
Makefile Merge branch 'for-3.13/post-mq-drivers' into for-linus 2013-11-14 08:29:01 -07:00
amiflop.c tree-wide: use reinit_completion instead of INIT_COMPLETION 2013-11-15 09:32:21 +09:00
ataflop.c block_device_operations->release() should return void 2013-05-07 02:16:21 -04:00
brd.c block: fix a probe argument to blk_register_region 2013-11-08 08:59:39 -07:00
cciss.c tree-wide: use reinit_completion instead of INIT_COMPLETION 2013-11-15 09:32:21 +09:00
cciss.h cciss: Adds simple mode functionality 2011-08-08 11:40:15 +02:00
cciss_cmd.h cciss: use new doorbell-bit-5 reset method 2011-05-06 08:23:55 -06:00
cciss_scsi.c cciss: switch to ->show_info() 2013-04-09 14:13:19 -04:00
cciss_scsi.h cciss: add cciss_tape_cmds module paramter 2011-05-06 08:23:59 -06:00
cpqarray.c cpqarray: fix info leak in ida_locked_ioctl() 2013-09-24 17:00:26 -07:00
cpqarray.h
cryptoloop.c move linux/loop.h to drivers/block 2013-06-29 12:46:45 +04:00
floppy.c block: make rq->cmd_flags be 64-bit 2013-10-25 11:55:59 +01:00
hd.c Remove all #inclusions of asm/system.h 2012-03-28 18:30:03 +01:00
ida_cmd.h
ida_ioctl.h
loop.c loop: fix crash when using unassigned loop device 2013-11-08 09:10:28 -07:00
loop.h move linux/loop.h to drivers/block 2013-06-29 12:46:45 +04:00
mg_disk.c mg_disk: remove deprecated IRQF_DISABLED 2013-11-08 09:10:27 -07:00
nbd.c nbd: correct disconnect behavior 2013-07-03 16:08:05 -07:00
null_blk.c kernel: remove CONFIG_USE_GENERIC_SMP_HELPERS cleanly 2013-11-21 16:42:27 -08:00
nvme-core.c DMA-API: block: nvme-core: replace dma_set_mask()+dma_set_coherent_mask() with new helper 2013-09-21 21:02:24 +01:00
nvme-scsi.c NVMe: Use kzalloc instead of kmalloc+memset 2013-06-19 13:24:27 -04:00
osdblk.c block: replace strict_strtoul() with kstrtoul() 2013-09-11 15:56:56 -07:00
pktcdvd.c pktcdvd: debugfs functions return NULL on error 2013-11-08 09:10:31 -07:00
ps3disk.c Drivers: block: remove __dev* attributes. 2013-01-03 15:57:15 -08:00
ps3vram.c procfs: new helper - PDE_DATA(inode) 2013-04-09 14:13:32 -04:00
rbd.c rbd: add support for single-major device number allocation scheme 2013-12-31 20:31:59 +02:00
rbd_types.h rbd: get rid of RBD_MAX_SEG_NAME_LEN 2012-12-17 08:37:29 -06:00
skd_main.c skd: reorder construct/destruct code 2013-11-08 09:10:30 -07:00
skd_s1120.h skd: fix formatting in skd_s1120.h 2013-11-08 09:10:30 -07:00
smart1,2.h fix typos 'comamnd' -> 'command' in comments 2011-02-02 11:31:21 +01:00
sunvdc.c sunvdc: Fix off-by-one in generic_request(). 2013-02-14 11:49:01 -08:00
swim.c drivers/block/swim.c: remove unnecessary platform_set_drvdata() 2013-09-11 15:56:59 -07:00
swim3.c block_device_operations->release() should return void 2013-05-07 02:16:21 -04:00
swim_asm.S
sx8.c block, sx8: fix pointer math issue getting fw version 2012-03-03 19:44:39 +01:00
umem.c Drivers: block: remove __dev* attributes. 2013-01-03 15:57:15 -08:00
umem.h
virtio_blk.c virtio-blk: virtqueue_kick() must be ordered with other virtqueue operations 2013-11-19 19:00:45 -07:00
xen-blkfront.c block: xen-blkfront: Fix possible NULL ptr dereference 2013-11-26 11:24:01 -05:00
xsysace.c xilinx systemace: Fix sparse warnings 2013-07-10 07:47:12 +02:00
z2ram.c block_device_operations->release() should return void 2013-05-07 02:16:21 -04:00