Commit b8b364d2 authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Jens Axboe

ubd: move setting the nonrot flag to ubd_add

No reason to delay this until open time.
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Reviewed-by: default avatarRichard Weinberger <richard@nod.at>
Link: https://lore.kernel.org/r/20240222072417.3773131-4-hch@lst.deSigned-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent 0267e9ca
......@@ -799,7 +799,6 @@ static int ubd_open_dev(struct ubd *ubd_dev)
blk_queue_max_discard_sectors(ubd_dev->queue, UBD_MAX_REQUEST);
blk_queue_max_write_zeroes_sectors(ubd_dev->queue, UBD_MAX_REQUEST);
}
blk_queue_flag_set(QUEUE_FLAG_NONROT, ubd_dev->queue);
return 0;
error:
os_close_file(ubd_dev->fd);
......@@ -894,6 +893,7 @@ static int ubd_add(int n, char **error_out)
}
ubd_dev->queue = disk->queue;
blk_queue_flag_set(QUEUE_FLAG_NONROT, disk->queue);
blk_queue_write_cache(ubd_dev->queue, true, false);
disk->major = UBD_MAJOR;
disk->first_minor = n << UBD_SHIFT;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment