diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2016-10-03 18:14:16 +0200 |
---|---|---|
committer | Kevin Wolf <kwolf@redhat.com> | 2016-10-07 13:34:07 +0200 |
commit | fffb6e12233002c26c0ee9ff92fa87927cd779f2 (patch) | |
tree | 58513502dcb4fab664a02eb06b0751f8c8d2e913 /block/qed.c | |
parent | 5b8bb3595a2941e9408021f1080e60ce86d677d2 (diff) |
block: use aio_bh_schedule_oneshot
This simplifies bottom half handlers by removing calls to qemu_bh_delete and
thus removing the need to stash the bottom half pointer in the opaque
datum.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'block/qed.c')
-rw-r--r-- | block/qed.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/block/qed.c b/block/qed.c index 426f3cb447..3ee879b52e 100644 --- a/block/qed.c +++ b/block/qed.c @@ -909,7 +909,6 @@ static void qed_aio_complete_bh(void *opaque) void *user_opaque = acb->common.opaque; int ret = acb->bh_ret; - qemu_bh_delete(acb->bh); qemu_aio_unref(acb); /* Invoke callback */ @@ -934,9 +933,8 @@ static void qed_aio_complete(QEDAIOCB *acb, int ret) /* Arrange for a bh to invoke the completion function */ acb->bh_ret = ret; - acb->bh = aio_bh_new(bdrv_get_aio_context(acb->common.bs), - qed_aio_complete_bh, acb); - qemu_bh_schedule(acb->bh); + aio_bh_schedule_oneshot(bdrv_get_aio_context(acb->common.bs), + qed_aio_complete_bh, acb); /* Start next allocating write request waiting behind this one. Note that * requests enqueue themselves when they first hit an unallocated cluster |