From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54899) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XP8gO-0005Tl-A6 for qemu-devel@nongnu.org; Wed, 03 Sep 2014 07:25:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XP8gI-0006h1-6F for qemu-devel@nongnu.org; Wed, 03 Sep 2014 07:25:00 -0400 Received: from mx1.redhat.com ([209.132.183.28]:38753) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XP8gH-0006go-Tk for qemu-devel@nongnu.org; Wed, 03 Sep 2014 07:24:54 -0400 From: Fam Zheng Date: Wed, 3 Sep 2014 19:23:38 +0800 Message-Id: <1409743435-21155-4-git-send-email-famz@redhat.com> In-Reply-To: <1409743435-21155-1-git-send-email-famz@redhat.com> References: <1409743435-21155-1-git-send-email-famz@redhat.com> Subject: [Qemu-devel] [PATCH v4 03/20] block: Drop bdrv_em_co_aiocb_info.cancel List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Kevin Wolf , Chrysostomos Nanakos , Stefan Hajnoczi , Liu Yuan , Peter Lieven , Ronnie Sahlberg , Josh Durgin , Paolo Bonzini , MORITA Kazutaka , Benoit Canet Also drop the now unused ->done pointer. Signed-off-by: Fam Zheng --- block.c | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/block.c b/block.c index 2dfd1be..4aa1bd7 100644 --- a/block.c +++ b/block.c @@ -4757,22 +4757,8 @@ typedef struct BlockDriverAIOCBCoroutine { QEMUBH* bh; } BlockDriverAIOCBCoroutine; -static void bdrv_aio_co_cancel_em(BlockDriverAIOCB *blockacb) -{ - AioContext *aio_context = bdrv_get_aio_context(blockacb->bs); - BlockDriverAIOCBCoroutine *acb = - container_of(blockacb, BlockDriverAIOCBCoroutine, common); - bool done = false; - - acb->done = &done; - while (!done) { - aio_poll(aio_context, true); - } -} - static const AIOCBInfo bdrv_em_co_aiocb_info = { .aiocb_size = sizeof(BlockDriverAIOCBCoroutine), - .cancel = bdrv_aio_co_cancel_em, }; static void bdrv_co_em_bh(void *opaque) @@ -4781,10 +4767,6 @@ static void bdrv_co_em_bh(void *opaque) acb->common.cb(acb->common.opaque, acb->req.error); - if (acb->done) { - *acb->done = true; - } - qemu_bh_delete(acb->bh); qemu_aio_release(acb); } @@ -4825,7 +4807,6 @@ static BlockDriverAIOCB *bdrv_co_aio_rw_vector(BlockDriverState *bs, acb->req.qiov = qiov; acb->req.flags = flags; acb->is_write = is_write; - acb->done = NULL; co = qemu_coroutine_create(bdrv_co_do_rw); qemu_coroutine_enter(co, acb); @@ -4852,7 +4833,6 @@ BlockDriverAIOCB *bdrv_aio_flush(BlockDriverState *bs, BlockDriverAIOCBCoroutine *acb; acb = qemu_aio_get(&bdrv_em_co_aiocb_info, bs, cb, opaque); - acb->done = NULL; co = qemu_coroutine_create(bdrv_aio_flush_co_entry); qemu_coroutine_enter(co, acb); @@ -4882,7 +4862,6 @@ BlockDriverAIOCB *bdrv_aio_discard(BlockDriverState *bs, acb = qemu_aio_get(&bdrv_em_co_aiocb_info, bs, cb, opaque); acb->req.sector = sector_num; acb->req.nb_sectors = nb_sectors; - acb->done = NULL; co = qemu_coroutine_create(bdrv_aio_discard_co_entry); qemu_coroutine_enter(co, acb); -- 2.1.0.27.g96db324