[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 11/24] block: Mark bdrv_filter_child() and callers GRAPH_RDLOCK
From: |
Kevin Wolf |
Subject: |
[PATCH 11/24] block: Mark bdrv_filter_child() and callers GRAPH_RDLOCK |
Date: |
Fri, 27 Oct 2023 17:53:20 +0200 |
This adds GRAPH_RDLOCK annotations to declare that callers of
bdrv_filter_child() need to hold a reader lock for the graph because it
accesses bs->file/backing.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
include/block/block_int-io.h | 4 ++--
block.c | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/include/block/block_int-io.h b/include/block/block_int-io.h
index 4e7bf57a5e..17547a2dab 100644
--- a/include/block/block_int-io.h
+++ b/include/block/block_int-io.h
@@ -131,8 +131,8 @@ int co_wrapper_mixed_bdrv_rdlock
bdrv_refresh_total_sectors(BlockDriverState *bs, int64_t hint);
BdrvChild *bdrv_cow_child(BlockDriverState *bs);
-BdrvChild *bdrv_filter_child(BlockDriverState *bs);
-BdrvChild *bdrv_filter_or_cow_child(BlockDriverState *bs);
+BdrvChild * GRAPH_RDLOCK bdrv_filter_child(BlockDriverState *bs);
+BdrvChild * GRAPH_RDLOCK bdrv_filter_or_cow_child(BlockDriverState *bs);
BdrvChild * GRAPH_RDLOCK bdrv_primary_child(BlockDriverState *bs);
BlockDriverState * GRAPH_RDLOCK bdrv_skip_filters(BlockDriverState *bs);
BlockDriverState * GRAPH_RDLOCK bdrv_backing_chain_next(BlockDriverState *bs);
diff --git a/block.c b/block.c
index bb322df7d8..499b147315 100644
--- a/block.c
+++ b/block.c
@@ -8491,8 +8491,8 @@ BdrvChild *bdrv_primary_child(BlockDriverState *bs)
return found;
}
-static BlockDriverState *bdrv_do_skip_filters(BlockDriverState *bs,
- bool stop_on_explicit_filter)
+static BlockDriverState * GRAPH_RDLOCK
+bdrv_do_skip_filters(BlockDriverState *bs, bool stop_on_explicit_filter)
{
BdrvChild *c;
--
2.41.0
- [PATCH 00/24] block: Graph locking part 6 (bs->file/backing), Kevin Wolf, 2023/10/27
- [PATCH 01/24] block: Mark bdrv_probe_blocksizes() and callers GRAPH_RDLOCK, Kevin Wolf, 2023/10/27
- [PATCH 02/24] block: Mark bdrv_has_zero_init() and callers GRAPH_RDLOCK, Kevin Wolf, 2023/10/27
- [PATCH 08/24] block: Mark bdrv_skip_filters() and callers GRAPH_RDLOCK, Kevin Wolf, 2023/10/27
- [PATCH 13/24] block: Mark bdrv_set_backing_hd_drained() GRAPH_WRLOCK, Kevin Wolf, 2023/10/27
- [PATCH 11/24] block: Mark bdrv_filter_child() and callers GRAPH_RDLOCK,
Kevin Wolf <=
- [PATCH 03/24] block: Mark bdrv_filter_bs() and callers GRAPH_RDLOCK, Kevin Wolf, 2023/10/27
- [PATCH 05/24] block: Mark block_job_add_bdrv() GRAPH_WRLOCK, Kevin Wolf, 2023/10/27
- [PATCH 15/24] block: Mark bdrv_replace_node_common() GRAPH_WRLOCK, Kevin Wolf, 2023/10/27
- [PATCH 10/24] block: Mark bdrv_chain_contains() and callers GRAPH_RDLOCK, Kevin Wolf, 2023/10/27