[PATCH v2 8/8] jbd2: remove unneeded check of ret in jbd2_fc_get_buf
From: Kemeng Shi
Date: Wed Jul 31 2024 - 02:26:44 EST
Simply return -EINVAL if j_fc_off is invalid to avoid repeated check of
ret.
Signed-off-by: Kemeng Shi <shikemeng@xxxxxxxxxxxxxxx>
Reviewed-by: Jan Kara <jack@xxxxxxx>
---
fs/jbd2/journal.c | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/fs/jbd2/journal.c b/fs/jbd2/journal.c
index e89d777ded34..9d0f6735f8e6 100644
--- a/fs/jbd2/journal.c
+++ b/fs/jbd2/journal.c
@@ -841,12 +841,8 @@ int jbd2_fc_get_buf(journal_t *journal, struct buffer_head **bh_out)
fc_off = journal->j_fc_off;
blocknr = journal->j_fc_first + fc_off;
journal->j_fc_off++;
- } else {
- ret = -EINVAL;
- }
-
- if (ret)
- return ret;
+ } else
+ return -EINVAL;
ret = jbd2_journal_bmap(journal, blocknr, &pblock);
if (ret)
--
2.30.0