diff mbox

brd: Mark as non-rotational

Message ID 20180503095326.7414-1-sj38.park@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

SeongJae Park May 3, 2018, 9:53 a.m. UTC
This commit sets QUEUE_FLAG_NONROT and clears up QUEUE_FLAG_ADD_RANDOM
to mark the ramdisks as non-rotational device.

Signed-off-by: SeongJae Park <sj38.park@gmail.com>
---
 drivers/block/brd.c | 4 ++++
 1 file changed, 4 insertions(+)

Comments

SeongJae Park May 9, 2018, 4:07 a.m. UTC | #1
I'm sending this mail for another chance of review.


Thanks,
SeongJae Park
On Thu, May 3, 2018 at 6:53 PM SeongJae Park <sj38.park@gmail.com> wrote:

> This commit sets QUEUE_FLAG_NONROT and clears up QUEUE_FLAG_ADD_RANDOM
> to mark the ramdisks as non-rotational device.

> Signed-off-by: SeongJae Park <sj38.park@gmail.com>
> ---
>   drivers/block/brd.c | 4 ++++
>   1 file changed, 4 insertions(+)

> diff --git a/drivers/block/brd.c b/drivers/block/brd.c
> index 66cb0f857f64..39c5b90cc187 100644
> --- a/drivers/block/brd.c
> +++ b/drivers/block/brd.c
> @@ -402,6 +402,10 @@ static struct brd_device *brd_alloc(int i)
>          set_capacity(disk, rd_size * 2);
>          disk->queue->backing_dev_info->capabilities |=
BDI_CAP_SYNCHRONOUS_IO;

> +       /* Tell the block layer that this is not a rotational device */
> +       blk_queue_flag_set(QUEUE_FLAG_NONROT, disk->queue);
> +       blk_queue_flag_clear(QUEUE_FLAG_ADD_RANDOM, disk->queue);
> +
>          return brd;

>   out_free_queue:
> --
> 2.13.0
Jens Axboe May 9, 2018, 2:44 p.m. UTC | #2
On 5/3/18 3:53 AM, SeongJae Park wrote:
> This commit sets QUEUE_FLAG_NONROT and clears up QUEUE_FLAG_ADD_RANDOM
> to mark the ramdisks as non-rotational device.

Applied for 4.18, thanks.
diff mbox

Patch

diff --git a/drivers/block/brd.c b/drivers/block/brd.c
index 66cb0f857f64..39c5b90cc187 100644
--- a/drivers/block/brd.c
+++ b/drivers/block/brd.c
@@ -402,6 +402,10 @@  static struct brd_device *brd_alloc(int i)
 	set_capacity(disk, rd_size * 2);
 	disk->queue->backing_dev_info->capabilities |= BDI_CAP_SYNCHRONOUS_IO;
 
+	/* Tell the block layer that this is not a rotational device */
+	blk_queue_flag_set(QUEUE_FLAG_NONROT, disk->queue);
+	blk_queue_flag_clear(QUEUE_FLAG_ADD_RANDOM, disk->queue);
+
 	return brd;
 
 out_free_queue: