aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block/brd.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/block/brd.c')
-rw-r--r--drivers/block/brd.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/block/brd.c b/drivers/block/brd.c
index c7d138eca731..3598110d2cef 100644
--- a/drivers/block/brd.c
+++ b/drivers/block/brd.c
@@ -442,12 +442,15 @@ static int rd_nr;
442int rd_size = CONFIG_BLK_DEV_RAM_SIZE; 442int rd_size = CONFIG_BLK_DEV_RAM_SIZE;
443static int max_part; 443static int max_part;
444static int part_shift; 444static int part_shift;
445static int part_show = 0;
445module_param(rd_nr, int, S_IRUGO); 446module_param(rd_nr, int, S_IRUGO);
446MODULE_PARM_DESC(rd_nr, "Maximum number of brd devices"); 447MODULE_PARM_DESC(rd_nr, "Maximum number of brd devices");
447module_param(rd_size, int, S_IRUGO); 448module_param(rd_size, int, S_IRUGO);
448MODULE_PARM_DESC(rd_size, "Size of each RAM disk in kbytes."); 449MODULE_PARM_DESC(rd_size, "Size of each RAM disk in kbytes.");
449module_param(max_part, int, S_IRUGO); 450module_param(max_part, int, S_IRUGO);
450MODULE_PARM_DESC(max_part, "Maximum number of partitions per RAM disk"); 451MODULE_PARM_DESC(max_part, "Maximum number of partitions per RAM disk");
452module_param(part_show, int, S_IRUGO);
453MODULE_PARM_DESC(part_show, "Control RAM disk visibility in /proc/partitions");
451MODULE_LICENSE("GPL"); 454MODULE_LICENSE("GPL");
452MODULE_ALIAS_BLOCKDEV_MAJOR(RAMDISK_MAJOR); 455MODULE_ALIAS_BLOCKDEV_MAJOR(RAMDISK_MAJOR);
453MODULE_ALIAS("rd"); 456MODULE_ALIAS("rd");
@@ -501,7 +504,8 @@ static struct brd_device *brd_alloc(int i)
501 disk->fops = &brd_fops; 504 disk->fops = &brd_fops;
502 disk->private_data = brd; 505 disk->private_data = brd;
503 disk->queue = brd->brd_queue; 506 disk->queue = brd->brd_queue;
504 disk->flags |= GENHD_FL_SUPPRESS_PARTITION_INFO; 507 if (!part_show)
508 disk->flags |= GENHD_FL_SUPPRESS_PARTITION_INFO;
505 sprintf(disk->disk_name, "ram%d", i); 509 sprintf(disk->disk_name, "ram%d", i);
506 set_capacity(disk, rd_size * 2); 510 set_capacity(disk, rd_size * 2);
507 511