diff options
Diffstat (limited to 'include/block')
-rw-r--r-- | include/block/block.h | 10 | ||||
-rw-r--r-- | include/block/block_int.h | 8 | ||||
-rw-r--r-- | include/block/nbd.h | 2 |
3 files changed, 9 insertions, 11 deletions
diff --git a/include/block/block.h b/include/block/block.h index 616d8b9f12..11c162d594 100644 --- a/include/block/block.h +++ b/include/block/block.h @@ -316,9 +316,9 @@ BlockAIOCB *bdrv_aio_writev(BdrvChild *child, int64_t sector_num, BlockCompletionFunc *cb, void *opaque); BlockAIOCB *bdrv_aio_flush(BlockDriverState *bs, BlockCompletionFunc *cb, void *opaque); -BlockAIOCB *bdrv_aio_discard(BlockDriverState *bs, - int64_t sector_num, int nb_sectors, - BlockCompletionFunc *cb, void *opaque); +BlockAIOCB *bdrv_aio_pdiscard(BlockDriverState *bs, + int64_t offset, int count, + BlockCompletionFunc *cb, void *opaque); void bdrv_aio_cancel(BlockAIOCB *acb); void bdrv_aio_cancel_async(BlockAIOCB *acb); @@ -341,8 +341,8 @@ void bdrv_drain(BlockDriverState *bs); void coroutine_fn bdrv_co_drain(BlockDriverState *bs); void bdrv_drain_all(void); -int bdrv_discard(BlockDriverState *bs, int64_t sector_num, int nb_sectors); -int bdrv_co_discard(BlockDriverState *bs, int64_t sector_num, int nb_sectors); +int bdrv_pdiscard(BlockDriverState *bs, int64_t offset, int count); +int bdrv_co_pdiscard(BlockDriverState *bs, int64_t offset, int count); int bdrv_has_zero_init_1(BlockDriverState *bs); int bdrv_has_zero_init(BlockDriverState *bs); bool bdrv_unallocated_blocks_are_zero(BlockDriverState *bs); diff --git a/include/block/block_int.h b/include/block/block_int.h index 09be16f88c..1fe0fd9ff6 100644 --- a/include/block/block_int.h +++ b/include/block/block_int.h @@ -142,8 +142,8 @@ struct BlockDriver { BlockCompletionFunc *cb, void *opaque); BlockAIOCB *(*bdrv_aio_flush)(BlockDriverState *bs, BlockCompletionFunc *cb, void *opaque); - BlockAIOCB *(*bdrv_aio_discard)(BlockDriverState *bs, - int64_t sector_num, int nb_sectors, + BlockAIOCB *(*bdrv_aio_pdiscard)(BlockDriverState *bs, + int64_t offset, int count, BlockCompletionFunc *cb, void *opaque); int coroutine_fn (*bdrv_co_readv)(BlockDriverState *bs, @@ -165,8 +165,8 @@ struct BlockDriver { */ int coroutine_fn (*bdrv_co_pwrite_zeroes)(BlockDriverState *bs, int64_t offset, int count, BdrvRequestFlags flags); - int coroutine_fn (*bdrv_co_discard)(BlockDriverState *bs, - int64_t sector_num, int nb_sectors); + int coroutine_fn (*bdrv_co_pdiscard)(BlockDriverState *bs, + int64_t offset, int count); int64_t coroutine_fn (*bdrv_co_get_block_status)(BlockDriverState *bs, int64_t sector_num, int nb_sectors, int *pnum, BlockDriverState **file); diff --git a/include/block/nbd.h b/include/block/nbd.h index eeda3ebdf7..cb91820f38 100644 --- a/include/block/nbd.h +++ b/include/block/nbd.h @@ -77,7 +77,6 @@ enum { /* Maximum size of a single READ/WRITE data buffer */ #define NBD_MAX_BUFFER_SIZE (32 * 1024 * 1024) -#define NBD_MAX_SECTORS (NBD_MAX_BUFFER_SIZE / BDRV_SECTOR_SIZE) /* Maximum size of an export name. The NBD spec requires 256 and * suggests that servers support up to 4096, but we stick to only the @@ -89,7 +88,6 @@ enum { ssize_t nbd_wr_syncv(QIOChannel *ioc, struct iovec *iov, size_t niov, - size_t offset, size_t length, bool do_read); int nbd_receive_negotiate(QIOChannel *ioc, const char *name, uint32_t *flags, |