From: Fengnan Chang Date: Tue, 22 Jun 2021 11:50:59 +0000 (+0800) Subject: f2fs: compress: remove unneeded read when rewrite whole cluster X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=7eab7a6968278c735b1ca6387056a408f7960265;p=linux.git f2fs: compress: remove unneeded read when rewrite whole cluster 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 Signed-off-by: Chao Yu Acked-by: Chao Yu Signed-off-by: Jaegeuk Kim --- diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c index 28ad1f533c2a3..d7f9d66577f53 100644 --- a/fs/f2fs/data.c +++ b/fs/f2fs/data.c @@ -3329,6 +3329,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) {