Skip to contentSkip to conversation

f2fs: remove else in f2fs_write_cache_pages()

PATCH Applied Yangtao Li 3 participants 3 messages Mar 20, 2023 – Mar 27, 2023 F2FS file system

lore
Share & tools
lore

Yangtao Li

author
#0 lore raw

PATCH 1/1 f2fs: remove else in f2fs_write_cache_pages()

As Christoph Hellwig point out:

Please avoid the else by doing the goto in the branch.

---
 fs/f2fs/data.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)
fs/f2fs/data.c +2 -5
index bf51e6e4eb64..fa931fb768e7 100644
@@ -3123,12 +3123,9 @@ static int f2fs_write_cache_pages(struct address_space *mapping,
 			}
 
 			if (folio_test_writeback(folio)) {
-				if (wbc->sync_mode != WB_SYNC_NONE)
-					f2fs_wait_on_page_writeback(
-							&folio->page,
-							DATA, true, true);
-				else
+				if (wbc->sync_mode == WB_SYNC_NONE)
 					goto continue_unlock;
+				f2fs_wait_on_page_writeback(&folio->page, DATA, true, true);
 			}
 
 			if (!folio_clear_dirty_for_io(folio))
Signature · 8 lines
2.35.1



_______________________________________________
Linux-f2fs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
#2 lore raw
In reply to Yangtao Li
This patch was applied to jaegeuk/f2fs.git (dev) by Jaegeuk Kim <[email protected]>:

Hello:

This patch was applied to jaegeuk/f2fs.git (dev)
by Jaegeuk Kim <[email protected]>:

Quoted 8 lines · On Tue, 21 Mar 2023 01:31:36 +0800 you wrote:

As Christoph Hellwig point out:

Please avoid the else by doing the goto in the branch.

---
 fs/f2fs/data.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

Here is the summary with links:
- [f2fs-dev] f2fs: remove else in f2fs_write_cache_pages()

    https://git.kernel.org/jaegeuk/f2fs/c/d2afb3f006dc

You are awesome, thank you!

Signature · 10 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html




_______________________________________________
Linux-f2fs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel