Commit ebaaec35 authored by Zhang Qilong's avatar Zhang Qilong Committed by Jaegeuk Kim

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: default avatarZhang Qilong <zhangqilong3@huawei.com>
Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
parent 275dd5dc
...@@ -690,9 +690,7 @@ static int f2fs_compress_pages(struct compress_ctx *cc) ...@@ -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->cbuf, cc->nr_cpages);
vm_unmap_ram(cc->rbuf, cc->cluster_size); vm_unmap_ram(cc->rbuf, cc->cluster_size);
for (i = 0; i < cc->nr_cpages; i++) { for (i = new_nr_cpages; i < cc->nr_cpages; i++) {
if (i < new_nr_cpages)
continue;
f2fs_compress_free_page(cc->cpages[i]); f2fs_compress_free_page(cc->cpages[i]);
cc->cpages[i] = NULL; cc->cpages[i] = NULL;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment