summaryrefslogtreecommitdiff
path: root/fs/f2fs/data.c
diff options
context:
space:
mode:
authorFengnan Chang <changfengnan@vivo.com>2021-11-10 05:37:13 +0300
committerJaegeuk Kim <jaegeuk@kernel.org>2021-11-17 22:28:22 +0300
commit3271d7eb00f1df82d9ea26b359ed065129639f7c (patch)
tree0ff3456467454953c60b58bbc530aabd135cf8db /fs/f2fs/data.c
parent8ab774587903771821b59471cc723bba6d893942 (diff)
downloadlinux-3271d7eb00f1df82d9ea26b359ed065129639f7c.tar.xz
f2fs: compress: reduce one page array alloc and free when write compressed page
Don't alloc new page pointers array to replace old, just use old, introduce valid_nr_cpages to indicate valid number of page pointers in array, try to reduce one page array alloc and free when write compress page. Signed-off-by: Fengnan Chang <changfengnan@vivo.com> Reviewed-by: Chao Yu <chao@kernel.org> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/data.c')
-rw-r--r--fs/f2fs/data.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c
index 9f754aaef558..d8190e836a96 100644
--- a/fs/f2fs/data.c
+++ b/fs/f2fs/data.c
@@ -2987,6 +2987,7 @@ static int f2fs_write_cache_pages(struct address_space *mapping,
.rpages = NULL,
.nr_rpages = 0,
.cpages = NULL,
+ .valid_nr_cpages = 0,
.rbuf = NULL,
.cbuf = NULL,
.rlen = PAGE_SIZE * F2FS_I(inode)->i_cluster_size,