[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [RFC V8 12/24] qcow2: Do allocate on rewrite on the dedup c
From: |
Benoît Canet |
Subject: |
[Qemu-devel] [RFC V8 12/24] qcow2: Do allocate on rewrite on the dedup case. |
Date: |
Thu, 20 Jun 2013 16:26:20 +0200 |
This patch does allocate on rewrite when deduplication is on.
This get rid of the need of removing the old hash of the lookup structure
when a cluster get rewritten.
The old data is left in place and will be collected/deleted when it's cluster
will reach 0.
Signed-off-by: Benoit Canet <address@hidden>
---
block/qcow2-cluster.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/block/qcow2-cluster.c b/block/qcow2-cluster.c
index d6db0b9..41c4bc2 100644
--- a/block/qcow2-cluster.c
+++ b/block/qcow2-cluster.c
@@ -878,7 +878,8 @@ static int handle_copied(BlockDriverState *bs, uint64_t
guest_offset,
cluster_offset = be64_to_cpu(l2_table[l2_index]);
/* Check how many clusters are already allocated and don't need COW */
- if (qcow2_get_cluster_type(cluster_offset) == QCOW2_CLUSTER_NORMAL
+ if (!s->has_dedup &&
+ qcow2_get_cluster_type(cluster_offset) == QCOW2_CLUSTER_NORMAL
&& (cluster_offset & QCOW_OFLAG_COPIED))
{
/* If a specific host_offset is required, check it */
@@ -1028,7 +1029,7 @@ static int handle_alloc(BlockDriverState *bs, uint64_t
guest_offset,
/* For the moment, overwrite compressed clusters one by one */
if (entry & QCOW_OFLAG_COMPRESSED) {
nb_clusters = 1;
- } else {
+ } else if (!s->has_dedup) {
nb_clusters = count_cow_clusters(s, nb_clusters, l2_table, l2_index);
}
--
1.7.10.4
- [Qemu-devel] [RFC V8 00/24] QCOW2 deduplication core functionality, Benoît Canet, 2013/06/20
- [Qemu-devel] [RFC V8 01/24] qcow2: Add journal specification., Benoît Canet, 2013/06/20
- [Qemu-devel] [RFC V8 02/24] qcow2: Add deduplication structures and fields., Benoît Canet, 2013/06/20
- [Qemu-devel] [RFC V8 03/24] qcow2: Add journal., Benoît Canet, 2013/06/20
- [Qemu-devel] [RFC V8 04/24] qcow2: Create the log store., Benoît Canet, 2013/06/20
- [Qemu-devel] [RFC V8 07/24] qcow2: Add qcow2_de dup_read_missing_and_concatenate, Benoît Canet, 2013/06/20
- [Qemu-devel] [RFC V8 08/24] qcow2: Create a way to link to l2 tables when deduplicating., Benoît Canet, 2013/06/20
- [Qemu-devel] [RFC V8 06/24] qcow2: Add the dedupl ication store., Benoît Canet, 2013/06/20
- [Qemu-devel] [RFC V8 05/24] qcow2: Add the hash s tore., Benoît Canet, 2013/06/20
- [Qemu-devel] [RFC V8 09/24] qcow2: Make qcow2_update_cluster_refcount public., Benoît Canet, 2013/06/20
- [Qemu-devel] [RFC V8 12/24] qcow2: Do allocate on rewrite on the dedup case.,
Benoît Canet <=
- [Qemu-devel] [RFC V8 10/24] qcow2: Add qcow2_dedup and related functions, Benoît Canet, 2013/06/20
- [Qemu-devel] [RFC V8 11/24] qcow2: Add qcow2_dedup_store_new_hashes., Benoît Canet, 2013/06/20
- [Qemu-devel] [RFC V8 14/24] qcow2: Load and save deduplication table header extension., Benoît Canet, 2013/06/20
- [Qemu-devel] [RFC V8 13/24] qcow2: Implement qcow2_compute_cluster_hash., Benoît Canet, 2013/06/20
- [Qemu-devel] [RFC V8 17/24] qcow2: Drop hash for a given cluster when dedup makes refcount > 2^16/2., Benoît Canet, 2013/06/20
- [Qemu-devel] [RFC V8 15/24] qcow2: Extract qcow2_set_incompat_feature and qcow2_clear_incompat_feature., Benoît Canet, 2013/06/20
- [Qemu-devel] [RFC V8 19/24] qcow2: Integrate deduplication in qcow2_co_writev loop., Benoît Canet, 2013/06/20
- [Qemu-devel] [RFC V8 16/24] block: Add qcow2_dedup format and image creation code., Benoît Canet, 2013/06/20
- [Qemu-devel] [RFC V8 22/24] qcow2: Add qcow2_dedup_init and qcow2_dedup_close., Benoît Canet, 2013/06/20
- [Qemu-devel] [RFC V8 21/24] qcow2: Integrate SKEIN hash algorithm in deduplication., Benoît Canet, 2013/06/20