提交 de06cb55 编写于 作者: Z Zhang Yi 提交者: Zheng Zengkai

jbd2: remove the out label in __jbd2_journal_remove_checkpoint()

mainline inclusion
from mainline-v5.14-rc1
commit 1866cba8
category: bugfix
bugzilla: 50788 https://gitee.com/openeuler/kernel/issues/I4DDEL
Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=1866cba842437f3e7a5a8ee5b558744d9ae844d0

---------------------------

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: NZhang Yi <yi.zhang@huawei.com>
Reviewed-by: NJan Kara <jack@suse.cz>
Link: https://lore.kernel.org/r/20210610112440.3438139-2-yi.zhang@huawei.comSigned-off-by: NTheodore Ts'o <tytso@mit.edu>
Reviewed-by: NYang Erkun <yangerkun@huawei.com>
Signed-off-by: NChen Jun <chenjun102@huawei.com>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
上级 0808a926
......@@ -564,13 +564,13 @@ int __jbd2_journal_remove_checkpoint(struct journal_head *jh)
struct transaction_chp_stats_s *stats;
transaction_t *transaction;
journal_t *journal;
int ret = 0;
JBUFFER_TRACE(jh, "entry");
if ((transaction = jh->b_cp_transaction) == NULL) {
transaction = jh->b_cp_transaction;
if (!transaction) {
JBUFFER_TRACE(jh, "not on transaction");
goto out;
return 0;
}
journal = transaction->t_journal;
......@@ -579,9 +579,9 @@ int __jbd2_journal_remove_checkpoint(struct journal_head *jh)
jh->b_cp_transaction = NULL;
jbd2_journal_put_journal_head(jh);
if (transaction->t_checkpoint_list != NULL ||
transaction->t_checkpoint_io_list != NULL)
goto out;
/* Is this transaction empty? */
if (transaction->t_checkpoint_list || transaction->t_checkpoint_io_list)
return 0;
/*
* 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)
* See the comment at the end of jbd2_journal_commit_transaction().
*/
if (transaction->t_state != T_FINISHED)
goto out;
return 0;
/* OK, that was the last buffer for the transaction: we can now
safely remove this transaction from the log */
/*
* OK, that was the last buffer for the transaction, we can now
* safely remove this transaction from the log.
*/
stats = &transaction->t_chp_stats;
if (stats->cs_chp_time)
stats->cs_chp_time = jbd2_time_diff(stats->cs_chp_time,
......@@ -606,9 +608,7 @@ int __jbd2_journal_remove_checkpoint(struct journal_head *jh)
__jbd2_journal_drop_transaction(journal, transaction);
jbd2_journal_free_transaction(transaction);
ret = 1;
out:
return ret;
return 1;
}
/*
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册