erofs-utils: mkfs: keep one-block uncompressed data for deduplication
PATCH 1/1 erofs-utils: mkfs: keep one-block uncompressed data for deduplication
Otherwise, the deduplication rate will be impacted, but it doesn't mattersince -Ededupe is still single-threaded.
Fixes 341d23a878a2 ("erofs-utils: mkfs: speed up uncompressed data handling")
Signed-off-by Gao Xiang <[email protected]>
--- lib/compress.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)
lib/compress.c +6 -3
@@ -376,6 +376,7 @@ out:return 0 ; } +/* TODO: reset clusterofs to 0 if permitted */ static int write_uncompressed_block (struct z_erofs_compress_sctx *ctx,unsigned int len,char *dst) {
@@ -616,9 +617,11 @@ static int __z_erofs_compress_one(struct z_erofs_compress_sctx *ctx, may_packing = false; e->length =min_t (u32, e->length, ret); nocompression: -/* TODO: reset clusterofs to 0 if permitted */ - ret =write_uncompressed_extents (ctx, len, - e->length, dst); +if (cfg.c_dedupe) + ret =write_uncompressed_block (ctx, len, dst); +else + ret =write_uncompressed_extents (ctx, len, + e->length, dst);if (ret <0 )return ret; }
Signature · 1 line
2.43.5