[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-block] [PULL 20/37] vvfat: Switch to .bdrv_co_block_status()
From: |
Kevin Wolf |
Subject: |
[Qemu-block] [PULL 20/37] vvfat: Switch to .bdrv_co_block_status() |
Date: |
Fri, 2 Mar 2018 19:54:31 +0100 |
From: Eric Blake <address@hidden>
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>
Signed-off-by: Kevin Wolf <address@hidden>
---
block/vvfat.c | 16 +++++++---------
1 file changed, 7 insertions(+), 9 deletions(-)
diff --git a/block/vvfat.c b/block/vvfat.c
index 7e06ebacf6..4a17a49e12 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;
}
@@ -3257,7 +3255,7 @@ static BlockDriver bdrv_vvfat = {
.bdrv_co_preadv = vvfat_co_preadv,
.bdrv_co_pwritev = vvfat_co_pwritev,
- .bdrv_co_get_block_status = vvfat_co_get_block_status,
+ .bdrv_co_block_status = vvfat_co_block_status,
};
static void bdrv_vvfat_init(void)
--
2.13.6
- [Qemu-block] [PULL 10/37] parallels: Switch to .bdrv_co_block_status(), (continued)
- [Qemu-block] [PULL 10/37] parallels: Switch to .bdrv_co_block_status(), Kevin Wolf, 2018/03/02
- [Qemu-block] [PULL 11/37] qcow: Switch to .bdrv_co_block_status(), Kevin Wolf, 2018/03/02
- [Qemu-block] [PULL 12/37] qcow2: Switch to .bdrv_co_block_status(), Kevin Wolf, 2018/03/02
- [Qemu-block] [PULL 13/37] qed: Switch to .bdrv_co_block_status(), Kevin Wolf, 2018/03/02
- [Qemu-block] [PULL 14/37] raw: Switch to .bdrv_co_block_status(), Kevin Wolf, 2018/03/02
- [Qemu-block] [PULL 15/37] sheepdog: Switch to .bdrv_co_block_status(), Kevin Wolf, 2018/03/02
- [Qemu-block] [PULL 16/37] vdi: Avoid bitrot of debugging code, Kevin Wolf, 2018/03/02
- [Qemu-block] [PULL 17/37] vdi: Switch to .bdrv_co_block_status(), Kevin Wolf, 2018/03/02
- [Qemu-block] [PULL 18/37] vmdk: Switch to .bdrv_co_block_status(), Kevin Wolf, 2018/03/02
- [Qemu-block] [PULL 19/37] vpc: Switch to .bdrv_co_block_status(), Kevin Wolf, 2018/03/02
- [Qemu-block] [PULL 20/37] vvfat: Switch to .bdrv_co_block_status(),
Kevin Wolf <=
- [Qemu-block] [PULL 21/37] block: Drop unused .bdrv_co_get_block_status(), Kevin Wolf, 2018/03/02
- [Qemu-block] [PULL 22/37] block: fix write with zero flag set and iovector provided, Kevin Wolf, 2018/03/02
- [Qemu-block] [PULL 23/37] iotest 033: add misaligned write-zeroes test via truncate, Kevin Wolf, 2018/03/02
- [Qemu-block] [PULL 26/37] aio: rename aio_context_in_iothread() to in_aio_context_home_thread(), Kevin Wolf, 2018/03/02
- [Qemu-block] [PULL 24/37] specs/qcow2: Fix documentation of the compressed cluster descriptor, Kevin Wolf, 2018/03/02
- [Qemu-block] [PULL 25/37] docs: document how to use the l2-cache-entry-size parameter, Kevin Wolf, 2018/03/02
- [Qemu-block] [PULL 27/37] block: extract AIO_WAIT_WHILE() from BlockDriverState, Kevin Wolf, 2018/03/02
- [Qemu-block] [PULL 28/37] block: add BlockBackend->in_flight counter, Kevin Wolf, 2018/03/02
- [Qemu-block] [PULL 30/37] Revert "IDE: Do not flush empty CDROM drives", Kevin Wolf, 2018/03/02