[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 30/31] vvfat: Switch to .bdrv_co_block_status()
From: |
Eric Blake |
Subject: |
[Qemu-devel] [PATCH 30/31] vvfat: Switch to .bdrv_co_block_status() |
Date: |
Mon, 17 Apr 2017 20:33:55 -0500 |
We are gradually moving away from sector-based interfaces, towards
byte-based. Update the vvfat driver accordingly.
Signed-off-by: Eric Blake <address@hidden>
---
block/vvfat.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/block/vvfat.c b/block/vvfat.c
index bef2056..825fe72 100644
--- a/block/vvfat.c
+++ b/block/vvfat.c
@@ -2961,13 +2961,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 int64_t coroutine_fn vvfat_co_block_status(BlockDriverState *bs,
+ int64_t offset, int64_t bytes, int64_t *n, BlockDriverState **file)
{
BDRVVVFATState* s = bs->opaque;
- *n = s->sector_count - sector_num;
- if (*n > nb_sectors) {
- *n = nb_sectors;
+ *n = s->sector_count * BDRV_SECTOR_SIZE - offset;
+ if (*n > bytes) {
+ *n = bytes;
} else if (*n < 0) {
return 0;
}
@@ -3124,7 +3124,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.9.3
- Re: [Qemu-devel] [PATCH 20/31] parallels: Switch to .bdrv_co_block_status(), (continued)
- [Qemu-devel] [PATCH 21/31] qcow: Switch to .bdrv_co_block_status(), Eric Blake, 2017/04/17
- [Qemu-devel] [PATCH 22/31] qcow2: Switch to .bdrv_co_block_status(), Eric Blake, 2017/04/17
- [Qemu-devel] [PATCH 23/31] qed: Switch to .bdrv_co_block_status(), Eric Blake, 2017/04/17
- [Qemu-devel] [PATCH 24/31] raw: Switch to .bdrv_co_block_status(), Eric Blake, 2017/04/17
- [Qemu-devel] [PATCH 25/31] sheepdog: Switch to .bdrv_co_block_status(), Eric Blake, 2017/04/17
- [Qemu-devel] [PATCH 26/31] vdi: Avoid bitrot of debugging code, Eric Blake, 2017/04/17
- [Qemu-devel] [PATCH 27/31] vdi: Switch to .bdrv_co_block_status(), Eric Blake, 2017/04/17
- [Qemu-devel] [PATCH 28/31] vmdk: Switch to .bdrv_co_block_status(), Eric Blake, 2017/04/17
- [Qemu-devel] [PATCH 30/31] vvfat: Switch to .bdrv_co_block_status(),
Eric Blake <=
- [Qemu-devel] [PATCH 29/31] vpc: Switch to .bdrv_co_block_status(), Eric Blake, 2017/04/17
- [Qemu-devel] [PATCH 31/31] block: Drop unused .bdrv_co_get_block_status(), Eric Blake, 2017/04/17
- Re: [Qemu-devel] [Qemu-block] [PATCH 00/31] make bdrv_get_block_status byte-based, Eric Blake, 2017/04/17
- Re: [Qemu-devel] [PATCH 00/31] make bdrv_get_block_status byte-based, Eric Blake, 2017/04/18