From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:41862) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TvVqW-000542-3u for qemu-devel@nongnu.org; Wed, 16 Jan 2013 11:28:20 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TvVqR-0007UX-Ih for qemu-devel@nongnu.org; Wed, 16 Jan 2013 11:28:11 -0500 Received: from nodalink.pck.nerim.net ([62.212.105.220]:43348 helo=paradis.irqsave.net) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TvVqR-0007U4-Ad for qemu-devel@nongnu.org; Wed, 16 Jan 2013 11:28:07 -0500 From: =?UTF-8?q?Beno=C3=AEt=20Canet?= Date: Wed, 16 Jan 2013 17:24:58 +0100 Message-Id: <1358353508-5369-5-git-send-email-benoit@irqsave.net> In-Reply-To: <1358353508-5369-1-git-send-email-benoit@irqsave.net> References: <1358353508-5369-1-git-send-email-benoit@irqsave.net> Subject: [Qemu-devel] [RFC V1 04/14] qcow2: Collect deduplicated cluster metric. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: kwolf@redhat.com, pbonzini@redhat.com, =?UTF-8?q?Beno=C3=AEt=20Canet?= , stefanha@redhat.com --- block/qcow2-dedup.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/block/qcow2-dedup.c b/block/qcow2-dedup.c index e4920d4..716371c 100644 --- a/block/qcow2-dedup.c +++ b/block/qcow2-dedup.c @@ -400,10 +400,14 @@ static int qcow2_deduplicate_cluster(BlockDriverState *bs, } /* Increment the refcount of the cluster */ - return update_refcount(bs, - (hash_node->physical_sect / - s->cluster_sectors) << s->cluster_bits, - 1, 1, true); + ret = update_refcount(bs, + (hash_node->physical_sect / + s->cluster_sectors) << s->cluster_bits, + 1, 1, true); + + s->dedup_metrics.deduplicated_clusters++; + + return ret; } /* This function tries to deduplicate a given cluster. -- 1.7.10.4