diff mbox series

[f2fs-dev] f2fs: remove else in f2fs_write_cache_pages()

Message ID 20230320173137.64413-1-frank.li@vivo.com (mailing list archive)
State Accepted
Commit d2afb3f006dcfb87d534b96aa584697e29880d1b
Headers show
Series [f2fs-dev] f2fs: remove else in f2fs_write_cache_pages() | expand

Commit Message

李扬韬 March 20, 2023, 5:31 p.m. UTC
As Christoph Hellwig point out:

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

Signed-off-by: Yangtao Li <frank.li@vivo.com>
---
 fs/f2fs/data.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

Comments

Chao Yu March 26, 2023, 1:49 p.m. UTC | #1
On 2023/3/21 1:31, Yangtao Li wrote:
> As Christoph Hellwig point out:
> 
> 	Please avoid the else by doing the goto in the branch.
> 
> Signed-off-by: Yangtao Li <frank.li@vivo.com>

Reviewed-by: Chao Yu <chao@kernel.org>

Thanks,
patchwork-bot+f2fs@kernel.org March 27, 2023, 4 p.m. UTC | #2
Hello:

This patch was applied to jaegeuk/f2fs.git (dev)
by Jaegeuk Kim <jaegeuk@kernel.org>:

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.
> 
> Signed-off-by: Yangtao Li <frank.li@vivo.com>
> ---
>  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!
diff mbox series

Patch

diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c
index bf51e6e4eb64..fa931fb768e7 100644
--- a/fs/f2fs/data.c
+++ b/fs/f2fs/data.c
@@ -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))