diff options
author | SeongJae Park <sj38.park@gmail.com> | 2018-05-03 18:53:26 +0900 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2018-05-09 08:43:57 -0600 |
commit | 316ba5736c9caa5dbcd84085989862d2df57431d (patch) | |
tree | dfef15b321413397ba133afba1a4d25abc61f79a | |
parent | 522a777566f5669606a1227bf13f3fb40963780b (diff) | |
download | linux-316ba5736c9caa5dbcd84085989862d2df57431d.tar.gz linux-316ba5736c9caa5dbcd84085989862d2df57431d.tar.bz2 linux-316ba5736c9caa5dbcd84085989862d2df57431d.zip |
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>
-rw-r--r-- | drivers/block/brd.c | 4 |
1 files changed, 4 insertions, 0 deletions
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: |