From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55328) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XP8hd-0007VR-6q for qemu-devel@nongnu.org; Wed, 03 Sep 2014 07:26:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XP8hX-0007DM-1x for qemu-devel@nongnu.org; Wed, 03 Sep 2014 07:26:17 -0400 Received: from mx1.redhat.com ([209.132.183.28]:41185) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XP8hW-0007DH-QO for qemu-devel@nongnu.org; Wed, 03 Sep 2014 07:26:10 -0400 From: Fam Zheng Date: Wed, 3 Sep 2014 19:23:49 +0800 Message-Id: <1409743435-21155-15-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 14/20] qed: Drop qed_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 ->finished field. Signed-off-by: Fam Zheng --- block/qed.c | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/block/qed.c b/block/qed.c index ba395af..07cdb47 100644 --- a/block/qed.c +++ b/block/qed.c @@ -18,22 +18,8 @@ #include "qapi/qmp/qerror.h" #include "migration/migration.h" -static void qed_aio_cancel(BlockDriverAIOCB *blockacb) -{ - QEDAIOCB *acb = (QEDAIOCB *)blockacb; - AioContext *aio_context = bdrv_get_aio_context(blockacb->bs); - bool finished = false; - - /* Wait for the request to finish */ - acb->finished = &finished; - while (!finished) { - aio_poll(aio_context, true); - } -} - static const AIOCBInfo qed_aiocb_info = { .aiocb_size = sizeof(QEDAIOCB), - .cancel = qed_aio_cancel, }; static int bdrv_qed_probe(const uint8_t *buf, int buf_size, @@ -918,18 +904,12 @@ static void qed_aio_complete_bh(void *opaque) BlockDriverCompletionFunc *cb = acb->common.cb; void *user_opaque = acb->common.opaque; int ret = acb->bh_ret; - bool *finished = acb->finished; qemu_bh_delete(acb->bh); qemu_aio_release(acb); /* Invoke callback */ cb(user_opaque, ret); - - /* Signal cancel completion */ - if (finished) { - *finished = true; - } } static void qed_aio_complete(QEDAIOCB *acb, int ret) @@ -1396,7 +1376,6 @@ static BlockDriverAIOCB *qed_aio_setup(BlockDriverState *bs, opaque, flags); acb->flags = flags; - acb->finished = NULL; acb->qiov = qiov; acb->qiov_offset = 0; acb->cur_pos = (uint64_t)sector_num * BDRV_SECTOR_SIZE; -- 2.1.0.27.g96db324