提交 c3f331b4 编写于 作者: F Fengnan Chang 提交者: Zheng Zengkai

f2fs: compress: remove unneeded read when rewrite whole cluster

stable inclusion
from stable-v5.10.110
commit 1c4d94e4f0b14a5a5cdf558e22af490aacb6a766
bugzilla: https://gitee.com/openeuler/kernel/issues/I574AL

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=1c4d94e4f0b14a5a5cdf558e22af490aacb6a766

--------------------------------

[ Upstream commit 7eab7a69 ]

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: NFengnan Chang <changfengnan@vivo.com>
Signed-off-by: NChao Yu <yuchao0@huawei.com>
Acked-by: NChao Yu <yuchao0@huawei.com>
Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
Signed-off-by: NSasha Levin <sashal@kernel.org>
Signed-off-by: NYu Liao <liaoyu15@huawei.com>
Reviewed-by: NWei Li <liwei391@huawei.com>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
上级 ed7edde7
......@@ -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) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册