diff options
author | Emanuele Giuseppe Esposito <eesposit@redhat.com> | 2023-05-04 13:57:43 +0200 |
---|---|---|
committer | Kevin Wolf <kwolf@redhat.com> | 2023-05-10 14:16:54 +0200 |
commit | de335638a399b614d510b978b5c6d1b237e0ac79 (patch) | |
tree | 53eb19797af6ce0311664b5aa6e3c5d3bfe31bf1 /include | |
parent | 9c93652da6784314519968c65c05fcaccfe56193 (diff) |
block: Mark bdrv_co_get_allocated_file_size() and callers GRAPH_RDLOCK
This adds GRAPH_RDLOCK annotations to declare that callers of
bdrv_co_get_allocated_file_size() need to hold a reader lock for the
graph.
Signed-off-by: Emanuele Giuseppe Esposito <eesposit@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Message-Id: <20230504115750.54437-14-kwolf@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/block/block-io.h | 7 | ||||
-rw-r--r-- | include/block/block_int-common.h | 2 |
2 files changed, 6 insertions, 3 deletions
diff --git a/include/block/block-io.h b/include/block/block-io.h index 5dab88521d..fb2adb31c7 100644 --- a/include/block/block-io.h +++ b/include/block/block-io.h @@ -84,8 +84,11 @@ int64_t coroutine_mixed_fn bdrv_nb_sectors(BlockDriverState *bs); int64_t coroutine_fn GRAPH_RDLOCK bdrv_co_getlength(BlockDriverState *bs); int64_t co_wrapper_mixed_bdrv_rdlock bdrv_getlength(BlockDriverState *bs); -int64_t coroutine_fn bdrv_co_get_allocated_file_size(BlockDriverState *bs); -int64_t co_wrapper bdrv_get_allocated_file_size(BlockDriverState *bs); +int64_t coroutine_fn GRAPH_RDLOCK +bdrv_co_get_allocated_file_size(BlockDriverState *bs); + +int64_t co_wrapper_bdrv_rdlock +bdrv_get_allocated_file_size(BlockDriverState *bs); BlockMeasureInfo *bdrv_measure(BlockDriver *drv, QemuOpts *opts, BlockDriverState *in_bs, Error **errp); diff --git a/include/block/block_int-common.h b/include/block/block_int-common.h index 6fb28cd8fa..6e0365d8f2 100644 --- a/include/block/block_int-common.h +++ b/include/block/block_int-common.h @@ -685,7 +685,7 @@ struct BlockDriver { int64_t coroutine_fn GRAPH_RDLOCK_PTR (*bdrv_co_getlength)( BlockDriverState *bs); - int64_t coroutine_fn (*bdrv_co_get_allocated_file_size)( + int64_t coroutine_fn GRAPH_RDLOCK_PTR (*bdrv_co_get_allocated_file_size)( BlockDriverState *bs); BlockMeasureInfo *(*bdrv_measure)(QemuOpts *opts, BlockDriverState *in_bs, |