summaryrefslogtreecommitdiff
path: root/fs/f2fs
diff options
context:
space:
mode:
authorFengnan Chang <changfengnan@vivo.com>2021-06-22 14:50:59 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-04-08 15:40:04 +0300
commit1c4d94e4f0b14a5a5cdf558e22af490aacb6a766 (patch)
tree630d8fa33240faf02cae02e8e4b73d269f6104c7 /fs/f2fs
parent2c4741d1b0d236ce2f24d4677f8e23d6bd38ab61 (diff)
downloadlinux-1c4d94e4f0b14a5a5cdf558e22af490aacb6a766.tar.xz
f2fs: compress: remove unneeded read when rewrite whole cluster
[ Upstream commit 7eab7a6968278c735b1ca6387056a408f7960265 ] when we overwrite the whole page in cluster, we don't need read original data before write, because after write_end(), writepages() can help to load left data in that cluster. Signed-off-by: Fengnan Chang <changfengnan@vivo.com> Signed-off-by: Chao Yu <yuchao0@huawei.com> Acked-by: Chao Yu <yuchao0@huawei.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'fs/f2fs')
-rw-r--r--fs/f2fs/data.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c
index d27a92a54447..04e980c58319 100644
--- a/fs/f2fs/data.c
+++ b/fs/f2fs/data.c
@@ -3461,6 +3461,9 @@ static int f2fs_write_begin(struct file *file, struct address_space *mapping,
*fsdata = NULL;
+ if (len == PAGE_SIZE)
+ goto repeat;
+
ret = f2fs_prepare_compress_overwrite(inode, pagep,
index, fsdata);
if (ret < 0) {