From 60ebac16bca3e3bf07c7ae67a69a7730aaa48712 Mon Sep 17 00:00:00 2001 From: Eric Blake Date: Fri, 15 Jul 2016 17:22:53 -0600 Subject: block: Convert bdrv_aio_discard() to byte-based Another step towards byte-based interfaces everywhere. Replace the sector-based bdrv_aio_discard() with a new byte-based bdrv_aio_pdiscard(), which silently ignores any unaligned head or tail. Driver callbacks will be converted in followup patches. Signed-off-by: Eric Blake Message-id: 1468624988-423-5-git-send-email-eblake@redhat.com Signed-off-by: Stefan Hajnoczi --- block/block-backend.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'block/block-backend.c') diff --git a/block/block-backend.c b/block/block-backend.c index 83b6407ea6..8b16b95aab 100644 --- a/block/block-backend.c +++ b/block/block-backend.c @@ -1074,7 +1074,8 @@ BlockAIOCB *blk_aio_discard(BlockBackend *blk, return blk_abort_aio_request(blk, cb, opaque, ret); } - return bdrv_aio_discard(blk_bs(blk), sector_num, nb_sectors, cb, opaque); + return bdrv_aio_pdiscard(blk_bs(blk), sector_num << BDRV_SECTOR_BITS, + nb_sectors << BDRV_SECTOR_BITS, cb, opaque); } void blk_aio_cancel(BlockAIOCB *acb) -- cgit v1.2.3