tid_t                   this_tid;
        int                     result, batch_count = 0;
 
-       jbd_debug(1, "Start checkpoint\n");
+       jbd2_debug(1, "Start checkpoint\n");
 
        /*
         * First thing: if there are any transactions in the log which
         */
        result = jbd2_cleanup_journal_tail(journal);
        trace_jbd2_checkpoint(journal, result);
-       jbd_debug(1, "cleanup_journal_tail returned %d\n", result);
+       jbd2_debug(1, "cleanup_journal_tail returned %d\n", result);
        if (result <= 0)
                return result;
 
 
        trace_jbd2_drop_transaction(journal, transaction);
 
-       jbd_debug(1, "Dropping transaction %d, all done\n", transaction->t_tid);
+       jbd2_debug(1, "Dropping transaction %d, all done\n", transaction->t_tid);
 }
 
 
        /* 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.
                                                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);
        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);
        __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
        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
        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
                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,
                                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)];
                    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
           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,
 
        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)) {
        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;
            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);
 
        /* 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);
 
                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);
 
        if (journal->j_flags & JBD2_UNMOUNT)
                goto end_loop;
 
-       jbd_debug(1, "commit_sequence=%u, commit_request=%u\n",
+       jbd2_debug(1, "commit_sequence=%u, commit_request=%u\n",
                journal->j_commit_sequence, journal->j_commit_request);
 
        if (journal->j_commit_sequence != journal->j_commit_request) {
-               jbd_debug(1, "OK, requests differ\n");
+               jbd2_debug(1, "OK, requests differ\n");
                write_unlock(&journal->j_state_lock);
                del_timer_sync(&journal->j_commit_timer);
                jbd2_journal_commit_transaction(journal);
                 * good idea, because that depends on threads that may
                 * be already stopped.
                 */
-               jbd_debug(1, "Now suspending kjournald2\n");
+               jbd2_debug(1, "Now suspending kjournald2\n");
                write_unlock(&journal->j_state_lock);
                try_to_freeze();
                write_lock(&journal->j_state_lock);
                finish_wait(&journal->j_wait_commit, &wait);
        }
 
-       jbd_debug(1, "kjournald2 wakes\n");
+       jbd2_debug(1, "kjournald2 wakes\n");
 
        /*
         * Were we woken up by a commit wakeup event?
        transaction = journal->j_running_transaction;
        if (transaction && time_after_eq(jiffies, transaction->t_expires)) {
                journal->j_commit_request = transaction->t_tid;
-               jbd_debug(1, "woke because of timeout\n");
+               jbd2_debug(1, "woke because of timeout\n");
        }
        goto loop;
 
        del_timer_sync(&journal->j_commit_timer);
        journal->j_task = NULL;
        wake_up(&journal->j_wait_done_commit);
-       jbd_debug(1, "Journal thread exiting.\n");
+       jbd2_debug(1, "Journal thread exiting.\n");
        write_unlock(&journal->j_state_lock);
        return 0;
 }
                 */
 
                journal->j_commit_request = target;
