linux-f2fs-devel.lists.sourceforge.net archive mirror
 help / color / mirror / Atom feed
* [f2fs-dev] [PATCH v2] f2fs: compress: remove unneeded read when rewrite whole cluster
@ 2021-06-22 11:50 Fengnan Chang
  2021-06-25  3:56 ` Fengnan Chang
  2021-07-13  2:35 ` Fengnan Chang
  0 siblings, 2 replies; 7+ messages in thread
From: Fengnan Chang @ 2021-06-22 11:50 UTC (permalink / raw)
  To: jaegeuk, chao, linux-f2fs-devel; +Cc: Fengnan Chang

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>
---
 fs/f2fs/data.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c
index 3a01a1b50104..2aeb1196cd5f 100644
--- a/fs/f2fs/data.c
+++ b/fs/f2fs/data.c
@@ -3328,6 +3328,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) {
--
2.29.0



_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2021-07-19 10:14 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-06-22 11:50 [f2fs-dev] [PATCH v2] f2fs: compress: remove unneeded read when rewrite whole cluster Fengnan Chang
2021-06-25  3:56 ` Fengnan Chang
2021-07-13  2:35 ` Fengnan Chang
2021-07-13  9:45   ` Chao Yu
2021-07-13 23:44     ` Jaegeuk Kim
2021-07-14  1:18       ` Chao Yu
2021-07-19 10:14         ` Chao Yu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).