Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=d50ed9...
Commit: d50ed907dc3db5bf2dd0a05b4e199a65793a3788
Parent: 4f3bf19c6e8164b441faaee476e734b4f612a78d
Author: Christian Borntraeger <borntraeger@de.ibm.com>
AuthorDate: Fri Feb 1 09:05:00 2008 +0100
Committer: Rusty Russell <rusty@rustcorp.com.au>
CommitDate: Mon Feb 4 23:50:11 2008 +1100
virtio_blk: implement naming for vda-vdz,vdaa-vdzz,vdaaa-vdzzz
Am Freitag, 1. Februar 2008 schrieb Christian Borntraeger:
> Right. I will fix that with an additional patch.
This patch goes on top of the minor number patch. Please let me know if
you want a merged patch:
Currently virtio_blk creates the disk name combinging "vd" with 'a'++.
This will give strange names after vdz. I have implemented names up to
vdzzz - inspired by the sd.c code. That should be sufficient for now.
There is one driver in the kernel (driver/s390/block/dasd_genhd.c) that
implements names from dasda-dasdzzzz allowing even more disks. Maybe
a janitor can come up with a common implementation usable for all kind
of block device drivers.
I have tested this patch with 100 disks - seems to work.
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
---
drivers/block/virtio_blk.c | 29 ++++++++++++++++++++++-------
1 files changed, 22 insertions(+), 7 deletions(-)
diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c
index 559c322..3b1a68d 100644
--- a/drivers/block/virtio_blk.c
+++ b/drivers/block/virtio_blk.c
@@ -9,8 +9,7 @@
#define VIRTIO_MAX_SG (3+MAX_PHYS_SEGMENTS)
#define PART_BITS 4
-static unsigned char virtblk_index = 'a';
-static int major, minor;
+static int major, index;
struct virtio_blk
{
@@ -171,6 +170,11 @@ static struct block_device_operations virtblk_fops = {
.getgeo = ...