diff options
author | Stefan Hajnoczi <stefanha@redhat.com> | 2023-12-05 13:20:02 -0500 |
---|---|---|
committer | Kevin Wolf <kwolf@redhat.com> | 2023-12-21 22:49:27 +0100 |
commit | 6bc30f19498547fac9cef98316a65cf6c1f14205 (patch) | |
tree | 56411ed59185cc60c896a63b4d58f56628821ffe /block/block-backend.c | |
parent | b5f4fda4fb773257e142429e4fe78bbdea771075 (diff) |
graph-lock: remove AioContext locking
Stop acquiring/releasing the AioContext lock in
bdrv_graph_wrlock()/bdrv_graph_unlock() since the lock no longer has any
effect.
The distinction between bdrv_graph_wrunlock() and
bdrv_graph_wrunlock_ctx() becomes meaningless and they can be collapsed
into one function.
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Message-ID: <20231205182011.1976568-6-stefanha@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'block/block-backend.c')
-rw-r--r-- | block/block-backend.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/block/block-backend.c b/block/block-backend.c index ec21148806..abac4e0235 100644 --- a/block/block-backend.c +++ b/block/block-backend.c @@ -889,7 +889,6 @@ void blk_remove_bs(BlockBackend *blk) { ThrottleGroupMember *tgm = &blk->public.throttle_group_member; BdrvChild *root; - AioContext *ctx; GLOBAL_STATE_CODE(); @@ -919,10 +918,9 @@ void blk_remove_bs(BlockBackend *blk) root = blk->root; blk->root = NULL; - ctx = bdrv_get_aio_context(root->bs); - bdrv_graph_wrlock(root->bs); + bdrv_graph_wrlock(); bdrv_root_unref_child(root); - bdrv_graph_wrunlock_ctx(ctx); + bdrv_graph_wrunlock(); } /* @@ -933,16 +931,15 @@ void blk_remove_bs(BlockBackend *blk) int blk_insert_bs(BlockBackend *blk, BlockDriverState *bs, Error **errp) { ThrottleGroupMember *tgm = &blk->public.throttle_group_member; - AioContext *ctx = bdrv_get_aio_context(bs); GLOBAL_STATE_CODE(); bdrv_ref(bs); - bdrv_graph_wrlock(bs); + bdrv_graph_wrlock(); blk->root = bdrv_root_attach_child(bs, "root", &child_root, BDRV_CHILD_FILTERED | BDRV_CHILD_PRIMARY, blk->perm, blk->shared_perm, blk, errp); - bdrv_graph_wrunlock_ctx(ctx); + bdrv_graph_wrunlock(); if (blk->root == NULL) { return -EPERM; } |