diff options
| author | Kevin Wolf <kwolf@redhat.com> | 2023-10-27 17:53:15 +0200 |
|---|---|---|
| committer | Kevin Wolf <kwolf@redhat.com> | 2023-11-07 19:14:19 +0100 |
| commit | 372b69f503d47eb6619a98cac2ab5a6a569e3483 (patch) | |
| tree | d6b6e92cccbe36366c7b240f1604df40eff16133 /include | |
| parent | f3bbc53dc56c5d410f76442da6ad15ec8f9439fc (diff) | |
| download | focaccia-qemu-372b69f503d47eb6619a98cac2ab5a6a569e3483.tar.gz focaccia-qemu-372b69f503d47eb6619a98cac2ab5a6a569e3483.zip | |
block: Mark bdrv_filter_or_cow_bs() and callers GRAPH_RDLOCK
This adds GRAPH_RDLOCK annotations to declare that callers of bdrv_filter_or_cow_bs() need to hold a reader lock for the graph because it calls bdrv_filter_or_cow_child(), which accesses bs->file/backing. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Message-ID: <20231027155333.420094-7-kwolf@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'include')
| -rw-r--r-- | include/block/block_int-io.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/include/block/block_int-io.h b/include/block/block_int-io.h index 26bff94e4e..6800af7590 100644 --- a/include/block/block_int-io.h +++ b/include/block/block_int-io.h @@ -150,7 +150,8 @@ bdrv_filter_bs(BlockDriverState *bs) return child_bs(bdrv_filter_child(bs)); } -static inline BlockDriverState *bdrv_filter_or_cow_bs(BlockDriverState *bs) +static inline BlockDriverState * GRAPH_RDLOCK +bdrv_filter_or_cow_bs(BlockDriverState *bs) { IO_CODE(); return child_bs(bdrv_filter_or_cow_child(bs)); |