diff options
author | Fiona Ebner <f.ebner@proxmox.com> | 2025-05-30 17:10:43 +0200 |
---|---|---|
committer | Kevin Wolf <kwolf@redhat.com> | 2025-06-04 18:16:33 +0200 |
commit | 844d550d09ac29ff2b1b49069587ae6a989df31d (patch) | |
tree | be7b2e7841c104493a245b320deee83bda26caeb | |
parent | 3758733959af93b5eb3283659d868ad5b24152b4 (diff) | |
download | qemu-844d550d09ac29ff2b1b49069587ae6a989df31d.zip qemu-844d550d09ac29ff2b1b49069587ae6a989df31d.tar.gz qemu-844d550d09ac29ff2b1b49069587ae6a989df31d.tar.bz2 |
block: mark change_aio_ctx() callback and instances as GRAPH_RDLOCK(_PTR)
This is a small step in preparation to mark bdrv_drained_begin() as
GRAPH_UNLOCKED. More concretely, it is in preparation to move the
drain out of bdrv_change_aio_context() and marking that function as
GRAPH_RDLOCK.
Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Message-ID: <20250530151125.955508-7-f.ebner@proxmox.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
-rw-r--r-- | block.c | 7 | ||||
-rw-r--r-- | block/block-backend.c | 6 | ||||
-rw-r--r-- | blockjob.c | 6 | ||||
-rw-r--r-- | include/block/block_int-common.h | 6 |
4 files changed, 13 insertions, 12 deletions
@@ -1226,9 +1226,10 @@ static int bdrv_child_cb_inactivate(BdrvChild *child) return 0; } -static bool bdrv_child_cb_change_aio_ctx(BdrvChild *child, AioContext *ctx, - GHashTable *visited, Transaction *tran, - Error **errp) +static bool GRAPH_RDLOCK +bdrv_child_cb_change_aio_ctx(BdrvChild *child, AioContext *ctx, + GHashTable *visited, Transaction *tran, + Error **errp) { BlockDriverState *bs = child->opaque; return bdrv_change_aio_context(bs, ctx, visited, tran, errp); diff --git a/block/block-backend.c b/block/block-backend.c index a402db1..6a6949e 100644 --- a/block/block-backend.c +++ b/block/block-backend.c @@ -136,9 +136,9 @@ static void blk_root_drained_end(BdrvChild *child); static void blk_root_change_media(BdrvChild *child, bool load); static void blk_root_resize(BdrvChild *child); -static bool blk_root_change_aio_ctx(BdrvChild *child, AioContext *ctx, - GHashTable *visited, Transaction *tran, - Error **errp); +static bool GRAPH_RDLOCK +blk_root_change_aio_ctx(BdrvChild *child, AioContext *ctx, GHashTable *visited, + Transaction *tran, Error **errp); static char *blk_root_get_parent_desc(BdrvChild *child) { @@ -144,9 +144,9 @@ static TransactionActionDrv change_child_job_context = { .clean = g_free, }; -static bool child_job_change_aio_ctx(BdrvChild *c, AioContext *ctx, - GHashTable *visited, Transaction *tran, - Error **errp) +static bool GRAPH_RDLOCK +child_job_change_aio_ctx(BdrvChild *c, AioContext *ctx, GHashTable *visited, + Transaction *tran, Error **errp) { BlockJob *job = c->opaque; BdrvStateChildJobContext *s; diff --git a/include/block/block_int-common.h b/include/block/block_int-common.h index 2982dd3..37466c7 100644 --- a/include/block/block_int-common.h +++ b/include/block/block_int-common.h @@ -983,9 +983,9 @@ struct BdrvChildClass { bool backing_mask_protocol, Error **errp); - bool (*change_aio_ctx)(BdrvChild *child, AioContext *ctx, - GHashTable *visited, Transaction *tran, - Error **errp); + bool GRAPH_RDLOCK_PTR (*change_aio_ctx)(BdrvChild *child, AioContext *ctx, + GHashTable *visited, + Transaction *tran, Error **errp); /* * I/O API functions. These functions are thread-safe. |