aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Hajnoczi <stefanha@redhat.com>2023-09-12 19:10:36 -0400
committerKevin Wolf <kwolf@redhat.com>2023-09-20 17:46:01 +0200
commit0f86afde66ea0d9a383878223ac07bd111c69692 (patch)
treef6150ca5e6f50c94a14b7ab336ee52450c96bc5a
parent46eb6e861b0a622541593ea6db85e7c971dadb28 (diff)
downloadqemu-0f86afde66ea0d9a383878223ac07bd111c69692.zip
qemu-0f86afde66ea0d9a383878223ac07bd111c69692.tar.gz
qemu-0f86afde66ea0d9a383878223ac07bd111c69692.tar.bz2
block-backend: process zoned requests in the current AioContext
Process zoned requests in the current thread's AioContext instead of in the BlockBackend's AioContext. There is no need to use the BlockBackend's AioContext thanks to CoMutex bs->wps->colock, which protects zone metadata. Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Message-ID: <20230912231037.826804-5-stefanha@redhat.com> Reviewed-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
-rw-r--r--block/block-backend.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/block/block-backend.c b/block/block-backend.c
index 6f0a608..9dbdbe5 100644
--- a/block/block-backend.c
+++ b/block/block-backend.c
@@ -1907,11 +1907,11 @@ BlockAIOCB *blk_aio_zone_report(BlockBackend *blk, int64_t offset,
acb->has_returned = false;
co = qemu_coroutine_create(blk_aio_zone_report_entry, acb);
- aio_co_enter(blk_get_aio_context(blk), co);
+ aio_co_enter(qemu_get_current_aio_context(), co);
acb->has_returned = true;
if (acb->rwco.ret != NOT_DONE) {
- replay_bh_schedule_oneshot_event(blk_get_aio_context(blk),
+ replay_bh_schedule_oneshot_event(qemu_get_current_aio_context(),
blk_aio_complete_bh, acb);
}
@@ -1948,11 +1948,11 @@ BlockAIOCB *blk_aio_zone_mgmt(BlockBackend *blk, BlockZoneOp op,
acb->has_returned = false;
co = qemu_coroutine_create(blk_aio_zone_mgmt_entry, acb);
- aio_co_enter(blk_get_aio_context(blk), co);
+ aio_co_enter(qemu_get_current_aio_context(), co);
acb->has_returned = true;
if (acb->rwco.ret != NOT_DONE) {
- replay_bh_schedule_oneshot_event(blk_get_aio_context(blk),
+ replay_bh_schedule_oneshot_event(qemu_get_current_aio_context(),
blk_aio_complete_bh, acb);
}
@@ -1988,10 +1988,10 @@ BlockAIOCB *blk_aio_zone_append(BlockBackend *blk, int64_t *offset,
acb->has_returned = false;
co = qemu_coroutine_create(blk_aio_zone_append_entry, acb);
- aio_co_enter(blk_get_aio_context(blk), co);
+ aio_co_enter(qemu_get_current_aio_context(), co);
acb->has_returned = true;
if (acb->rwco.ret != NOT_DONE) {
- replay_bh_schedule_oneshot_event(blk_get_aio_context(blk),
+ replay_bh_schedule_oneshot_event(qemu_get_current_aio_context(),
blk_aio_complete_bh, acb);
}