Message ID | 20240222072417.3773131-4-hch@lst.de (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | [1/7] ubd: remove the ubd_gendisk array | expand |
----- Ursprüngliche Mail ----- > Von: "hch" <hch@lst.de> > An: "richard" <richard@nod.at>, "anton ivanov" <anton.ivanov@cambridgegreys.com>, "Johannes Berg" > <johannes@sipsolutions.net>, "Jens Axboe" <axboe@kernel.dk> > CC: "linux-um" <linux-um@lists.infradead.org>, "linux-block" <linux-block@vger.kernel.org> > Gesendet: Donnerstag, 22. Februar 2024 08:24:13 > Betreff: [PATCH 3/7] ubd: move setting the nonrot flag to ubd_add > No reason to delay this until open time. > > Signed-off-by: Christoph Hellwig <hch@lst.de> > --- > arch/um/drivers/ubd_kern.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/arch/um/drivers/ubd_kern.c b/arch/um/drivers/ubd_kern.c > index ef05157acd6b02..9dcf41f7d49606 100644 > --- a/arch/um/drivers/ubd_kern.c > +++ b/arch/um/drivers/ubd_kern.c > @@ -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; > -- > 2.39.2 Reviewed-by: Richard Weinberger <richard@nod.at> Thanks, //richard
diff --git a/arch/um/drivers/ubd_kern.c b/arch/um/drivers/ubd_kern.c index ef05157acd6b02..9dcf41f7d49606 100644 --- a/arch/um/drivers/ubd_kern.c +++ b/arch/um/drivers/ubd_kern.c @@ -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;
No reason to delay this until open time. Signed-off-by: Christoph Hellwig <hch@lst.de> --- arch/um/drivers/ubd_kern.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)