summaryrefslogtreecommitdiff
path: root/block/nbd.c
diff options
context:
space:
mode:
authorEric Blake <eblake@redhat.com>2016-07-15 17:23:02 -0600
committerStefan Hajnoczi <stefanha@redhat.com>2016-07-20 14:24:25 +0100
commit447e57c3b056c310463238268d514798b23c376f (patch)
tree39862b70579c97d2b212eeb10db8bc04f34c8d84 /block/nbd.c
parent97c7e85cfea4f4edc1536c50ca2f3c1627d8e443 (diff)
downloadqemu-447e57c3b056c310463238268d514798b23c376f.zip
nbd: Switch .bdrv_co_discard() to byte-based
Another step towards killing off sector-based block APIs. While at it, call directly into nbd-client.c instead of having a pointless trivial wrapper in nbd.c. Signed-off-by: Eric Blake <eblake@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Message-id: 1468624988-423-14-git-send-email-eblake@redhat.com Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to 'block/nbd.c')
-rw-r--r--block/nbd.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/block/nbd.c b/block/nbd.c
index 8a130787c5..42cae0e1fd 100644
--- a/block/nbd.c
+++ b/block/nbd.c
@@ -360,12 +360,6 @@ static void nbd_refresh_limits(BlockDriverState *bs, Error **errp)
bs->bl.max_transfer = NBD_MAX_BUFFER_SIZE;
}
-static int nbd_co_discard(BlockDriverState *bs, int64_t sector_num,
- int nb_sectors)
-{
- return nbd_client_co_discard(bs, sector_num, nb_sectors);
-}
-
static void nbd_close(BlockDriverState *bs)
{
nbd_client_close(bs);
@@ -448,7 +442,7 @@ static BlockDriver bdrv_nbd = {
.bdrv_co_writev_flags = nbd_client_co_writev,
.bdrv_close = nbd_close,
.bdrv_co_flush_to_os = nbd_co_flush,
- .bdrv_co_discard = nbd_co_discard,
+ .bdrv_co_pdiscard = nbd_client_co_pdiscard,
.bdrv_refresh_limits = nbd_refresh_limits,
.bdrv_getlength = nbd_getlength,
.bdrv_detach_aio_context = nbd_detach_aio_context,
@@ -466,7 +460,7 @@ static BlockDriver bdrv_nbd_tcp = {
.bdrv_co_writev_flags = nbd_client_co_writev,
.bdrv_close = nbd_close,
.bdrv_co_flush_to_os = nbd_co_flush,
- .bdrv_co_discard = nbd_co_discard,
+ .bdrv_co_pdiscard = nbd_client_co_pdiscard,
.bdrv_refresh_limits = nbd_refresh_limits,
.bdrv_getlength = nbd_getlength,
.bdrv_detach_aio_context = nbd_detach_aio_context,
@@ -484,7 +478,7 @@ static BlockDriver bdrv_nbd_unix = {
.bdrv_co_writev_flags = nbd_client_co_writev,
.bdrv_close = nbd_close,
.bdrv_co_flush_to_os = nbd_co_flush,
- .bdrv_co_discard = nbd_co_discard,
+ .bdrv_co_pdiscard = nbd_client_co_pdiscard,
.bdrv_refresh_limits = nbd_refresh_limits,
.bdrv_getlength = nbd_getlength,
.bdrv_detach_aio_context = nbd_detach_aio_context,