Merge tag 'ext4_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso...
[linux-2.6-microblaze.git] / fs / jbd2 / commit.c
index 890b554..b2b2bc9 100644 (file)
@@ -421,7 +421,7 @@ void jbd2_journal_commit_transaction(journal_t *journal)
 
        /* Do we need to erase the effects of a prior jbd2_journal_flush? */
        if (journal->j_flags & JBD2_FLUSHED) {
-               jbd_debug(3, "super block updated\n");
+               jbd2_debug(3, "super block updated\n");
                mutex_lock_io(&journal->j_checkpoint_mutex);
                /*
                 * We hold j_checkpoint_mutex so tail cannot change under us.
@@ -435,7 +435,7 @@ void jbd2_journal_commit_transaction(journal_t *journal)
                                                REQ_SYNC);
                mutex_unlock(&journal->j_checkpoint_mutex);
        } else {
-               jbd_debug(3, "superblock not updated\n");
+               jbd2_debug(3, "superblock not updated\n");
        }
 
        J_ASSERT(journal->j_running_transaction != NULL);
@@ -467,7 +467,7 @@ void jbd2_journal_commit_transaction(journal_t *journal)
        commit_transaction = journal->j_running_transaction;
 
        trace_jbd2_start_commit(journal, commit_transaction);
-       jbd_debug(1, "JBD2: starting commit of transaction %d\n",
+       jbd2_debug(1, "JBD2: starting commit of transaction %d\n",
                        commit_transaction->t_tid);
 
        write_lock(&journal->j_state_lock);
@@ -540,7 +540,7 @@ void jbd2_journal_commit_transaction(journal_t *journal)
        __jbd2_journal_clean_checkpoint_list(journal, false);
        spin_unlock(&journal->j_list_lock);
 
-       jbd_debug(3, "JBD2: commit phase 1\n");
+       jbd2_debug(3, "JBD2: commit phase 1\n");
 
        /*
         * Clear revoked flag to reflect there is no revoked buffers
@@ -553,13 +553,13 @@ void jbd2_journal_commit_transaction(journal_t *journal)
         */
        jbd2_journal_switch_revoke_table(journal);
 
+       write_lock(&journal->j_state_lock);
        /*
         * Reserved credits cannot be claimed anymore, free them
         */
        atomic_sub(atomic_read(&journal->j_reserved_credits),
                   &commit_transaction->t_outstanding_credits);
 
-       write_lock(&journal->j_state_lock);
        trace_jbd2_commit_flushing(journal, commit_transaction);
        stats.run.rs_flushing = jiffies;
        stats.run.rs_locked = jbd2_time_diff(stats.run.rs_locked,
@@ -573,7 +573,7 @@ void jbd2_journal_commit_transaction(journal_t *journal)
        wake_up(&journal->j_wait_transaction_locked);
        write_unlock(&journal->j_state_lock);
 
-       jbd_debug(3, "JBD2: commit phase 2a\n");
+       jbd2_debug(3, "JBD2: commit phase 2a\n");
 
        /*
         * Now start flushing things to disk, in the order they appear
@@ -586,7 +586,7 @@ void jbd2_journal_commit_transaction(journal_t *journal)
        blk_start_plug(&plug);
        jbd2_journal_write_revoke_records(commit_transaction, &log_bufs);
 
-       jbd_debug(3, "JBD2: commit phase 2b\n");
+       jbd2_debug(3, "JBD2: commit phase 2b\n");
 
        /*
         * Way to go: we have now written out all of the data for a
@@ -642,7 +642,7 @@ void jbd2_journal_commit_transaction(journal_t *journal)
                if (!descriptor) {
                        J_ASSERT (bufs == 0);
 
-                       jbd_debug(4, "JBD2: get descriptor\n");
+                       jbd2_debug(4, "JBD2: get descriptor\n");
 
                        descriptor = jbd2_journal_get_descriptor_buffer(
                                                        commit_transaction,
@@ -652,7 +652,7 @@ void jbd2_journal_commit_transaction(journal_t *journal)
                                continue;
                        }
 
-                       jbd_debug(4, "JBD2: got buffer %llu (%p)\n",
+                       jbd2_debug(4, "JBD2: got buffer %llu (%p)\n",
                                (unsigned long long)descriptor->b_blocknr,
                                descriptor->b_data);
                        tagp = &descriptor->b_data[sizeof(journal_header_t)];
@@ -737,7 +737,7 @@ void jbd2_journal_commit_transaction(journal_t *journal)
                    commit_transaction->t_buffers == NULL ||
                    space_left < tag_bytes + 16 + csum_size) {
 
-                       jbd_debug(4, "JBD2: Submit %d IOs\n", bufs);
+                       jbd2_debug(4, "JBD2: Submit %d IOs\n", bufs);
 
                        /* Write an end-of-descriptor marker before
                            submitting the IOs.  "tag" still points to
@@ -839,7 +839,7 @@ start_journal_io:
           so we incur less scheduling load.
        */
 
-       jbd_debug(3, "JBD2: commit phase 3\n");
+       jbd2_debug(3, "JBD2: commit phase 3\n");
 
        while (!list_empty(&io_bufs)) {
                struct buffer_head *bh = list_entry(io_bufs.prev,
@@ -882,7 +882,7 @@ start_journal_io:
 
        J_ASSERT (commit_transaction->t_shadow_list == NULL);
 
-       jbd_debug(3, "JBD2: commit phase 4\n");
+       jbd2_debug(3, "JBD2: commit phase 4\n");
 
        /* Here we wait for the revoke record and descriptor record buffers */
        while (!list_empty(&log_bufs)) {
@@ -906,7 +906,7 @@ start_journal_io:
        if (err)
                jbd2_journal_abort(journal, err);
 
-       jbd_debug(3, "JBD2: commit phase 5\n");
+       jbd2_debug(3, "JBD2: commit phase 5\n");
        write_lock(&journal->j_state_lock);
        J_ASSERT(commit_transaction->t_state == T_COMMIT_DFLUSH);
        commit_transaction->t_state = T_COMMIT_JFLUSH;
@@ -945,7 +945,7 @@ start_journal_io:
            transaction can be removed from any checkpoint list it was on
            before. */
 
-       jbd_debug(3, "JBD2: commit phase 6\n");
+       jbd2_debug(3, "JBD2: commit phase 6\n");
 
        J_ASSERT(list_empty(&commit_transaction->t_inode_list));
        J_ASSERT(commit_transaction->t_buffers == NULL);
@@ -1122,7 +1122,7 @@ restart_loop:
 
        /* Done with this transaction! */
 
-       jbd_debug(3, "JBD2: commit phase 7\n");
+       jbd2_debug(3, "JBD2: commit phase 7\n");
 
        J_ASSERT(commit_transaction->t_state == T_COMMIT_JFLUSH);
 
@@ -1164,7 +1164,7 @@ restart_loop:
                journal->j_fc_cleanup_callback(journal, 1, commit_transaction->t_tid);
 
        trace_jbd2_end_commit(journal, commit_transaction);
-       jbd_debug(1, "JBD2: commit %d complete, head %d\n",
+       jbd2_debug(1, "JBD2: commit %d complete, head %d\n",
                  journal->j_commit_sequence, journal->j_tail_sequence);
 
        write_lock(&journal->j_state_lock);