[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v8 20/21] vvfat: Switch to .bdrv_co_block_status
From: |
Kevin Wolf |
Subject: |
Re: [Qemu-devel] [PATCH v8 20/21] vvfat: Switch to .bdrv_co_block_status() |
Date: |
Wed, 14 Feb 2018 14:12:15 +0100 |
User-agent: |
Mutt/1.9.1 (2017-09-22) |
Am 13.02.2018 um 21:27 hat Eric Blake geschrieben:
> We are gradually moving away from sector-based interfaces, towards
> byte-based. Update the vvfat driver accordingly. Note that we
> can rely on the block driver having already clamped limits to our
> block size, and simplify accordingly.
>
> Signed-off-by: Eric Blake <address@hidden>
> Reviewed-by: Vladimir Sementsov-Ogievskiy <address@hidden>
> Reviewed-by: Fam Zheng <address@hidden>
>
> ---
> v5-v7: no change
> v4: rebase to interface tweak
> v3: no change
> v2: rebase to earlier changes, simplify
> ---
> block/vvfat.c | 16 +++++++---------
> 1 file changed, 7 insertions(+), 9 deletions(-)
>
> diff --git a/block/vvfat.c b/block/vvfat.c
> index 7e06ebacf61..4a17a49e128 100644
> --- a/block/vvfat.c
> +++ b/block/vvfat.c
> @@ -3088,15 +3088,13 @@ vvfat_co_pwritev(BlockDriverState *bs, uint64_t
> offset, uint64_t bytes,
> return ret;
> }
>
> -static int64_t coroutine_fn vvfat_co_get_block_status(BlockDriverState *bs,
> - int64_t sector_num, int nb_sectors, int *n, BlockDriverState **file)
> +static int coroutine_fn vvfat_co_block_status(BlockDriverState *bs,
> + bool want_zero, int64_t offset,
> + int64_t bytes, int64_t *n,
> + int64_t *map,
> + BlockDriverState **file)
> {
> - *n = bs->total_sectors - sector_num;
> - if (*n > nb_sectors) {
> - *n = nb_sectors;
> - } else if (*n < 0) {
> - return 0;
> - }
> + *n = bytes;
> return BDRV_BLOCK_DATA;
> }
Preexisting, but this is inconsistent with other protocol drivers as far
as OFFSET_VALID is concerned (as I hinted in another mail, I like it
better this way, but it's still inconsistent).
Do we actually need any callback here or could the solution be to simply
remove it like with nvme?
Kevin
- [Qemu-devel] [PATCH v8 05/21] gluster: Switch to .bdrv_co_block_status(), (continued)
- [Qemu-devel] [PATCH v8 05/21] gluster: Switch to .bdrv_co_block_status(), Eric Blake, 2018/02/13
- [Qemu-devel] [PATCH v8 11/21] qcow: Switch to .bdrv_co_block_status(), Eric Blake, 2018/02/13
- [Qemu-devel] [PATCH v8 01/21] block: Add .bdrv_co_block_status() callback, Eric Blake, 2018/02/13
- [Qemu-devel] [PATCH v8 10/21] parallels: Switch to .bdrv_co_block_status(), Eric Blake, 2018/02/13
- [Qemu-devel] [PATCH v8 03/21] block: Switch passthrough drivers to .bdrv_co_block_status(), Eric Blake, 2018/02/13
- [Qemu-devel] [PATCH v8 12/21] qcow2: Switch to .bdrv_co_block_status(), Eric Blake, 2018/02/13
- [Qemu-devel] [PATCH v8 13/21] qed: Switch to .bdrv_co_block_status(), Eric Blake, 2018/02/13
- [Qemu-devel] [PATCH v8 15/21] sheepdog: Switch to .bdrv_co_block_status(), Eric Blake, 2018/02/13
- [Qemu-devel] [PATCH v8 17/21] vdi: Switch to .bdrv_co_block_status(), Eric Blake, 2018/02/13
- [Qemu-devel] [PATCH v8 20/21] vvfat: Switch to .bdrv_co_block_status(), Eric Blake, 2018/02/13
- Re: [Qemu-devel] [PATCH v8 20/21] vvfat: Switch to .bdrv_co_block_status(),
Kevin Wolf <=
- [Qemu-devel] [PATCH v8 19/21] vpc: Switch to .bdrv_co_block_status(), Eric Blake, 2018/02/13
- [Qemu-devel] [PATCH v8 21/21] block: Drop unused .bdrv_co_get_block_status(), Eric Blake, 2018/02/13
- [Qemu-devel] [PATCH v8 16/21] vdi: Avoid bitrot of debugging code, Eric Blake, 2018/02/13
- [Qemu-devel] [PATCH v8 18/21] vmdk: Switch to .bdrv_co_block_status(), Eric Blake, 2018/02/13
- Re: [Qemu-devel] [PATCH v8 00/21] add byte-based block_status driver callbacks, Kevin Wolf, 2018/02/14