[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL v2 24/59] block: Drop AIOCBInfo.cancel
From: |
Stefan Hajnoczi |
Subject: |
[Qemu-devel] [PULL v2 24/59] block: Drop AIOCBInfo.cancel |
Date: |
Mon, 22 Sep 2014 12:41:55 +0100 |
From: Fam Zheng <address@hidden>
Now that all the implementations are converted to asynchronous version
and we can emulate synchronous cancellation with it. Let's drop the
unused member.
Signed-off-by: Fam Zheng <address@hidden>
Signed-off-by: Stefan Hajnoczi <address@hidden>
---
block.c | 24 ++++++++++--------------
include/block/aio.h | 1 -
2 files changed, 10 insertions(+), 15 deletions(-)
diff --git a/block.c b/block.c
index 45d3a5b..3a3648d 100644
--- a/block.c
+++ b/block.c
@@ -4640,22 +4640,18 @@ int bdrv_aio_multiwrite(BlockDriverState *bs,
BlockRequest *reqs, int num_reqs)
void bdrv_aio_cancel(BlockDriverAIOCB *acb)
{
- if (acb->aiocb_info->cancel) {
- acb->aiocb_info->cancel(acb);
- } else {
- qemu_aio_ref(acb);
- bdrv_aio_cancel_async(acb);
- while (acb->refcnt > 1) {
- if (acb->aiocb_info->get_aio_context) {
- aio_poll(acb->aiocb_info->get_aio_context(acb), true);
- } else if (acb->bs) {
- aio_poll(bdrv_get_aio_context(acb->bs), true);
- } else {
- abort();
- }
+ qemu_aio_ref(acb);
+ bdrv_aio_cancel_async(acb);
+ while (acb->refcnt > 1) {
+ if (acb->aiocb_info->get_aio_context) {
+ aio_poll(acb->aiocb_info->get_aio_context(acb), true);
+ } else if (acb->bs) {
+ aio_poll(bdrv_get_aio_context(acb->bs), true);
+ } else {
+ abort();
}
- qemu_aio_release(acb);
}
+ qemu_aio_release(acb);
}
/* Async version of aio cancel. The caller is not blocked if the acb implements
diff --git a/include/block/aio.h b/include/block/aio.h
index ad361e3..f2d0582 100644
--- a/include/block/aio.h
+++ b/include/block/aio.h
@@ -26,7 +26,6 @@ typedef struct BlockDriverAIOCB BlockDriverAIOCB;
typedef void BlockDriverCompletionFunc(void *opaque, int ret);
typedef struct AIOCBInfo {
- void (*cancel)(BlockDriverAIOCB *acb);
void (*cancel_async)(BlockDriverAIOCB *acb);
AioContext *(*get_aio_context)(BlockDriverAIOCB *acb);
size_t aiocb_size;
--
1.9.3
- [Qemu-devel] [PULL v2 12/59] iscsi: Convert iscsi_aiocb_info.cancel to .cancel_async, (continued)
- [Qemu-devel] [PULL v2 12/59] iscsi: Convert iscsi_aiocb_info.cancel to .cancel_async, Stefan Hajnoczi, 2014/09/22
- [Qemu-devel] [PULL v2 16/59] curl: Drop curl_aiocb_info.cancel, Stefan Hajnoczi, 2014/09/22
- [Qemu-devel] [PULL v2 15/59] blkverify: Drop blkverify_aiocb_info.cancel, Stefan Hajnoczi, 2014/09/22
- [Qemu-devel] [PULL v2 17/59] qed: Drop qed_aiocb_info.cancel, Stefan Hajnoczi, 2014/09/22
- [Qemu-devel] [PULL v2 19/59] quorum: Convert quorum_aiocb_info.cancel to .cancel_async, Stefan Hajnoczi, 2014/09/22
- [Qemu-devel] [PULL v2 21/59] sheepdog: Convert sd_aiocb_info.cancel to .cancel_async, Stefan Hajnoczi, 2014/09/22
- [Qemu-devel] [PULL v2 20/59] rbd: Drop rbd_aiocb_info.cancel, Stefan Hajnoczi, 2014/09/22
- [Qemu-devel] [PULL v2 22/59] win32-aio: Drop win32_aiocb_info.cancel, Stefan Hajnoczi, 2014/09/22
- [Qemu-devel] [PULL v2 23/59] ide: Convert trim_aiocb_info.cancel to .cancel_async, Stefan Hajnoczi, 2014/09/22
- [Qemu-devel] [PULL v2 18/59] quorum: fix quorum_aio_cancel(), Stefan Hajnoczi, 2014/09/22
- [Qemu-devel] [PULL v2 24/59] block: Drop AIOCBInfo.cancel,
Stefan Hajnoczi <=
- [Qemu-devel] [PULL v2 25/59] block: Rename qemu_aio_release -> qemu_aio_unref, Stefan Hajnoczi, 2014/09/22
- [Qemu-devel] [PULL v2 27/59] aio-win32: avoid out-of-bounds access to the events array, Stefan Hajnoczi, 2014/09/22
- [Qemu-devel] [PULL v2 28/59] block: Introduce "null" drivers, Stefan Hajnoczi, 2014/09/22
- [Qemu-devel] [PULL v2 29/59] qapi: Sort BlockdevDriver enum data list, Stefan Hajnoczi, 2014/09/22
- [Qemu-devel] [PULL v2 26/59] qdev-monitor: fix segmentation fault on qdev_device_help(), Stefan Hajnoczi, 2014/09/22
- [Qemu-devel] [PULL v2 30/59] qapi: Sort items in BlockdevOptions definition, Stefan Hajnoczi, 2014/09/22
- [Qemu-devel] [PULL v2 31/59] qapi/block: Add "fatal" to BLOCK_IMAGE_CORRUPTED, Stefan Hajnoczi, 2014/09/22
- [Qemu-devel] [PULL v2 35/59] iotests: Add more tests for qcow2 corruption, Stefan Hajnoczi, 2014/09/22
- [Qemu-devel] [PULL v2 36/59] image-fuzzer: Trivial readability and formatting improvements, Stefan Hajnoczi, 2014/09/22
- [Qemu-devel] [PULL v2 38/59] qcow2: Fix leak of QemuOpts in qcow2_open(), Stefan Hajnoczi, 2014/09/22