[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 4/5] block: Switch discard length bounds to byte
From: |
Kevin Wolf |
Subject: |
Re: [Qemu-devel] [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
- [Qemu-devel] [PATCH 0/5] Byte-based block limits, Eric Blake, 2016/06/03
- [Qemu-devel] [PATCH 4/5] block: Switch discard length bounds to byte-based, Eric Blake, 2016/06/03
- Re: [Qemu-devel] [PATCH 4/5] block: Switch discard length bounds to byte-based,
Kevin Wolf <=
- [Qemu-devel] [PATCH 5/5] block: Move request_alignment into BlockLimit, Eric Blake, 2016/06/03
- Re: [Qemu-devel] [PATCH 5/5] block: Move request_alignment into BlockLimit, Eric Blake, 2016/06/03
- Re: [Qemu-devel] [PATCH 5/5] block: Move request_alignment into BlockLimit, Eric Blake, 2016/06/14
- Re: [Qemu-devel] [PATCH 5/5] block: Move request_alignment into BlockLimit, Kevin Wolf, 2016/06/14
- Re: [Qemu-devel] [PATCH 5/5] block: Move request_alignment into BlockLimit, Eric Blake, 2016/06/14
- Re: [Qemu-devel] [PATCH 5/5] block: Move request_alignment into BlockLimit, Kevin Wolf, 2016/06/14