jbd2: make jbd2_journal_get_max_txn_bufs() internal
commit 4aa99c71e42ad60178c1154ec24e3df9c684fb67 upstream. There's no reason to have jbd2_journal_get_max_txn_bufs() public function. Currently all users are internal and can use journal->j_max_transaction_buffers instead. This saves some unnecessary recomputations of the limit as a bonus which becomes important as this function gets more complex in the following patch. CC: stable@vger.kernel.org Signed-off-by: Jan Kara <jack@suse.cz> Reviewed-by: Zhang Yi <yi.zhang@huawei.com> Link: https://patch.msgid.link/20240624170127.3253-1-jack@suse.cz Signed-off-by: Theodore Ts'o <tytso@mit.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
1720436af8
commit
ecdf0fab70
3 changed files with 6 additions and 6 deletions
|
@ -813,7 +813,7 @@ start_journal_io:
|
||||||
if (first_block < journal->j_tail)
|
if (first_block < journal->j_tail)
|
||||||
freed += journal->j_last - journal->j_first;
|
freed += journal->j_last - journal->j_first;
|
||||||
/* Update tail only if we free significant amount of space */
|
/* Update tail only if we free significant amount of space */
|
||||||
if (freed < jbd2_journal_get_max_txn_bufs(journal))
|
if (freed < journal->j_max_transaction_buffers)
|
||||||
update_tail = 0;
|
update_tail = 0;
|
||||||
}
|
}
|
||||||
J_ASSERT(commit_transaction->t_state == T_COMMIT);
|
J_ASSERT(commit_transaction->t_state == T_COMMIT);
|
||||||
|
|
|
@ -1481,6 +1481,11 @@ static void journal_fail_superblock(journal_t *journal)
|
||||||
journal->j_sb_buffer = NULL;
|
journal->j_sb_buffer = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int jbd2_journal_get_max_txn_bufs(journal_t *journal)
|
||||||
|
{
|
||||||
|
return (journal->j_total_len - journal->j_fc_wbufsize) / 4;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Given a journal_t structure, initialise the various fields for
|
* Given a journal_t structure, initialise the various fields for
|
||||||
* startup of a new journaling session. We use this both when creating
|
* startup of a new journaling session. We use this both when creating
|
||||||
|
|
|
@ -1626,11 +1626,6 @@ int jbd2_wait_inode_data(journal_t *journal, struct jbd2_inode *jinode);
|
||||||
int jbd2_fc_wait_bufs(journal_t *journal, int num_blks);
|
int jbd2_fc_wait_bufs(journal_t *journal, int num_blks);
|
||||||
int jbd2_fc_release_bufs(journal_t *journal);
|
int jbd2_fc_release_bufs(journal_t *journal);
|
||||||
|
|
||||||
static inline int jbd2_journal_get_max_txn_bufs(journal_t *journal)
|
|
||||||
{
|
|
||||||
return (journal->j_total_len - journal->j_fc_wbufsize) / 4;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* is_journal_abort
|
* is_journal_abort
|
||||||
*
|
*
|
||||||
|
|
Loading…
Reference in a new issue