From patchwork Wed Sep 10 06:00:09 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fam Zheng X-Patchwork-Id: 387575 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 1F18B140170 for ; Wed, 10 Sep 2014 16:13:01 +1000 (EST) Received: from localhost ([::1]:53652 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XRb9H-0008S7-0t for incoming@patchwork.ozlabs.org; Wed, 10 Sep 2014 02:12:59 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35532) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XRayh-0006sB-Q2 for qemu-devel@nongnu.org; Wed, 10 Sep 2014 02:02:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XRayb-0003Vc-M7 for qemu-devel@nongnu.org; Wed, 10 Sep 2014 02:02:03 -0400 Received: from mx1.redhat.com ([209.132.183.28]:17113) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XRayb-0003VW-Dw for qemu-devel@nongnu.org; Wed, 10 Sep 2014 02:01:57 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s8A61okh032585 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 10 Sep 2014 02:01:50 -0400 Received: from fam-t430.nay.redhat.com (dhcp-14-161.nay.redhat.com [10.66.14.161]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s8A60Jtt020954; Wed, 10 Sep 2014 02:01:46 -0400 From: Fam Zheng To: qemu-devel@nongnu.org Date: Wed, 10 Sep 2014 14:00:09 +0800 Message-Id: <1410328814-12560-18-git-send-email-famz@redhat.com> In-Reply-To: <1410328814-12560-1-git-send-email-famz@redhat.com> References: <1410328814-12560-1-git-send-email-famz@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: Kevin Wolf , Benoit Canet , Peter Lieven , Stefan Hajnoczi , Liu Yuan , Paolo Bonzini Subject: [Qemu-devel] [PATCH v5 17/22] rbd: Drop rbd_aiocb_info.cancel X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org And also drop the now unused "cancelled" field. Signed-off-by: Fam Zheng --- block/rbd.c | 23 +---------------------- 1 file changed, 1 insertion(+), 22 deletions(-) diff --git a/block/rbd.c b/block/rbd.c index ea969e7..349d465 100644 --- a/block/rbd.c +++ b/block/rbd.c @@ -77,7 +77,6 @@ typedef struct RBDAIOCB { int64_t sector_num; int error; struct BDRVRBDState *s; - int cancelled; int status; } RBDAIOCB; @@ -407,9 +406,7 @@ static void qemu_rbd_complete_aio(RADOSCB *rcb) acb->common.cb(acb->common.opaque, (acb->ret > 0 ? 0 : acb->ret)); acb->status = 0; - if (!acb->cancelled) { - qemu_aio_release(acb); - } + qemu_aio_release(acb); } /* TODO Convert to fine grained options */ @@ -538,25 +535,8 @@ static void qemu_rbd_close(BlockDriverState *bs) rados_shutdown(s->cluster); } -/* - * Cancel aio. Since we don't reference acb in a non qemu threads, - * it is safe to access it here. - */ -static void qemu_rbd_aio_cancel(BlockDriverAIOCB *blockacb) -{ - RBDAIOCB *acb = (RBDAIOCB *) blockacb; - acb->cancelled = 1; - - while (acb->status == -EINPROGRESS) { - aio_poll(bdrv_get_aio_context(acb->common.bs), true); - } - - qemu_aio_release(acb); -} - static const AIOCBInfo rbd_aiocb_info = { .aiocb_size = sizeof(RBDAIOCB), - .cancel = qemu_rbd_aio_cancel, }; static void rbd_finish_bh(void *opaque) @@ -639,7 +619,6 @@ static BlockDriverAIOCB *rbd_start_aio(BlockDriverState *bs, acb->ret = 0; acb->error = 0; acb->s = s; - acb->cancelled = 0; acb->bh = NULL; acb->status = -EINPROGRESS;