]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
jbd2: make jbd2_journal_get_max_txn_bufs() internal
authorJan Kara <jack@suse.cz>
Mon, 24 Jun 2024 17:01:17 +0000 (19:01 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 3 Aug 2024 07:00:40 +0000 (09:00 +0200)
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>
fs/jbd2/commit.c
fs/jbd2/journal.c
include/linux/jbd2.h

index 75ea4e9a5cabd40e2e775db4cecd93807f14e191..e7fc912693bd7402dfe6e453f7e7233fb6b48dd2 100644 (file)
@@ -766,7 +766,7 @@ start_journal_io:
                if (first_block < journal->j_tail)
                        freed += journal->j_last - journal->j_first;
                /* 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;
        }
        J_ASSERT(commit_transaction->t_state == T_COMMIT);
index 03c4b9214f564a311bd1dd028abe2a7fb6aa2ee1..1bb73750d307307cfb6af81febc8fab4a0c33e11 100644 (file)
@@ -1698,6 +1698,11 @@ journal_t *jbd2_journal_init_inode(struct inode *inode)
        return journal;
 }
 
+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
  * startup of a new journaling session.  We use this both when creating
index ab04c1c27fae384dd0fb21e285dd831abde4af71..f91b930abe20fb355fdd7db836bfa77979f037f0 100644 (file)
@@ -1660,11 +1660,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_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
  *