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 /blockjob.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 'blockjob.c')
-rw-r--r-- | blockjob.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/blockjob.c b/blockjob.c index b7a29052b9..7310412313 100644 --- a/blockjob.c +++ b/blockjob.c @@ -199,7 +199,7 @@ void block_job_remove_all_bdrv(BlockJob *job) * to process an already freed BdrvChild. */ aio_context_release(job->job.aio_context); - bdrv_graph_wrlock(NULL); + bdrv_graph_wrlock(); aio_context_acquire(job->job.aio_context); while (job->nodes) { GSList *l = job->nodes; @@ -212,7 +212,7 @@ void block_job_remove_all_bdrv(BlockJob *job) g_slist_free_1(l); } - bdrv_graph_wrunlock_ctx(job->job.aio_context); + bdrv_graph_wrunlock(); } bool block_job_has_bdrv(BlockJob *job, BlockDriverState *bs) @@ -514,7 +514,7 @@ void *block_job_create(const char *job_id, const BlockJobDriver *driver, int ret; GLOBAL_STATE_CODE(); - bdrv_graph_wrlock(bs); + bdrv_graph_wrlock(); if (job_id == NULL && !(flags & JOB_INTERNAL)) { job_id = bdrv_get_device_name(bs); @@ -523,7 +523,7 @@ void *block_job_create(const char *job_id, const BlockJobDriver *driver, job = job_create(job_id, &driver->job_driver, txn, bdrv_get_aio_context(bs), flags, cb, opaque, errp); if (job == NULL) { - bdrv_graph_wrunlock(bs); + bdrv_graph_wrunlock(); return NULL; } @@ -563,11 +563,11 @@ void *block_job_create(const char *job_id, const BlockJobDriver *driver, goto fail; } - bdrv_graph_wrunlock(bs); + bdrv_graph_wrunlock(); return job; fail: - bdrv_graph_wrunlock(bs); + bdrv_graph_wrunlock(); job_early_fail(&job->job); return NULL; } |