block: Drop AIOCBInfo.cancel

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 <famz@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
This commit is contained in:
Fam Zheng 2014-09-11 13:41:27 +08:00 committed by Stefan Hajnoczi
parent e551c999bc
commit ca5fd113b8
2 changed files with 10 additions and 15 deletions

View File

@ -4640,9 +4640,6 @@ 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) {
@ -4656,7 +4653,6 @@ void bdrv_aio_cancel(BlockDriverAIOCB *acb)
}
qemu_aio_release(acb);
}
}
/* Async version of aio cancel. The caller is not blocked if the acb implements
* cancel_async, otherwise we do nothing and let the request normally complete.

View File

@ -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;