]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
jbd2: Drop jbd2_space_needed()
authorJan Kara <jack@suse.cz>
Tue, 5 Nov 2019 16:44:25 +0000 (17:44 +0100)
committerTheodore Ts'o <tytso@mit.edu>
Tue, 5 Nov 2019 21:00:48 +0000 (16:00 -0500)
The function is now just a trivial wrapper returning
journal->j_max_transaction_buffers. Drop it.

Reviewed-by: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Jan Kara <jack@suse.cz>
Link: https://lore.kernel.org/r/20191105164437.32602-19-jack@suse.cz
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
fs/jbd2/checkpoint.c
fs/jbd2/transaction.c
include/linux/jbd2.h

index a1909066bde663d798932ace0f0c71e2002adfe8..8fff6677a5da4f10293a775c3eeea5062ebaa9a1 100644 (file)
@@ -110,7 +110,7 @@ void __jbd2_log_wait_for_space(journal_t *journal)
        int nblocks, space_left;
        /* assert_spin_locked(&journal->j_state_lock); */
 
-       nblocks = jbd2_space_needed(journal);
+       nblocks = journal->j_max_transaction_buffers;
        while (jbd2_log_space_left(journal) < nblocks) {
                write_unlock(&journal->j_state_lock);
                mutex_lock_io(&journal->j_checkpoint_mutex);
index ed7cf9e62584ac9ad9ec15338cc4d162d22bc6ce..ba388da7e02bd24bc7b3eca0ea4de6699fd984e0 100644 (file)
@@ -270,12 +270,13 @@ static int add_transaction_credits(journal_t *journal, int blocks,
         * *before* starting to dirty potentially checkpointed buffers
         * in the new transaction.
         */
-       if (jbd2_log_space_left(journal) < jbd2_space_needed(journal)) {
+       if (jbd2_log_space_left(journal) < journal->j_max_transaction_buffers) {
                atomic_sub(total, &t->t_outstanding_credits);
                read_unlock(&journal->j_state_lock);
                jbd2_might_wait_for_commit(journal);
                write_lock(&journal->j_state_lock);
-               if (jbd2_log_space_left(journal) < jbd2_space_needed(journal))
+               if (jbd2_log_space_left(journal) <
+                                       journal->j_max_transaction_buffers)
                        __jbd2_log_wait_for_space(journal);
                write_unlock(&journal->j_state_lock);
                return 1;
index bef4f74b1ea0dd831ff3a00f7d6293559bad57a8..1dd2703a8e26495c3b3b2d0e1afaca0daa9a2040 100644 (file)
@@ -1562,15 +1562,6 @@ static inline int jbd2_journal_has_csum_v2or3(journal_t *journal)
        return journal->j_chksum_driver != NULL;
 }
 
-/*
- * Return the minimum number of blocks which must be free in the journal
- * before a new transaction may be started.  Must be called under j_state_lock.
- */
-static inline int jbd2_space_needed(journal_t *journal)
-{
-       return journal->j_max_transaction_buffers;
-}
-
 /*
  * Return number of free blocks in the log. Must be called under j_state_lock.
  */