X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=drivers%2Fblock%2Frd.c;h=80848c2a7bbedc91d34d00f82554d59f4ff3a698;hb=6a77f38946aaee1cd85eeec6cf4229b204c15071;hp=b3c7f07c16fd8f1629a15e940efcc14d4f9a5670;hpb=87fc8d1bb10cd459024a742c6a10961fefcef18f;p=linux-2.6.git diff --git a/drivers/block/rd.c b/drivers/block/rd.c index b3c7f07c1..80848c2a7 100644 --- a/drivers/block/rd.c +++ b/drivers/block/rd.c @@ -48,6 +48,7 @@ #include #include #include +#include #include #include #include @@ -60,15 +61,12 @@ #include -/* The RAM disk size is now a parameter */ -#define NUM_RAMDISKS 16 /* This cannot be overridden (yet) */ - /* Various static variables go here. Most are used only in the RAM disk code. */ -static struct gendisk *rd_disks[NUM_RAMDISKS]; -static struct block_device *rd_bdev[NUM_RAMDISKS];/* Protected device data */ -static struct request_queue *rd_queue[NUM_RAMDISKS]; +static struct gendisk *rd_disks[CONFIG_BLK_DEV_RAM_COUNT]; +static struct block_device *rd_bdev[CONFIG_BLK_DEV_RAM_COUNT];/* Protected device data */ +static struct request_queue *rd_queue[CONFIG_BLK_DEV_RAM_COUNT]; /* * Parameters for the boot-loading of the RAM disk. These are set by @@ -402,7 +400,7 @@ static void __exit rd_cleanup(void) { int i; - for (i = 0; i < NUM_RAMDISKS; i++) { + for (i = 0; i < CONFIG_BLK_DEV_RAM_COUNT; i++) { struct block_device *bdev = rd_bdev[i]; rd_bdev[i] = NULL; if (bdev) { @@ -432,7 +430,7 @@ static int __init rd_init(void) rd_blocksize = BLOCK_SIZE; } - for (i = 0; i < NUM_RAMDISKS; i++) { + for (i = 0; i < CONFIG_BLK_DEV_RAM_COUNT; i++) { rd_disks[i] = alloc_disk(1); if (!rd_disks[i]) goto out; @@ -445,7 +443,7 @@ static int __init rd_init(void) devfs_mk_dir("rd"); - for (i = 0; i < NUM_RAMDISKS; i++) { + for (i = 0; i < CONFIG_BLK_DEV_RAM_COUNT; i++) { struct gendisk *disk = rd_disks[i]; rd_queue[i] = blk_alloc_queue(GFP_KERNEL); @@ -470,7 +468,7 @@ static int __init rd_init(void) /* rd_size is given in kB */ printk("RAMDISK driver initialized: " "%d RAM disks of %dK size %d blocksize\n", - NUM_RAMDISKS, rd_size, rd_blocksize); + CONFIG_BLK_DEV_RAM_COUNT, rd_size, rd_blocksize); return 0; out_queue: @@ -508,9 +506,10 @@ __setup("ramdisk_blocksize=", ramdisk_blocksize); #endif /* options - modular */ -MODULE_PARM (rd_size, "1i"); +module_param(rd_size, int, 0); MODULE_PARM_DESC(rd_size, "Size of each RAM disk in kbytes."); -MODULE_PARM (rd_blocksize, "i"); +module_param(rd_blocksize, int, 0); MODULE_PARM_DESC(rd_blocksize, "Blocksize of each RAM disk in bytes."); +MODULE_ALIAS_BLOCKDEV_MAJOR(RAMDISK_MAJOR); MODULE_LICENSE("GPL");