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/rbd.c | |
parent | 7bbca9e290a9c7c217b5a24fc6094e91e54bd05d (diff) | |
download | qemu-4da444a0bb5b6a7563a785f027402e5af4bd53aa.zip qemu-4da444a0bb5b6a7563a785f027402e5af4bd53aa.tar.gz qemu-4da444a0bb5b6a7563a785f027402e5af4bd53aa.tar.bz2 |
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/rbd.c')
-rw-r--r-- | block/rbd.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/block/rbd.c b/block/rbd.c index 01cbb63..0106fea 100644 --- a/block/rbd.c +++ b/block/rbd.c @@ -930,14 +930,13 @@ static int qemu_rbd_snap_list(BlockDriverState *bs, } #ifdef LIBRBD_SUPPORTS_DISCARD -static BlockAIOCB* qemu_rbd_aio_discard(BlockDriverState *bs, - int64_t sector_num, - int nb_sectors, - BlockCompletionFunc *cb, - void *opaque) +static BlockAIOCB *qemu_rbd_aio_pdiscard(BlockDriverState *bs, + int64_t offset, + int count, + BlockCompletionFunc *cb, + void *opaque) { - return rbd_start_aio(bs, sector_num << BDRV_SECTOR_BITS, NULL, - nb_sectors << BDRV_SECTOR_BITS, cb, opaque, + return rbd_start_aio(bs, offset, NULL, count, cb, opaque, RBD_AIO_DISCARD); } #endif @@ -1001,7 +1000,7 @@ static BlockDriver bdrv_rbd = { #endif #ifdef LIBRBD_SUPPORTS_DISCARD - .bdrv_aio_discard = qemu_rbd_aio_discard, + .bdrv_aio_pdiscard = qemu_rbd_aio_pdiscard, #endif .bdrv_snapshot_create = qemu_rbd_snap_create, |