diff options
author | Eric Blake <eblake@redhat.com> | 2016-07-15 17:22:57 -0600 |
---|---|---|
committer | Stefan Hajnoczi <stefanha@redhat.com> | 2016-07-20 14:11:55 +0100 |
commit | 4da444a0bb5b6a7563a785f027402e5af4bd53aa (patch) | |
tree | d583054df368ff5c61087f9860165115f3c3dd69 /block/io.c | |
parent | 7bbca9e290a9c7c217b5a24fc6094e91e54bd05d (diff) | |
download | qemu-4da444a0bb5b6a7563a785f027402e5af4bd53aa.tar.gz qemu-4da444a0bb5b6a7563a785f027402e5af4bd53aa.tar.bz2 qemu-4da444a0bb5b6a7563a785f027402e5af4bd53aa.zip |
block: Convert .bdrv_aio_discard() to byte-based
Another step towards byte-based interfaces everywhere. Replace
the sector-based driver callback .bdrv_aio_discard() with a new
byte-based .bdrv_aio_pdiscard(). Only raw-posix and RBD drivers
are affected, so it was not worth splitting into multiple patches.
Signed-off-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-id: 1468624988-423-9-git-send-email-eblake@redhat.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to 'block/io.c')
-rw-r--r-- | block/io.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/block/io.c b/block/io.c index 58fdac50b2..5c759fae47 100644 --- a/block/io.c +++ b/block/io.c @@ -2423,7 +2423,7 @@ int coroutine_fn bdrv_co_pdiscard(BlockDriverState *bs, int64_t offset, return 0; } - if (!bs->drv->bdrv_co_discard && !bs->drv->bdrv_aio_discard) { + if (!bs->drv->bdrv_co_discard && !bs->drv->bdrv_aio_pdiscard) { return 0; } @@ -2464,9 +2464,8 @@ int coroutine_fn bdrv_co_pdiscard(BlockDriverState *bs, int64_t offset, .coroutine = qemu_coroutine_self(), }; - acb = bs->drv->bdrv_aio_discard(bs, offset >> BDRV_SECTOR_BITS, - num >> BDRV_SECTOR_BITS, - bdrv_co_io_em_complete, &co); + acb = bs->drv->bdrv_aio_pdiscard(bs, offset, num, + bdrv_co_io_em_complete, &co); if (acb == NULL) { ret = -EIO; goto out; |