summaryrefslogtreecommitdiff
path: root/block/rbd.c
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2016-10-03 18:14:16 +0200
committerKevin Wolf <kwolf@redhat.com>2016-10-07 13:34:07 +0200
commitfffb6e12233002c26c0ee9ff92fa87927cd779f2 (patch)
tree58513502dcb4fab664a02eb06b0751f8c8d2e913 /block/rbd.c
parent5b8bb3595a2941e9408021f1080e60ce86d677d2 (diff)
downloadqemu-fffb6e12233002c26c0ee9ff92fa87927cd779f2.zip
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/rbd.c')
-rw-r--r--block/rbd.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/block/rbd.c b/block/rbd.c
index 0106fea45f..6f9eb6fb9c 100644
--- a/block/rbd.c
+++ b/block/rbd.c
@@ -71,7 +71,6 @@ typedef enum {
typedef struct RBDAIOCB {
BlockAIOCB common;
- QEMUBH *bh;
int64_t ret;
QEMUIOVector *qiov;
char *bounce;
@@ -602,7 +601,6 @@ static const AIOCBInfo rbd_aiocb_info = {
static void rbd_finish_bh(void *opaque)
{
RADOSCB *rcb = opaque;
- qemu_bh_delete(rcb->acb->bh);
qemu_rbd_complete_aio(rcb);
}
@@ -621,9 +619,8 @@ static void rbd_finish_aiocb(rbd_completion_t c, RADOSCB *rcb)
rcb->ret = rbd_aio_get_return_value(c);
rbd_aio_release(c);
- acb->bh = aio_bh_new(bdrv_get_aio_context(acb->common.bs),
- rbd_finish_bh, rcb);
- qemu_bh_schedule(acb->bh);
+ aio_bh_schedule_oneshot(bdrv_get_aio_context(acb->common.bs),
+ rbd_finish_bh, rcb);
}
static int rbd_aio_discard_wrapper(rbd_image_t image,
@@ -679,7 +676,6 @@ static BlockAIOCB *rbd_start_aio(BlockDriverState *bs,
acb->ret = 0;
acb->error = 0;
acb->s = s;
- acb->bh = NULL;
if (cmd == RBD_AIO_WRITE) {
qemu_iovec_to_buf(acb->qiov, 0, acb->bounce, qiov->size);