mirror of
https://github.com/mii443/qemu.git
synced 2025-08-22 23:25:48 +00:00
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 <eblake@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Message-id: 1468624988-423-6-git-send-email-eblake@redhat.com Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
This commit is contained in:
committed by
Stefan Hajnoczi
parent
60ebac16bc
commit
1c6c4bb7f0
@ -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) {
|
||||
|
Reference in New Issue
Block a user