Commit 0bce577b authored by Harshad Shirwadkar's avatar Harshad Shirwadkar Committed by Theodore Ts'o

jbd2: don't pass tid to jbd2_fc_end_commit_fallback()

In jbd2_fc_end_commit_fallback(), we know which tid to commit. There's
no need for caller to pass it.
Suggested-by: default avatarJan Kara <jack@suse.cz>
Signed-off-by: default avatarHarshad Shirwadkar <harshadshirwadkar@gmail.com>
Link: https://lore.kernel.org/r/20201106035911.1942128-10-harshadshirwadkar@gmail.comSigned-off-by: default avatarTheodore Ts'o <tytso@mit.edu>
parent c460e5ed
...@@ -1143,7 +1143,7 @@ int ext4_fc_commit(journal_t *journal, tid_t commit_tid) ...@@ -1143,7 +1143,7 @@ int ext4_fc_commit(journal_t *journal, tid_t commit_tid)
"Fast commit ended with blks = %d, reason = %d, subtid - %d", "Fast commit ended with blks = %d, reason = %d, subtid - %d",
nblks, reason, subtid); nblks, reason, subtid);
if (reason == EXT4_FC_REASON_FC_FAILED) if (reason == EXT4_FC_REASON_FC_FAILED)
return jbd2_fc_end_commit_fallback(journal, commit_tid); return jbd2_fc_end_commit_fallback(journal);
if (reason == EXT4_FC_REASON_FC_START_FAILED || if (reason == EXT4_FC_REASON_FC_START_FAILED ||
reason == EXT4_FC_REASON_INELIGIBLE) reason == EXT4_FC_REASON_INELIGIBLE)
return jbd2_complete_transaction(journal, commit_tid); return jbd2_complete_transaction(journal, commit_tid);
......
...@@ -777,13 +777,19 @@ static int __jbd2_fc_end_commit(journal_t *journal, tid_t tid, bool fallback) ...@@ -777,13 +777,19 @@ static int __jbd2_fc_end_commit(journal_t *journal, tid_t tid, bool fallback)
int jbd2_fc_end_commit(journal_t *journal) int jbd2_fc_end_commit(journal_t *journal)
{ {
return __jbd2_fc_end_commit(journal, 0, 0); return __jbd2_fc_end_commit(journal, 0, false);
} }
EXPORT_SYMBOL(jbd2_fc_end_commit); EXPORT_SYMBOL(jbd2_fc_end_commit);
int jbd2_fc_end_commit_fallback(journal_t *journal, tid_t tid) int jbd2_fc_end_commit_fallback(journal_t *journal)
{ {
return __jbd2_fc_end_commit(journal, tid, 1); tid_t tid;
read_lock(&journal->j_state_lock);
tid = journal->j_running_transaction ?
journal->j_running_transaction->t_tid : 0;
read_unlock(&journal->j_state_lock);
return __jbd2_fc_end_commit(journal, tid, true);
} }
EXPORT_SYMBOL(jbd2_fc_end_commit_fallback); EXPORT_SYMBOL(jbd2_fc_end_commit_fallback);
......
...@@ -1619,7 +1619,7 @@ extern int jbd2_cleanup_journal_tail(journal_t *); ...@@ -1619,7 +1619,7 @@ extern int jbd2_cleanup_journal_tail(journal_t *);
/* Fast commit related APIs */ /* Fast commit related APIs */
int jbd2_fc_begin_commit(journal_t *journal, tid_t tid); int jbd2_fc_begin_commit(journal_t *journal, tid_t tid);
int jbd2_fc_end_commit(journal_t *journal); int jbd2_fc_end_commit(journal_t *journal);
int jbd2_fc_end_commit_fallback(journal_t *journal, tid_t tid); int jbd2_fc_end_commit_fallback(journal_t *journal);
int jbd2_fc_get_buf(journal_t *journal, struct buffer_head **bh_out); int jbd2_fc_get_buf(journal_t *journal, struct buffer_head **bh_out);
int jbd2_submit_inode_data(struct jbd2_inode *jinode); int jbd2_submit_inode_data(struct jbd2_inode *jinode);
int jbd2_wait_inode_data(journal_t *journal, struct jbd2_inode *jinode); int jbd2_wait_inode_data(journal_t *journal, struct jbd2_inode *jinode);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment