From 1c6c4bb7f0a4cc3987e58880ef96159985dc1228 Mon Sep 17 00:00:00 2001 From: Eric Blake Date: Fri, 15 Jul 2016 17:22:54 -0600 Subject: block: Convert BB interface to byte-based discards Change sector-based blk_discard(), blk_co_discard(), and blk_aio_discard() to instead be byte-based blk_pdiscard(), blk_co_pdiscard(), and blk_aio_pdiscard(). NBD gets a lot simpler now that ignoring the unaligned portion of a byte-based discard request is handled under the hood by the block layer. Signed-off-by: Eric Blake Reviewed-by: Stefan Hajnoczi Message-id: 1468624988-423-6-git-send-email-eblake@redhat.com Signed-off-by: Stefan Hajnoczi --- qemu-io-cmds.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'qemu-io-cmds.c') diff --git a/qemu-io-cmds.c b/qemu-io-cmds.c index 6e29edb..25954f5 100644 --- a/qemu-io-cmds.c +++ b/qemu-io-cmds.c @@ -1696,8 +1696,7 @@ static int discard_f(BlockBackend *blk, int argc, char **argv) } gettimeofday(&t1, NULL); - ret = blk_discard(blk, offset >> BDRV_SECTOR_BITS, - count >> BDRV_SECTOR_BITS); + ret = blk_pdiscard(blk, offset, count); gettimeofday(&t2, NULL); if (ret < 0) { -- cgit v1.1