mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-01 14:53:54 -06:00
block: Use BdrvChild to discard
Other I/O functions are already using a BdrvChild pointer in the API, so make discard do the same. It makes it possible to initiate the same permission checks before doing I/O, and much easier to share the helper functions for this, which will be added and used by write, truncate and copy range paths. Signed-off-by: Fam Zheng <famz@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
This commit is contained in:
parent
ecc983a507
commit
0b9fd3f467
11 changed files with 20 additions and 20 deletions
|
@ -418,8 +418,8 @@ AioWait *bdrv_get_aio_wait(BlockDriverState *bs);
|
|||
bdrv_get_aio_context(bs_), \
|
||||
cond); })
|
||||
|
||||
int bdrv_pdiscard(BlockDriverState *bs, int64_t offset, int bytes);
|
||||
int bdrv_co_pdiscard(BlockDriverState *bs, int64_t offset, int bytes);
|
||||
int bdrv_pdiscard(BdrvChild *child, int64_t offset, int bytes);
|
||||
int bdrv_co_pdiscard(BdrvChild *child, int64_t offset, int bytes);
|
||||
int bdrv_has_zero_init_1(BlockDriverState *bs);
|
||||
int bdrv_has_zero_init(BlockDriverState *bs);
|
||||
bool bdrv_unallocated_blocks_are_zero(BlockDriverState *bs);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue