[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 4/6] vmdk: Don't update L2 table for zero write on zero cluster
From: |
Kevin Wolf |
Subject: |
[PATCH 4/6] vmdk: Don't update L2 table for zero write on zero cluster |
Date: |
Thu, 30 Apr 2020 15:30:05 +0200 |
If a cluster is already zeroed, we don't have to call vmdk_L2update(),
which is rather slow because it flushes the image file.
Signed-off-by: Kevin Wolf <address@hidden>
---
block/vmdk.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/block/vmdk.c b/block/vmdk.c
index da25b8992e..dcd30f1419 100644
--- a/block/vmdk.c
+++ b/block/vmdk.c
@@ -2013,7 +2013,7 @@ static int vmdk_pwritev(BlockDriverState *bs, uint64_t
offset,
offset_in_cluster == 0 &&
n_bytes >= extent->cluster_sectors * BDRV_SECTOR_SIZE) {
n_bytes = extent->cluster_sectors * BDRV_SECTOR_SIZE;
- if (!zero_dry_run) {
+ if (!zero_dry_run && ret != VMDK_ZEROED) {
/* update L2 tables */
if (vmdk_L2update(extent, &m_data, VMDK_GTE_ZEROED)
!= VMDK_OK) {
--
2.25.3
- [PATCH 0/6] vmdk: Fix zero cluster handling, Kevin Wolf, 2020/04/30
- [PATCH 1/6] vmdk: Rename VmdkMetaData.valid to new_allocation, Kevin Wolf, 2020/04/30
- [PATCH 2/6] vmdk: Fix zero cluster allocation, Kevin Wolf, 2020/04/30
- [PATCH 3/6] vmdk: Fix partial overwrite of zero cluster, Kevin Wolf, 2020/04/30
- [PATCH 4/6] vmdk: Don't update L2 table for zero write on zero cluster,
Kevin Wolf <=
- [PATCH 5/6] vmdk: Flush only once in vmdk_L2update(), Kevin Wolf, 2020/04/30
- [PATCH 6/6] iotests: vmdk: Enable zeroed_grained=on by default, Kevin Wolf, 2020/04/30