From patchwork Mon Jun 10 12:26:07 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Hajnoczi X-Patchwork-Id: 250240 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)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 7DF332C0098 for ; Mon, 10 Jun 2013 22:37:47 +1000 (EST) Received: from localhost ([::1]:39489 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Um1El-0003qE-Nr for incoming@patchwork.ozlabs.org; Mon, 10 Jun 2013 08:30:15 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53281) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Um1BS-0006kt-5t for qemu-devel@nongnu.org; Mon, 10 Jun 2013 08:26:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Um1BM-00035B-5B for qemu-devel@nongnu.org; Mon, 10 Jun 2013 08:26:49 -0400 Received: from mx1.redhat.com ([209.132.183.28]:29036) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Um1BL-000352-D2 for qemu-devel@nongnu.org; Mon, 10 Jun 2013 08:26:44 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r5ACQfSG028226 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 10 Jun 2013 08:26:41 -0400 Received: from localhost (ovpn-112-37.ams2.redhat.com [10.36.112.37]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r5ACQeBD020399; Mon, 10 Jun 2013 08:26:41 -0400 From: Stefan Hajnoczi To: Date: Mon, 10 Jun 2013 14:26:07 +0200 Message-Id: <1370867173-25755-12-git-send-email-stefanha@redhat.com> In-Reply-To: <1370867173-25755-1-git-send-email-stefanha@redhat.com> References: <1370867173-25755-1-git-send-email-stefanha@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: Kevin Wolf , Paolo Bonzini , Anthony Liguori , Ping Fan Liu , Stefan Hajnoczi Subject: [Qemu-devel] [PATCH v3 11/17] block/rbd: drop qemu_rbd_aio_flush_cb() 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 .io_flush() is no longer called so drop qemu_rbd_aio_flush_cb(). qemu_aio_count is unused now so drop it too. Signed-off-by: Stefan Hajnoczi --- block/rbd.c | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/block/rbd.c b/block/rbd.c index 0f2608b..40e5d55 100644 --- a/block/rbd.c +++ b/block/rbd.c @@ -100,7 +100,6 @@ typedef struct BDRVRBDState { rados_ioctx_t io_ctx; rbd_image_t image; char name[RBD_MAX_IMAGE_NAME_SIZE]; - int qemu_aio_count; char *snap; int event_reader_pos; RADOSCB *event_rcb; @@ -428,19 +427,11 @@ static void qemu_rbd_aio_event_reader(void *opaque) if (s->event_reader_pos == sizeof(s->event_rcb)) { s->event_reader_pos = 0; qemu_rbd_complete_aio(s->event_rcb); - s->qemu_aio_count--; } } } while (ret < 0 && errno == EINTR); } -static int qemu_rbd_aio_flush_cb(void *opaque) -{ - BDRVRBDState *s = opaque; - - return (s->qemu_aio_count > 0); -} - /* TODO Convert to fine grained options */ static QemuOptsList runtime_opts = { .name = "rbd", @@ -554,7 +545,7 @@ static int qemu_rbd_open(BlockDriverState *bs, QDict *options, int flags) fcntl(s->fds[0], F_SETFL, O_NONBLOCK); fcntl(s->fds[1], F_SETFL, O_NONBLOCK); qemu_aio_set_fd_handler(s->fds[RBD_FD_READ], qemu_rbd_aio_event_reader, - NULL, qemu_rbd_aio_flush_cb, s); + NULL, NULL, s); qemu_opts_del(opts); @@ -741,8 +732,6 @@ static BlockDriverAIOCB *rbd_start_aio(BlockDriverState *bs, off = sector_num * BDRV_SECTOR_SIZE; size = nb_sectors * BDRV_SECTOR_SIZE; - s->qemu_aio_count++; /* All the RADOSCB */ - rcb = g_malloc(sizeof(RADOSCB)); rcb->done = 0; rcb->acb = acb; @@ -779,7 +768,6 @@ static BlockDriverAIOCB *rbd_start_aio(BlockDriverState *bs, failed: g_free(rcb); - s->qemu_aio_count--; qemu_aio_release(acb); return NULL; }