From: SeongJae Park Date: Thu, 3 May 2018 09:53:26 +0000 (+0900) Subject: brd: Mark as non-rotational X-Git-Tag: v5.15~8770^2~134 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=316ba5736c9caa5dbcd84085989862d2df57431d;p=mirror_ubuntu-kernels.git 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 Signed-off-by: Jens Axboe --- 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: