diff options
author | Fengnan Chang <changfengnan@vivo.com> | 2021-06-22 19:50:59 +0800 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk@kernel.org> | 2021-08-02 11:24:25 -0700 |
commit | 7eab7a6968278c735b1ca6387056a408f7960265 (patch) | |
tree | 8e3136fa77f7ab0d9afbb7f07ea775c279115e21 /fs/f2fs | |
parent | 2eeb0dce728a7eac3e4dfe355d98af40d61f7a26 (diff) | |
download | linux-7eab7a6968278c735b1ca6387056a408f7960265.tar.bz2 |
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 <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>
Diffstat (limited to 'fs/f2fs')
-rw-r--r-- | fs/f2fs/data.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c index 28ad1f533c2a..d7f9d66577f5 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) { |