aboutsummaryrefslogtreecommitdiff
path: root/block/linux-aio.c
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2017-02-13 14:52:32 +0100
committerStefan Hajnoczi <stefanha@redhat.com>2017-02-21 11:39:39 +0000
commitb9e413dd3756f71abe4e8cafe1d7a459ce74ccf4 (patch)
tree3ac75c8cdeedba60249c6eed8d0f35d060b884cf /block/linux-aio.c
parent1919631e6b5562e474690853eca3c35610201e16 (diff)
downloadqemu-b9e413dd3756f71abe4e8cafe1d7a459ce74ccf4.zip
qemu-b9e413dd3756f71abe4e8cafe1d7a459ce74ccf4.tar.gz
qemu-b9e413dd3756f71abe4e8cafe1d7a459ce74ccf4.tar.bz2
block: explicitly acquire aiocontext in aio callbacks that need it
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Fam Zheng <famz@redhat.com> Reviewed-by: Daniel P. Berrange <berrange@redhat.com> Message-id: 20170213135235.12274-16-pbonzini@redhat.com Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to 'block/linux-aio.c')
-rw-r--r--block/linux-aio.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/block/linux-aio.c b/block/linux-aio.c
index f7ae38a..88b8d55 100644
--- a/block/linux-aio.c
+++ b/block/linux-aio.c
@@ -75,7 +75,6 @@ static inline ssize_t io_event_ret(struct io_event *ev)
*/
static void qemu_laio_process_completion(struct qemu_laiocb *laiocb)
{
- LinuxAioState *s = laiocb->ctx;
int ret;
ret = laiocb->ret;
@@ -94,7 +93,6 @@ static void qemu_laio_process_completion(struct qemu_laiocb *laiocb)
}
laiocb->ret = ret;
- aio_context_acquire(s->aio_context);
if (laiocb->co) {
/* If the coroutine is already entered it must be in ioq_submit() and
* will notice laio->ret has been filled in when it eventually runs
@@ -102,13 +100,12 @@ static void qemu_laio_process_completion(struct qemu_laiocb *laiocb)
* that!
*/
if (!qemu_coroutine_entered(laiocb->co)) {
- qemu_coroutine_enter(laiocb->co);
+ aio_co_wake(laiocb->co);
}
} else {
laiocb->common.cb(laiocb->common.opaque, ret);
qemu_aio_unref(laiocb);
}
- aio_context_release(s->aio_context);
}
/**