Skip to content

Commit 316ba57

Browse files
sjp38axboe
authored andcommitted
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. Signed-off-by: SeongJae Park <sj38.park@gmail.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
1 parent 522a777 commit 316ba57

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

drivers/block/brd.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -402,6 +402,10 @@ static struct brd_device *brd_alloc(int i)
402402
set_capacity(disk, rd_size * 2);
403403
disk->queue->backing_dev_info->capabilities |= BDI_CAP_SYNCHRONOUS_IO;
404404

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

407411
out_free_queue:

0 commit comments

Comments
 (0)