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/gluster.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/gluster.c')
-rw-r--r-- | block/gluster.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/block/gluster.c b/block/gluster.c index e7bd13cce3..af76d7d59a 100644 --- a/block/gluster.c +++ b/block/gluster.c @@ -38,7 +38,6 @@ typedef struct GlusterAIOCB { int64_t size; int ret; - QEMUBH *bh; Coroutine *coroutine; AioContext *aio_context; } GlusterAIOCB; @@ -622,8 +621,6 @@ static void qemu_gluster_complete_aio(void *opaque) { GlusterAIOCB *acb = (GlusterAIOCB *)opaque; - qemu_bh_delete(acb->bh); - acb->bh = NULL; qemu_coroutine_enter(acb->coroutine); } @@ -642,8 +639,7 @@ static void gluster_finish_aiocb(struct glfs_fd *fd, ssize_t ret, void *arg) acb->ret = -EIO; /* Partial read/write - fail it */ } - acb->bh = aio_bh_new(acb->aio_context, qemu_gluster_complete_aio, acb); - qemu_bh_schedule(acb->bh); + aio_bh_schedule_oneshot(acb->aio_context, qemu_gluster_complete_aio, acb); } static void qemu_gluster_parse_flags(int bdrv_flags, int *open_flags) |