[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <f2kaityrjmmstzvqq7xu755ikstida2hcnnng634oeo6fxjfbj@zrgbeik6fwz6>
Date: Mon, 5 Aug 2024 07:52:42 -0500
From: Eric Blake <eblake@...hat.com>
To: Wouter Verhelst <w@...r.be>
Cc: Josef Bacik <josef@...icpanda.com>, Jens Axboe <axboe@...nel.dk>,
linux-block@...r.kernel.org, nbd@...er.debian.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/2] nbd: implement the WRITE_ZEROES command
On Sat, Aug 03, 2024 at 03:04:30PM GMT, Wouter Verhelst wrote:
> The NBD protocol defines a message for zeroing out a region of an export
>
> Add support to the kernel driver for that message.
>
> Signed-off-by: Wouter Verhelst <w@...r.be>
> ---
> drivers/block/nbd.c | 8 ++++++++
> include/uapi/linux/nbd.h | 5 ++++-
> 2 files changed, 12 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/block/nbd.c b/drivers/block/nbd.c
> index 5b1811b1ba5f..215e7ea9a3c3 100644
> --- a/drivers/block/nbd.c
> +++ b/drivers/block/nbd.c
> @@ -352,6 +352,8 @@ static int __nbd_set_size(struct nbd_device *nbd, loff_t bytesize,
> }
> if (nbd->config->flags & NBD_FLAG_ROTATIONAL)
> lim.features |= BLK_FEAT_ROTATIONAL;
> + if (nbd->config->flags & NBD_FLAG_SEND_WRITE_ZEROES)
> + lim.max_write_zeroes_sectors = UINT_MAX;
Is that number accurate, when the kernel has not yet been taught to
use 64-bit transactions and can therefore only request a 32-bit byte
length on any one transaction? Would a better limit be
UINT_MAX/blksize?
--
Eric Blake, Principal Software Engineer
Red Hat, Inc.
Virtualization: qemu.org | libguestfs.org
Powered by blists - more mailing lists