summaryrefslogtreecommitdiff
path: root/fs/f2fs/data.c
diff options
context:
space:
mode:
authorFengnan Chang <changfengnan@vivo.com>2022-07-31 11:33:45 +0800
committerJaegeuk Kim <jaegeuk@kernel.org>2022-08-05 04:20:28 -0700
commit4f8219f8aa175d5a46703631abaae745592efe29 (patch)
tree29c53f8ea64c88a174c2f438138fbe6e92686c8b /fs/f2fs/data.c
parente53f8643474a32ddfcfd04e5b22613fdd2a92a52 (diff)
f2fs: intorduce f2fs_all_cluster_page_ready
When write total cluster, all pages is uptodate, there is not need to call f2fs_prepare_compress_overwrite, intorduce f2fs_all_cluster_page_ready to avoid this. 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.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c
index f48eec8f93e2..34a7a9affea0 100644
--- a/fs/f2fs/data.c
+++ b/fs/f2fs/data.c
@@ -3011,6 +3011,10 @@ readd:
if (!f2fs_cluster_is_empty(&cc))
goto lock_page;
+ if (f2fs_all_cluster_page_ready(&cc,
+ &pvec, i, nr_pages, true))
+ goto lock_page;
+
ret2 = f2fs_prepare_compress_overwrite(
inode, &pagep,
page->index, &fsdata);
@@ -3021,8 +3025,8 @@ readd:
} else if (ret2 &&
(!f2fs_compress_write_end(inode,
fsdata, page->index, 1) ||
- !f2fs_all_cluster_page_loaded(&cc,
- &pvec, i, nr_pages))) {
+ !f2fs_all_cluster_page_ready(&cc,
+ &pvec, i, nr_pages, false))) {
retry = 1;
break;
}