qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [RFC V5 40/62] qcow2: Collect deduplicated cluster metric.


From: Benoît Canet
Subject: [Qemu-devel] [RFC V5 40/62] qcow2: Collect deduplicated cluster metric.
Date: Wed, 16 Jan 2013 16:48:19 +0100

---
 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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]