mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-19 08:02:15 -06:00
block: complete public block status API
Include both coroutine and non-coroutine versions, the latter being co_wrapper_mixed_bdrv_rdlock of the former. Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Message-ID: <20230904100306.156197-3-pbonzini@redhat.com> Reviewed-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
This commit is contained in:
parent
b170e92982
commit
1b88457eaa
2 changed files with 16 additions and 19 deletions
18
block/io.c
18
block/io.c
|
@ -2724,21 +2724,13 @@ int coroutine_fn bdrv_co_block_status_above(BlockDriverState *bs,
|
||||||
bytes, pnum, map, file, NULL);
|
bytes, pnum, map, file, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
int bdrv_block_status_above(BlockDriverState *bs, BlockDriverState *base,
|
int coroutine_fn bdrv_co_block_status(BlockDriverState *bs, int64_t offset,
|
||||||
int64_t offset, int64_t bytes, int64_t *pnum,
|
int64_t bytes, int64_t *pnum,
|
||||||
int64_t *map, BlockDriverState **file)
|
int64_t *map, BlockDriverState **file)
|
||||||
{
|
{
|
||||||
IO_CODE();
|
IO_CODE();
|
||||||
return bdrv_common_block_status_above(bs, base, false, true, offset, bytes,
|
return bdrv_co_block_status_above(bs, bdrv_filter_or_cow_bs(bs),
|
||||||
pnum, map, file, NULL);
|
offset, bytes, pnum, map, file);
|
||||||
}
|
|
||||||
|
|
||||||
int bdrv_block_status(BlockDriverState *bs, int64_t offset, int64_t bytes,
|
|
||||||
int64_t *pnum, int64_t *map, BlockDriverState **file)
|
|
||||||
{
|
|
||||||
IO_CODE();
|
|
||||||
return bdrv_block_status_above(bs, bdrv_filter_or_cow_bs(bs),
|
|
||||||
offset, bytes, pnum, map, file);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -127,17 +127,22 @@ int coroutine_fn GRAPH_RDLOCK bdrv_co_zone_append(BlockDriverState *bs,
|
||||||
BdrvRequestFlags flags);
|
BdrvRequestFlags flags);
|
||||||
|
|
||||||
bool bdrv_can_write_zeroes_with_unmap(BlockDriverState *bs);
|
bool bdrv_can_write_zeroes_with_unmap(BlockDriverState *bs);
|
||||||
int bdrv_block_status(BlockDriverState *bs, int64_t offset,
|
|
||||||
int64_t bytes, int64_t *pnum, int64_t *map,
|
int coroutine_fn GRAPH_RDLOCK
|
||||||
BlockDriverState **file);
|
bdrv_co_block_status(BlockDriverState *bs, int64_t offset, int64_t bytes,
|
||||||
|
int64_t *pnum, int64_t *map, BlockDriverState **file);
|
||||||
|
int co_wrapper_mixed_bdrv_rdlock
|
||||||
|
bdrv_block_status(BlockDriverState *bs, int64_t offset, int64_t bytes,
|
||||||
|
int64_t *pnum, int64_t *map, BlockDriverState **file);
|
||||||
|
|
||||||
int coroutine_fn GRAPH_RDLOCK
|
int coroutine_fn GRAPH_RDLOCK
|
||||||
bdrv_co_block_status_above(BlockDriverState *bs, BlockDriverState *base,
|
bdrv_co_block_status_above(BlockDriverState *bs, BlockDriverState *base,
|
||||||
int64_t offset, int64_t bytes, int64_t *pnum,
|
int64_t offset, int64_t bytes, int64_t *pnum,
|
||||||
int64_t *map, BlockDriverState **file);
|
int64_t *map, BlockDriverState **file);
|
||||||
int bdrv_block_status_above(BlockDriverState *bs, BlockDriverState *base,
|
int co_wrapper_mixed_bdrv_rdlock
|
||||||
int64_t offset, int64_t bytes, int64_t *pnum,
|
bdrv_block_status_above(BlockDriverState *bs, BlockDriverState *base,
|
||||||
int64_t *map, BlockDriverState **file);
|
int64_t offset, int64_t bytes, int64_t *pnum,
|
||||||
|
int64_t *map, BlockDriverState **file);
|
||||||
|
|
||||||
int coroutine_fn GRAPH_RDLOCK
|
int coroutine_fn GRAPH_RDLOCK
|
||||||
bdrv_co_is_allocated(BlockDriverState *bs, int64_t offset, int64_t bytes,
|
bdrv_co_is_allocated(BlockDriverState *bs, int64_t offset, int64_t bytes,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue