[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v7 26/32] qcow2: Clear the L2 bitmap when allocating a compressed
From: |
Alberto Garcia |
Subject: |
[PATCH v7 26/32] qcow2: Clear the L2 bitmap when allocating a compressed cluster |
Date: |
Mon, 25 May 2020 20:08:51 +0200 |
Compressed clusters always have the bitmap part of the extended L2
entry set to 0.
Signed-off-by: Alberto Garcia <address@hidden>
Reviewed-by: Max Reitz <address@hidden>
---
block/qcow2-cluster.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/block/qcow2-cluster.c b/block/qcow2-cluster.c
index 2276cee6d6..deff838fe8 100644
--- a/block/qcow2-cluster.c
+++ b/block/qcow2-cluster.c
@@ -861,6 +861,9 @@ int qcow2_alloc_compressed_cluster_offset(BlockDriverState
*bs,
BLKDBG_EVENT(bs->file, BLKDBG_L2_UPDATE_COMPRESSED);
qcow2_cache_entry_mark_dirty(s->l2_table_cache, l2_slice);
set_l2_entry(s, l2_slice, l2_index, cluster_offset);
+ if (has_subclusters(s)) {
+ set_l2_bitmap(s, l2_slice, l2_index, 0);
+ }
qcow2_cache_put(s->l2_table_cache, (void **) &l2_slice);
*host_offset = cluster_offset & s->cluster_offset_mask;
--
2.20.1
- [PATCH v7 11/32] qcow2: Add offset_into_subcluster() and size_to_subclusters(), (continued)
- [PATCH v7 11/32] qcow2: Add offset_into_subcluster() and size_to_subclusters(), Alberto Garcia, 2020/05/25
- [PATCH v7 10/32] qcow2: Add offset_to_sc_index(), Alberto Garcia, 2020/05/25
- [PATCH v7 29/32] qcow2: Add subcluster support to qcow2_measure(), Alberto Garcia, 2020/05/25
- [PATCH v7 04/32] qcow2: Split cluster_needs_cow() out of count_cow_clusters(), Alberto Garcia, 2020/05/25
- [PATCH v7 31/32] qcow2: Assert that expand_zero_clusters_in_l1() does not support subclusters, Alberto Garcia, 2020/05/25
- [PATCH v7 25/32] qcow2: Update L2 bitmap in qcow2_alloc_cluster_link_l2(), Alberto Garcia, 2020/05/25
- [PATCH v7 18/32] qcow2: Replace QCOW2_CLUSTER_* with QCOW2_SUBCLUSTER_*, Alberto Garcia, 2020/05/25
- [PATCH v7 19/32] qcow2: Handle QCOW2_SUBCLUSTER_UNALLOCATED_ALLOC, Alberto Garcia, 2020/05/25
- [PATCH v7 03/32] qcow2: Add calculate_l2_meta(), Alberto Garcia, 2020/05/25
- [PATCH v7 26/32] qcow2: Clear the L2 bitmap when allocating a compressed cluster,
Alberto Garcia <=
- [PATCH v7 21/32] qcow2: Add subcluster support to qcow2_get_host_offset(), Alberto Garcia, 2020/05/25
- [PATCH v7 32/32] iotests: Add tests for qcow2 images with extended L2 entries, Alberto Garcia, 2020/05/25
- [PATCH v7 17/32] qcow2: Add cluster type parameter to qcow2_get_host_offset(), Alberto Garcia, 2020/05/25
- [PATCH v7 02/32] qcow2: Convert qcow2_get_cluster_offset() into qcow2_get_host_offset(), Alberto Garcia, 2020/05/25
- [PATCH v7 05/32] qcow2: Process QCOW2_CLUSTER_ZERO_ALLOC clusters in handle_copied(), Alberto Garcia, 2020/05/25
- [PATCH v7 12/32] qcow2: Add l2_entry_size(), Alberto Garcia, 2020/05/25