Skip to contentSkip to conversation

brd: Mark as non-rotational

PATCH In review SeongJae Park 2 participants 3 messages May 3, 2018 – May 9, 2018

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 brd: Mark as non-rotational

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

---
 drivers/block/brd.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/block/brd.c +4 -0
index 66cb0f857f64..39c5b90cc187 100644
@@ -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:
Signature · 1 line
2.13.0
#1 lore raw

I'm sending this mail for another chance of review.

Thanks,
SeongJae Park

Quoted 13 lines · SeongJae Park

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

---
  drivers/block/brd.c | 4 ++++
  1 file changed, 4 insertions(+)
drivers/block/brd.c +0 -0
index 66cb0f857f64..39c5b90cc187 100644

drivers/block/brd.c static struct brd_device *brd_alloc(int i) · line 403

Quoted 2 lines
drivers/block/brd.c +0 -0
@@ -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;

Quoted 9 lines
drivers/block/brd.c +4 -1
+       /* 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

maintainer
#2 lore raw
In reply to SeongJae Park
Quoted 2 lines · SeongJae Park

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.

Signature · 1 line
Jens Axboe