From patchwork Mon Mar 4 14:02:35 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Hajnoczi X-Patchwork-Id: 224726 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 682022C02F9 for ; Tue, 5 Mar 2013 01:03:37 +1100 (EST) Received: from localhost ([::1]:34799 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UCVzL-0004t3-Ij for incoming@patchwork.ozlabs.org; Mon, 04 Mar 2013 09:03:35 -0500 Received: from eggs.gnu.org ([208.118.235.92]:40335) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UCVyf-0004Pk-3J for qemu-devel@nongnu.org; Mon, 04 Mar 2013 09:02:56 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UCVyc-00067R-ES for qemu-devel@nongnu.org; Mon, 04 Mar 2013 09:02:53 -0500 Received: from mx1.redhat.com ([209.132.183.28]:5170) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UCVyc-00067M-7Y for qemu-devel@nongnu.org; Mon, 04 Mar 2013 09:02:50 -0500 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r24E2ndL003696 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 4 Mar 2013 09:02:49 -0500 Received: from localhost (ovpn-112-24.ams2.redhat.com [10.36.112.24]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r24E2mag013442; Mon, 4 Mar 2013 09:02:49 -0500 From: Stefan Hajnoczi To: Date: Mon, 4 Mar 2013 15:02:35 +0100 Message-Id: <1362405755-3308-7-git-send-email-stefanha@redhat.com> In-Reply-To: <1362405755-3308-1-git-send-email-stefanha@redhat.com> References: <1362405755-3308-1-git-send-email-stefanha@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.25 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: Kevin Wolf , Stefan Hajnoczi Subject: [Qemu-devel] [PATCH v2 6/6] qcow2: drop unnecessary flush in qcow2_update_snapshot_refcount() 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 We already flush when the function completes. There is no need to flush after every compressed cluster. Signed-off-by: Stefan Hajnoczi --- block/qcow2-refcount.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/block/qcow2-refcount.c b/block/qcow2-refcount.c index 92519ea..9bfb390 100644 --- a/block/qcow2-refcount.c +++ b/block/qcow2-refcount.c @@ -790,10 +790,6 @@ int qcow2_update_snapshot_refcount(BlockDriverState *bs, if (ret < 0) { goto fail; } - - /* TODO Flushing once for the whole function should - * be enough */ - bdrv_flush(bs->file); } /* compressed clusters are never modified */ refcount = 2;