Skip to content

Commit 1866cba

Browse files
zhangyi089tytso
authored andcommitted
jbd2: remove the out label in __jbd2_journal_remove_checkpoint()
The 'out' lable just return the 'ret' value and seems not required, so remove this label and switch to return appropriate value immediately. This patch also do some minor cleanup, no logical change. Signed-off-by: Zhang Yi <[email protected]> Reviewed-by: Jan Kara <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Theodore Ts'o <[email protected]>
1 parent 0caaefb commit 1866cba

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

fs/jbd2/checkpoint.c

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -564,13 +564,13 @@ int __jbd2_journal_remove_checkpoint(struct journal_head *jh)
564564
struct transaction_chp_stats_s *stats;
565565
transaction_t *transaction;
566566
journal_t *journal;
567-
int ret = 0;
568567

569568
JBUFFER_TRACE(jh, "entry");
570569

571-
if ((transaction = jh->b_cp_transaction) == NULL) {
570+
transaction = jh->b_cp_transaction;
571+
if (!transaction) {
572572
JBUFFER_TRACE(jh, "not on transaction");
573-
goto out;
573+
return 0;
574574
}
575575
journal = transaction->t_journal;
576576

@@ -579,9 +579,9 @@ int __jbd2_journal_remove_checkpoint(struct journal_head *jh)
579579
jh->b_cp_transaction = NULL;
580580
jbd2_journal_put_journal_head(jh);
581581

582-
if (transaction->t_checkpoint_list != NULL ||
583-
transaction->t_checkpoint_io_list != NULL)
584-
goto out;
582+
/* Is this transaction empty? */
583+
if (transaction->t_checkpoint_list || transaction->t_checkpoint_io_list)
584+
return 0;
585585

586586
/*
587587
* There is one special case to worry about: if we have just pulled the
@@ -593,10 +593,12 @@ int __jbd2_journal_remove_checkpoint(struct journal_head *jh)
593593
* See the comment at the end of jbd2_journal_commit_transaction().
594594
*/
595595
if (transaction->t_state != T_FINISHED)
596-
goto out;
596+
return 0;
597597

598-
/* OK, that was the last buffer for the transaction: we can now
599-
safely remove this transaction from the log */
598+
/*
599+
* OK, that was the last buffer for the transaction, we can now
600+
* safely remove this transaction from the log.
601+
*/
600602
stats = &transaction->t_chp_stats;
601603
if (stats->cs_chp_time)
602604
stats->cs_chp_time = jbd2_time_diff(stats->cs_chp_time,
@@ -606,9 +608,7 @@ int __jbd2_journal_remove_checkpoint(struct journal_head *jh)
606608

607609
__jbd2_journal_drop_transaction(journal, transaction);
608610
jbd2_journal_free_transaction(transaction);
609-
ret = 1;
610-
out:
611-
return ret;
611+
return 1;
612612
}
613613

614614
/*

0 commit comments

Comments
 (0)