diff options
author | Wouter Verhelst <w@uter.be> | 2024-07-25 18:45:36 +0200 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2024-07-28 16:47:52 -0600 |
commit | 7543ae2269a855683a39af57048035f44bc8ef9c (patch) | |
tree | 4877344faa167ba1af8d96734876a7660be9e7c6 /drivers/block | |
parent | 7960af373ade3b39e10106ef415e43a1d2aa48c6 (diff) |
nbd: add support for rotational devices
The NBD protocol defines the flag NBD_FLAG_ROTATIONAL to flag that the
export in use should be treated as a rotational device.
Add support for that flag to the kernel driver.
Signed-off-by: Wouter Verhelst <w@uter.be>
Reviewed-by: Eric Blake <eblake@redhat.com>
Link: https://lore.kernel.org/r/20240725164536.1275851-1-w@uter.be
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'drivers/block')
-rw-r--r-- | drivers/block/nbd.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/block/nbd.c b/drivers/block/nbd.c index 41a90150b501..5b1811b1ba5f 100644 --- a/drivers/block/nbd.c +++ b/drivers/block/nbd.c @@ -350,6 +350,9 @@ static int __nbd_set_size(struct nbd_device *nbd, loff_t bytesize, lim.features |= BLK_FEAT_WRITE_CACHE; lim.features &= ~BLK_FEAT_FUA; } + if (nbd->config->flags & NBD_FLAG_ROTATIONAL) + lim.features |= BLK_FEAT_ROTATIONAL; + lim.logical_block_size = blksize; lim.physical_block_size = blksize; error = queue_limits_commit_update(nbd->disk->queue, &lim); |