Skip to content

Commit 4aa99c7

Browse files
jankaratytso
authored andcommitted
jbd2: make jbd2_journal_get_max_txn_bufs() internal
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: [email protected] Signed-off-by: Jan Kara <[email protected]> Reviewed-by: Zhang Yi <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Theodore Ts'o <[email protected]>
1 parent 0bab8db commit 4aa99c7

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

fs/jbd2/commit.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -766,7 +766,7 @@ void jbd2_journal_commit_transaction(journal_t *journal)
766766
if (first_block < journal->j_tail)
767767
freed += journal->j_last - journal->j_first;
768768
/* Update tail only if we free significant amount of space */
769-
if (freed < jbd2_journal_get_max_txn_bufs(journal))
769+
if (freed < journal->j_max_transaction_buffers)
770770
update_tail = 0;
771771
}
772772
J_ASSERT(commit_transaction->t_state == T_COMMIT);

fs/jbd2/journal.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1674,6 +1674,11 @@ journal_t *jbd2_journal_init_inode(struct inode *inode)
16741674
return journal;
16751675
}
16761676

1677+
static int jbd2_journal_get_max_txn_bufs(journal_t *journal)
1678+
{
1679+
return (journal->j_total_len - journal->j_fc_wbufsize) / 4;
1680+
}
1681+
16771682
/*
16781683
* Given a journal_t structure, initialise the various fields for
16791684
* startup of a new journaling session. We use this both when creating

include/linux/jbd2.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1660,11 +1660,6 @@ int jbd2_wait_inode_data(journal_t *journal, struct jbd2_inode *jinode);
16601660
int jbd2_fc_wait_bufs(journal_t *journal, int num_blks);
16611661
int jbd2_fc_release_bufs(journal_t *journal);
16621662

1663-
static inline int jbd2_journal_get_max_txn_bufs(journal_t *journal)
1664-
{
1665-
return (journal->j_total_len - journal->j_fc_wbufsize) / 4;
1666-
}
1667-
16681663
/*
16691664
* is_journal_abort
16701665
*

0 commit comments

Comments
 (0)