diff options
author | Yue Hu <huyue2@coolpad.com> | 2022-10-13 12:00:11 +0800 |
---|---|---|
committer | Gao Xiang <hsiangkao@linux.alibaba.com> | 2022-10-14 17:47:50 +0800 |
commit | 9410884c64544d0dd189e8840bdb035ffeb46a98 (patch) | |
tree | 306928a153e44029b84f116e9dd290d5c07bc046 | |
parent | b9ebaad0af653e9a85752193c2b5f3f04791068d (diff) | |
download | erofs-utils-9410884c64544d0dd189e8840bdb035ffeb46a98.tar.gz |
erofs-utils: avoid unnecessary insert behavior when not deduplicating
We should do nothing in dedupe inserting when it's not configured.
Signed-off-by: Yue Hu <huyue2@coolpad.com>
Reviewed-by: Gao Xiang <hsiangkao@linux.alibaba.com>
Link: https://lore.kernel.org/r/20221013040011.31944-1-zbestahu@gmail.com
Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>
-rw-r--r-- | lib/dedupe.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/dedupe.c b/lib/dedupe.c index 7962014..9cad905 100644 --- a/lib/dedupe.c +++ b/lib/dedupe.c @@ -99,7 +99,7 @@ int z_erofs_dedupe_insert(struct z_erofs_inmem_extent *e, { struct z_erofs_dedupe_item *di; - if (e->length < window_size) + if (!dedupe_subtree || e->length < window_size) return 0; di = malloc(sizeof(*di) + e->length - window_size); |