public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] brd: add ram disk visibility option
@ 2014-08-16 15:55 Dmitry Monakhov
  2014-08-17 18:45 ` Jens Axboe
  0 siblings, 1 reply; 3+ messages in thread
From: Dmitry Monakhov @ 2014-08-16 15:55 UTC (permalink / raw)
  To: linux-kernel; +Cc: axboe, Dmitry Monakhov

Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org>

diff --git a/drivers/block/brd.c b/drivers/block/brd.c
index c7d138e..3598110 100644
--- a/drivers/block/brd.c
+++ b/drivers/block/brd.c
@@ -442,12 +442,15 @@ static int rd_nr;
 int rd_size = CONFIG_BLK_DEV_RAM_SIZE;
 static int max_part;
 static int part_shift;
+static int part_show = 0;
 module_param(rd_nr, int, S_IRUGO);
 MODULE_PARM_DESC(rd_nr, "Maximum number of brd devices");
 module_param(rd_size, int, S_IRUGO);
 MODULE_PARM_DESC(rd_size, "Size of each RAM disk in kbytes.");
 module_param(max_part, int, S_IRUGO);
 MODULE_PARM_DESC(max_part, "Maximum number of partitions per RAM disk");
+module_param(part_show, int, S_IRUGO);
+MODULE_PARM_DESC(part_show, "Control RAM disk visibility in /proc/partitions");
 MODULE_LICENSE("GPL");
 MODULE_ALIAS_BLOCKDEV_MAJOR(RAMDISK_MAJOR);
 MODULE_ALIAS("rd");
@@ -501,7 +504,8 @@ static struct brd_device *brd_alloc(int i)
 	disk->fops		= &brd_fops;
 	disk->private_data	= brd;
 	disk->queue		= brd->brd_queue;
-	disk->flags |= GENHD_FL_SUPPRESS_PARTITION_INFO;
+	if (!part_show)
+		disk->flags |= GENHD_FL_SUPPRESS_PARTITION_INFO;
 	sprintf(disk->disk_name, "ram%d", i);
 	set_capacity(disk, rd_size * 2);
 
-- 
1.7.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] brd: add ram disk visibility option
  2014-08-16 15:55 [PATCH] brd: add ram disk visibility option Dmitry Monakhov
@ 2014-08-17 18:45 ` Jens Axboe
  2014-08-18  8:49   ` Dmitry Monakhov
  0 siblings, 1 reply; 3+ messages in thread
From: Jens Axboe @ 2014-08-17 18:45 UTC (permalink / raw)
  To: Dmitry Monakhov, linux-kernel

On 2014-08-16 09:55, Dmitry Monakhov wrote:
> Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org>

You forgot a commit message justifying this change?

-- 
Jens Axboe


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] brd: add ram disk visibility option
  2014-08-17 18:45 ` Jens Axboe
@ 2014-08-18  8:49   ` Dmitry Monakhov
  0 siblings, 0 replies; 3+ messages in thread
From: Dmitry Monakhov @ 2014-08-18  8:49 UTC (permalink / raw)
  To: Jens Axboe, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 340 bytes --]

On Sun, 17 Aug 2014 12:45:31 -0600, Jens Axboe <axboe@fb.com> wrote:
> On 2014-08-16 09:55, Dmitry Monakhov wrote:
> > Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org>
> 
> You forgot a commit message justifying this change?
I've assumed that one line comment is enough :(
Please take a look at the patch with updated commit message.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-brd-add-ram-disk-visibility-option.patch --]
[-- Type: text/x-patch, Size: 1820 bytes --]

>From cbb15356494fa2fb96114a152f64e962b599575c Mon Sep 17 00:00:00 2001
From: Dmitry Monakhov <dmonakhov@openvz.org>
Date: Mon, 18 Aug 2014 12:45:42 +0400
Subject: [PATCH] brd: add ram disk visibility option

Currenly ram disk is not visiable inside /proc/partitions. This was
done for compatibility reasons here: 53978d0a7a27. But some utilities
expect disk presents in /proc/partitions.
Let's add module's option and let's administrator chose visibility behaviour.
By default, old behaviour preserved.

Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org>
---
 drivers/block/brd.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/drivers/block/brd.c b/drivers/block/brd.c
index c7d138e..3598110 100644
--- a/drivers/block/brd.c
+++ b/drivers/block/brd.c
@@ -442,12 +442,15 @@ static int rd_nr;
 int rd_size = CONFIG_BLK_DEV_RAM_SIZE;
 static int max_part;
 static int part_shift;
+static int part_show = 0;
 module_param(rd_nr, int, S_IRUGO);
 MODULE_PARM_DESC(rd_nr, "Maximum number of brd devices");
 module_param(rd_size, int, S_IRUGO);
 MODULE_PARM_DESC(rd_size, "Size of each RAM disk in kbytes.");
 module_param(max_part, int, S_IRUGO);
 MODULE_PARM_DESC(max_part, "Maximum number of partitions per RAM disk");
+module_param(part_show, int, S_IRUGO);
+MODULE_PARM_DESC(part_show, "Control RAM disk visibility in /proc/partitions");
 MODULE_LICENSE("GPL");
 MODULE_ALIAS_BLOCKDEV_MAJOR(RAMDISK_MAJOR);
 MODULE_ALIAS("rd");
@@ -501,7 +504,8 @@ static struct brd_device *brd_alloc(int i)
 	disk->fops		= &brd_fops;
 	disk->private_data	= brd;
 	disk->queue		= brd->brd_queue;
-	disk->flags |= GENHD_FL_SUPPRESS_PARTITION_INFO;
+	if (!part_show)
+		disk->flags |= GENHD_FL_SUPPRESS_PARTITION_INFO;
 	sprintf(disk->disk_name, "ram%d", i);
 	set_capacity(disk, rd_size * 2);
 
-- 
1.7.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-08-18  8:49 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-08-16 15:55 [PATCH] brd: add ram disk visibility option Dmitry Monakhov
2014-08-17 18:45 ` Jens Axboe
2014-08-18  8:49   ` Dmitry Monakhov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox