summaryrefslogtreecommitdiff
path: root/fs/f2fs
diff options
context:
space:
mode:
authorZhang Qilong <zhangqilong3@huawei.com>2022-09-06 17:53:47 +0300
committerJaegeuk Kim <jaegeuk@kernel.org>2023-01-11 22:15:18 +0300
commitebaaec351e4fef86afe38002b6a8c15178fd3610 (patch)
tree1d162e3b8c12dcaefb21e7eaac06d655c0faf898 /fs/f2fs
parent275dd5dc67f2a4d7a81c22869ff594701519dc9b (diff)
downloadlinux-ebaaec351e4fef86afe38002b6a8c15178fd3610.tar.xz
f2fs: start freeing cluster pages from the unused number
We can start freeing cluster page(s) from which compression is not used. It will get better performance. Signed-off-by: Zhang Qilong <zhangqilong3@huawei.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs')
-rw-r--r--fs/f2fs/compress.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/fs/f2fs/compress.c b/fs/f2fs/compress.c
index e4db3b7932a3..dd1caba46eed 100644
--- a/fs/f2fs/compress.c
+++ b/fs/f2fs/compress.c
@@ -690,9 +690,7 @@ static int f2fs_compress_pages(struct compress_ctx *cc)
vm_unmap_ram(cc->cbuf, cc->nr_cpages);
vm_unmap_ram(cc->rbuf, cc->cluster_size);
- for (i = 0; i < cc->nr_cpages; i++) {
- if (i < new_nr_cpages)
- continue;
+ for (i = new_nr_cpages; i < cc->nr_cpages; i++) {
f2fs_compress_free_page(cc->cpages[i]);
cc->cpages[i] = NULL;
}