summaryrefslogtreecommitdiff
path: root/block
diff options
context:
space:
mode:
authorEric Blake <eblake@redhat.com>2016-07-15 17:23:04 -0600
committerStefan Hajnoczi <stefanha@redhat.com>2016-07-20 14:24:25 +0100
commit5f61ad079af198aa6ba46e4461715ed834f72214 (patch)
treebea51263de805f2f71c5ccf1793e051adcfcf533 /block
parent82e8a7888b7840e6b1770e131970d031ad64bc5b (diff)
downloadqemu-5f61ad079af198aa6ba46e4461715ed834f72214.tar.gz
qemu-5f61ad079af198aa6ba46e4461715ed834f72214.tar.bz2
qemu-5f61ad079af198aa6ba46e4461715ed834f72214.zip
raw_bsd: Switch .bdrv_co_discard() to byte-based
Another step towards killing off sector-based block APIs. Signed-off-by: Eric Blake <eblake@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Message-id: 1468624988-423-16-git-send-email-eblake@redhat.com Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to 'block')
-rw-r--r--block/raw_bsd.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/block/raw_bsd.c b/block/raw_bsd.c
index 68f0a91a9a..961aa1370a 100644
--- a/block/raw_bsd.c
+++ b/block/raw_bsd.c
@@ -134,11 +134,10 @@ static int coroutine_fn raw_co_pwrite_zeroes(BlockDriverState *bs,
return bdrv_co_pwrite_zeroes(bs->file, offset, count, flags);
}
-static int coroutine_fn raw_co_discard(BlockDriverState *bs,
- int64_t sector_num, int nb_sectors)
+static int coroutine_fn raw_co_pdiscard(BlockDriverState *bs,
+ int64_t offset, int count)
{
- return bdrv_co_pdiscard(bs->file->bs, sector_num << BDRV_SECTOR_BITS,
- nb_sectors << BDRV_SECTOR_BITS);
+ return bdrv_co_pdiscard(bs->file->bs, offset, count);
}
static int64_t raw_getlength(BlockDriverState *bs)
@@ -244,7 +243,7 @@ BlockDriver bdrv_raw = {
.bdrv_co_readv = &raw_co_readv,
.bdrv_co_writev_flags = &raw_co_writev_flags,
.bdrv_co_pwrite_zeroes = &raw_co_pwrite_zeroes,
- .bdrv_co_discard = &raw_co_discard,
+ .bdrv_co_pdiscard = &raw_co_pdiscard,
.bdrv_co_get_block_status = &raw_co_get_block_status,
.bdrv_truncate = &raw_truncate,
.bdrv_getlength = &raw_getlength,