qemu-block
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-block] [PATCH 4/5] block: Switch discard length bounds to byte


From: Kevin Wolf
Subject: Re: [Qemu-block] [PATCH 4/5] block: Switch discard length bounds to byte-based
Date: Tue, 7 Jun 2016 15:12:02 +0200
User-agent: Mutt/1.5.21 (2010-09-15)

Am 03.06.2016 um 19:03 hat Eric Blake geschrieben:
> Sector-based limits are awkward to think about; in our on-going
> quest to move to byte-based interfaces, convert max_discard and
> discard_alignment.  Rename them, using 'pdiscard' as an aid to
> track which remaining discard interfaces need conversion, and so
> that the compiler will help us catch the change in semantics
> across any rebased code.  In iscsi.c, sector_limits_lun2qemu()
> is no longer needed; and the BlockLimits type is now completely
> byte-based.
> 
> Signed-off-by: Eric Blake <address@hidden>

> diff --git a/block/nbd.c b/block/nbd.c
> index 2ce7b4d..a3de9bc 100644
> --- a/block/nbd.c
> +++ b/block/nbd.c
> @@ -362,7 +362,7 @@ static int nbd_co_flush(BlockDriverState *bs)
> 
>  static void nbd_refresh_limits(BlockDriverState *bs, Error **errp)
>  {
> -    bs->bl.max_discard = UINT32_MAX >> BDRV_SECTOR_BITS;
> +    bs->bl.max_pdiscard = INT32_MAX;
>      bs->bl.max_transfer = NBD_MAX_BUFFER_SIZE;
>  }

Another non-mechanical change that might deserve its own patch (or
probably one NBD patch that changes both values).

Kevin



reply via email to

[Prev in Thread] Current Thread [Next in Thread]