-               jbd_debug(1, "JBD2: requesting commit %u/%u\n",
+               jbd2_debug(1, "JBD2: requesting commit %u/%u\n",
                          journal->j_commit_request,
                          journal->j_commit_sequence);
                journal->j_running_transaction->t_requested = jiffies;
        }
 #endif
        while (tid_gt(tid, journal->j_commit_sequence)) {
-               jbd_debug(1, "JBD2: want %u, j_commit_sequence=%u\n",
+               jbd2_debug(1, "JBD2: want %u, j_commit_sequence=%u\n",
                                  tid, journal->j_commit_sequence);
                read_unlock(&journal->j_state_lock);
                wake_up(&journal->j_wait_commit);
                freed += journal->j_last - journal->j_first;
 
        trace_jbd2_update_log_tail(journal, tid, block, freed);
-       jbd_debug(1,
+       jbd2_debug(1,
                  "Cleaning journal tail from %u to %u (offset %lu), "
                  "freeing %lu\n",
                  journal->j_tail_sequence, tid, block, freed);
                return NULL;
        }
 
-       jbd_debug(1, "JBD2: inode %s/%ld, size %lld, bits %d, blksize %ld\n",
+       jbd2_debug(1, "JBD2: inode %s/%ld, size %lld, bits %d, blksize %ld\n",
                  inode->i_sb->s_id, inode->i_ino, (long long) inode->i_size,
                  inode->i_sb->s_blocksize_bits, inode->i_sb->s_blocksize);
 
         * attempting a write to a potential-readonly device.
         */
        if (sb->s_start == 0) {
-               jbd_debug(1, "JBD2: Skipping superblock update on recovered sb "
+               jbd2_debug(1, "JBD2: Skipping superblock update on recovered sb "
                        "(start %ld, seq %u, errno %d)\n",
                        journal->j_tail, journal->j_tail_sequence,
                        journal->j_errno);
        }
 
        BUG_ON(!mutex_is_locked(&journal->j_checkpoint_mutex));
-       jbd_debug(1, "JBD2: updating superblock (start %lu, seq %u)\n",
+       jbd2_debug(1, "JBD2: updating superblock (start %lu, seq %u)\n",
                  tail_block, tail_tid);
 
        lock_buffer(journal->j_sb_buffer);
                return;
        }
 
-       jbd_debug(1, "JBD2: Marking journal as empty (seq %u)\n",
+       jbd2_debug(1, "JBD2: Marking journal as empty (seq %u)\n",
                  journal->j_tail_sequence);
 
        sb->s_sequence = cpu_to_be32(journal->j_tail_sequence);
        errcode = journal->j_errno;
        if (errcode == -ESHUTDOWN)
                errcode = 0;
-       jbd_debug(1, "JBD2: updating superblock error (errno %d)\n", errcode);
+       jbd2_debug(1, "JBD2: updating superblock error (errno %d)\n", errcode);
        sb->s_errno    = cpu_to_be32(errcode);
 
        jbd2_write_superblock(journal, REQ_SYNC | REQ_FUA);
            compat & JBD2_FEATURE_COMPAT_CHECKSUM)
                compat &= ~JBD2_FEATURE_COMPAT_CHECKSUM;
 
-       jbd_debug(1, "Setting new features 0x%lx/0x%lx/0x%lx\n",
+       jbd2_debug(1, "Setting new features 0x%lx/0x%lx/0x%lx\n",
                  compat, ro, incompat);
 
        sb = journal->j_superblock;
 {
        journal_superblock_t *sb;
 
-       jbd_debug(1, "Clear features 0x%lx/0x%lx/0x%lx\n",
+       jbd2_debug(1, "Clear features 0x%lx/0x%lx/0x%lx\n",
                  compat, ro, incompat);
 
        sb = journal->j_superblock;
 #endif
        ret = kmem_cache_zalloc(jbd2_journal_head_cache, GFP_NOFS);
        if (!ret) {
-               jbd_debug(1, "out of memory for journal_head\n");
+               jbd2_debug(1, "out of memory for journal_head\n");
                pr_notice_ratelimited("ENOMEM in %s, retrying.\n", __func__);
                ret = kmem_cache_zalloc(jbd2_journal_head_cache,
                                GFP_NOFS | __GFP_NOFAIL);
 
                return 0;
 
        while (next_fc_block <= journal->j_fc_last) {
-               jbd_debug(3, "Fast commit replay: next block %ld\n",
+               jbd2_debug(3, "Fast commit replay: next block %ld\n",
                          next_fc_block);
                err = jread(&bh, journal, next_fc_block);
                if (err) {
-                       jbd_debug(3, "Fast commit replay: read error\n");
+                       jbd2_debug(3, "Fast commit replay: read error\n");
                        break;
                }
 
        }
 
        if (err)
-               jbd_debug(3, "Fast commit replay failed, err = %d\n", err);
+               jbd2_debug(3, "Fast commit replay failed, err = %d\n", err);
 
        return err;
 }
         */
 
        if (!sb->s_start) {
-               jbd_debug(1, "No recovery required, last transaction %d\n",
+               jbd2_debug(1, "No recovery required, last transaction %d\n",
                          be32_to_cpu(sb->s_sequence));
                journal->j_transaction_sequence = be32_to_cpu(sb->s_sequence) + 1;
                return 0;
        if (!err)
                err = do_one_pass(journal, &info, PASS_REPLAY);
 
-       jbd_debug(1, "JBD2: recovery, exit status %d, "
+       jbd2_debug(1, "JBD2: recovery, exit status %d, "
                  "recovered transactions %u to %u\n",
                  err, info.start_transaction, info.end_transaction);
-       jbd_debug(1, "JBD2: Replayed %d and revoked %d/%d blocks\n",
+       jbd2_debug(1, "JBD2: Replayed %d and revoked %d/%d blocks\n",
                  info.nr_replays, info.nr_revoke_hits, info.nr_revokes);
 
        /* Restart the log at the next transaction ID, thus invalidating
 #ifdef CONFIG_JBD2_DEBUG
                int dropped = info.end_transaction - 
                        be32_to_cpu(journal->j_superblock->s_sequence);
-               jbd_debug(1,
+               jbd2_debug(1,
                          "JBD2: ignoring %d transaction%s from the journal.\n",
                          dropped, (dropped == 1) ? "" : "s");
 #endif
        if (pass == PASS_SCAN)
                info->start_transaction = first_commit_ID;
 
-       jbd_debug(1, "Starting recovery pass %d\n", pass);
+       jbd2_debug(1, "Starting recovery pass %d\n", pass);
 
        /*
         * Now we walk through the log, transaction by transaction,
                        if (tid_geq(next_commit_ID, info->end_transaction))
                                break;
 
-               jbd_debug(2, "Scanning for sequence ID %u at %lu/%lu\n",
+               jbd2_debug(2, "Scanning for sequence ID %u at %lu/%lu\n",
                          next_commit_ID, next_log_block,
                          jbd2_has_feature_fast_commit(journal) ?
                          journal->j_fc_last : journal->j_last);
                 * either the next descriptor block or the final commit
                 * record. */
 
-               jbd_debug(3, "JBD2: checking block %ld\n", next_log_block);
+               jbd2_debug(3, "JBD2: checking block %ld\n", next_log_block);
                err = jread(&bh, journal, next_log_block);
                if (err)
                        goto failed;
 
                blocktype = be32_to_cpu(tmp->h_blocktype);
                sequence = be32_to_cpu(tmp->h_sequence);
-               jbd_debug(3, "Found magic %d, sequence %d\n",
+               jbd2_debug(3, "Found magic %d, sequence %d\n",
                          blocktype, sequence);
 
                if (sequence != next_commit_ID) {
                                        goto failed;
                                }
                                need_check_commit_time = true;
-                               jbd_debug(1,
+                               jbd2_debug(1,
                                        "invalid descriptor block found in %lu\n",
                                        next_log_block);
                        }
                                 * It likely does not belong to same journal,
                                 * just end this recovery with success.
                                 */
-                               jbd_debug(1, "JBD2: Invalid checksum ignored in transaction %u, likely stale data\n",
+                               jbd2_debug(1, "JBD2: Invalid checksum ignored in transaction %u, likely stale data\n",
                                          next_commit_ID);
                                brelse(bh);
                                goto done;
                        if (pass == PASS_SCAN &&
                            !jbd2_descriptor_block_csum_verify(journal,
                                                               bh->b_data)) {
-                               jbd_debug(1, "JBD2: invalid revoke block found in %lu\n",
+                               jbd2_debug(1, "JBD2: invalid revoke block found in %lu\n",
                                          next_log_block);
                                need_check_commit_time = true;
                        }
                        continue;
 
                default:
-                       jbd_debug(3, "Unrecognised magic %d, end of scan.\n",
+                       jbd2_debug(3, "Unrecognised magic %d, end of scan.\n",
                                  blocktype);
                        brelse(bh);
                        goto done;
 
        }
        handle->h_revoke_credits--;
 
-       jbd_debug(2, "insert revoke for block %llu, bh_in=%p\n",blocknr, bh_in);
+       jbd2_debug(2, "insert revoke for block %llu, bh_in=%p\n",blocknr, bh_in);
        err = insert_revoke_hash(journal, blocknr,
                                handle->h_transaction->t_tid);
        BUFFER_TRACE(bh_in, "exit");
        int did_revoke = 0;     /* akpm: debug */
        struct buffer_head *bh = jh2bh(jh);
 
-       jbd_debug(4, "journal_head %p, cancelling revoke\n", jh);
+       jbd2_debug(4, "journal_head %p, cancelling revoke\n", jh);
 
        /* Is the existing Revoke bit valid?  If so, we trust it, and
         * only perform the full cancel if the revoke bit is set.  If
        if (need_cancel) {
                record = find_revoke_record(journal, bh->b_blocknr);
                if (record) {
-                       jbd_debug(4, "cancelled existing revoke on "
+                       jbd2_debug(4, "cancelled existing revoke on "
                                  "blocknr %llu\n", (unsigned long long)bh->b_blocknr);
                        spin_lock(&journal->j_revoke_lock);
                        list_del(&record->hash);
        }
        if (descriptor)
                flush_descriptor(journal, descriptor, offset);
-       jbd_debug(1, "Wrote %d revoke records\n", count);
+       jbd2_debug(1, "Wrote %d revoke records\n", count);
 }
 
 /*
 
                        return -ENOMEM;
        }
 
-       jbd_debug(3, "New handle %p going live.\n", handle);
+       jbd2_debug(3, "New handle %p going live.\n", handle);
 
        /*
         * We need to hold j_state_lock until t_updates has been incremented,
        handle->h_start_jiffies = jiffies;
        atomic_inc(&transaction->t_updates);
        atomic_inc(&transaction->t_handle_count);
-       jbd_debug(4, "Handle %p given %d credits (total %d, free %lu)\n",
+       jbd2_debug(4, "Handle %p given %d credits (total %d, free %lu)\n",
                  handle, blocks,
                  atomic_read(&transaction->t_outstanding_credits),
                  jbd2_log_space_left(journal));
 
        /* Don't extend a locked-down transaction! */
        if (transaction->t_state != T_RUNNING) {
-               jbd_debug(3, "denied handle %p %d blocks: "
+               jbd2_debug(3, "denied handle %p %d blocks: "
                          "transaction not running\n", handle, nblocks);
                goto error_out;
        }
                                   &transaction->t_outstanding_credits);
 
        if (wanted > journal->j_max_transaction_buffers) {
-               jbd_debug(3, "denied handle %p %d blocks: "
+               jbd2_debug(3, "denied handle %p %d blocks: "
                          "transaction too large\n", handle, nblocks);
                atomic_sub(nblocks, &transaction->t_outstanding_credits);
                goto error_out;
        handle->h_revoke_credits_requested += revoke_records;
        result = 0;
 
-       jbd_debug(3, "extended handle %p by %d\n", handle, nblocks);
+       jbd2_debug(3, "extended handle %p by %d\n", handle, nblocks);
 error_out:
        read_unlock(&journal->j_state_lock);
        return result;
         * First unlink the handle from its current transaction, and start the
         * commit on that.
         */
-       jbd_debug(2, "restarting handle %p\n", handle);
+       jbd2_debug(2, "restarting handle %p\n", handle);
        stop_this_handle(handle);
        handle->h_transaction = NULL;
 
 
        journal = transaction->t_journal;
 
-       jbd_debug(5, "journal_head %p, force_copy %d\n", jh, force_copy);
+       jbd2_debug(5, "journal_head %p, force_copy %d\n", jh, force_copy);
 
        JBUFFER_TRACE(jh, "entry");
 repeat:
        struct journal_head *jh = jbd2_journal_add_journal_head(bh);
        int err;
 
-       jbd_debug(5, "journal_head %p\n", jh);
+       jbd2_debug(5, "journal_head %p\n", jh);
        err = -EROFS;
        if (is_handle_aborted(handle))
                goto out;
         * of the running transaction.
         */
        jh = bh2jh(bh);
-       jbd_debug(5, "journal_head %p\n", jh);
+       jbd2_debug(5, "journal_head %p\n", jh);
        JBUFFER_TRACE(jh, "entry");
 
        /*
        pid_t pid;
 
        if (--handle->h_ref > 0) {
-               jbd_debug(4, "h_ref %d -> %d\n", handle->h_ref + 1,
+               jbd2_debug(4, "h_ref %d -> %d\n", handle->h_ref + 1,
                                                 handle->h_ref);
                if (is_handle_aborted(handle))
                        return -EIO;
        if (is_handle_aborted(handle))
                err = -EIO;
 
-       jbd_debug(4, "Handle %p going down\n", handle);
+       jbd2_debug(4, "Handle %p going down\n", handle);
        trace_jbd2_handle_stats(journal->j_fs_dev->bd_dev,
                                tid, handle->h_type, handle->h_line_no,
                                jiffies - handle->h_start_jiffies,
                 * completes the commit thread, it just doesn't write
                 * anything to disk. */
 
-               jbd_debug(2, "transaction too old, requesting commit for "
+               jbd2_debug(2, "transaction too old, requesting commit for "
                                        "handle %p\n", handle);
                /* This is non-blocking */
                jbd2_log_start_commit(journal, tid);
                return -EROFS;
        journal = transaction->t_journal;
 
-       jbd_debug(4, "Adding inode %lu, tid:%d\n", jinode->i_vfs_inode->i_ino,
+       jbd2_debug(4, "Adding inode %lu, tid:%d\n", jinode->i_vfs_inode->i_ino,
                        transaction->t_tid);
 
        spin_lock(&journal->j_list_lock);
 
 void __jbd2_debug(int level, const char *file, const char *func,
                  unsigned int line, const char *fmt, ...);
 
-#define jbd_debug(n, fmt, a...) \
+#define jbd2_debug(n, fmt, a...) \
        __jbd2_debug((n), __FILE__, __func__, __LINE__, (fmt), ##a)
 #else
-#define jbd_debug(n, fmt, a...)  no_printk(fmt, ##a)
+#define jbd2_debug(n, fmt, a...)  no_printk(fmt, ##a)
 #endif
 
 extern void *jbd2_alloc(size_t size, gfp_t flags);