diff options
author | Emanuele Giuseppe Esposito <eesposit@redhat.com> | 2023-05-04 13:57:44 +0200 |
---|---|---|
committer | Kevin Wolf <kwolf@redhat.com> | 2023-05-10 14:16:54 +0200 |
commit | a00e70c01241590b6c80dca4ee39b9de0b10097e (patch) | |
tree | e0688fb5c5d395fb0b583047c451f274512ae5af /block/io.c | |
parent | de335638a399b614d510b978b5c6d1b237e0ac79 (diff) | |
download | qemu-a00e70c01241590b6c80dca4ee39b9de0b10097e.zip qemu-a00e70c01241590b6c80dca4ee39b9de0b10097e.tar.gz qemu-a00e70c01241590b6c80dca4ee39b9de0b10097e.tar.bz2 |
block: Mark bdrv_co_get_info() and callers GRAPH_RDLOCK
This adds GRAPH_RDLOCK annotations to declare that callers of
bdrv_co_get_info() 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>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-Id: <20230504115750.54437-15-kwolf@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'block/io.c')
-rw-r--r-- | block/io.c | 11 |
1 files changed, 5 insertions, 6 deletions
@@ -727,10 +727,9 @@ BdrvTrackedRequest *coroutine_fn bdrv_co_get_self_request(BlockDriverState *bs) /** * Round a region to cluster boundaries */ -void coroutine_fn bdrv_round_to_clusters(BlockDriverState *bs, - int64_t offset, int64_t bytes, - int64_t *cluster_offset, - int64_t *cluster_bytes) +void coroutine_fn GRAPH_RDLOCK +bdrv_round_to_clusters(BlockDriverState *bs, int64_t offset, int64_t bytes, + int64_t *cluster_offset, int64_t *cluster_bytes) { BlockDriverInfo bdi; IO_CODE(); @@ -744,7 +743,7 @@ void coroutine_fn bdrv_round_to_clusters(BlockDriverState *bs, } } -static coroutine_fn int bdrv_get_cluster_size(BlockDriverState *bs) +static int coroutine_fn GRAPH_RDLOCK bdrv_get_cluster_size(BlockDriverState *bs) { BlockDriverInfo bdi; int ret; @@ -1800,7 +1799,7 @@ fail: return ret; } -static inline int coroutine_fn +static inline int coroutine_fn GRAPH_RDLOCK bdrv_co_write_req_prepare(BdrvChild *child, int64_t offset, int64_t bytes, BdrvTrackedRequest *req, int flags) { |