Skip to content

Commit

Permalink
jbd2: rename jbd_debug() to jbd2_debug()
Browse files Browse the repository at this point in the history
The name of jbd_debug() is confusing as all functions inside jbd2 have
jbd2_ prefix. Rename jbd_debug() to jbd2_debug(). No functional changes.

Signed-off-by: Jan Kara <[email protected]>
Reviewed-by: Lukas Czerner <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Theodore Ts'o <[email protected]>
  • Loading branch information
jankara authored and tytso committed Aug 3, 2022
1 parent 4978c65 commit cb3b3bf
Show file tree
Hide file tree
Showing 7 changed files with 69 additions and 69 deletions.
6 changes: 3 additions & 3 deletions fs/jbd2/checkpoint.c
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ int jbd2_log_do_checkpoint(journal_t *journal)
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
Expand All @@ -212,7 +212,7 @@ int jbd2_log_do_checkpoint(journal_t *journal)
*/
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;

Expand Down Expand Up @@ -804,5 +804,5 @@ void __jbd2_journal_drop_transaction(journal_t *journal, transaction_t *transact

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);
}
30 changes: 15 additions & 15 deletions fs/jbd2/commit.c
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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);
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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,
Expand All @@ -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)];
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -839,7 +839,7 @@ void jbd2_journal_commit_transaction(journal_t *journal)
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,
Expand Down Expand Up @@ -882,7 +882,7 @@ void jbd2_journal_commit_transaction(journal_t *journal)

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)) {
Expand All @@ -906,7 +906,7 @@ void jbd2_journal_commit_transaction(journal_t *journal)
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;
Expand Down Expand Up @@ -945,7 +945,7 @@ void jbd2_journal_commit_transaction(journal_t *journal)
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);
Expand Down Expand Up @@ -1122,7 +1122,7 @@ void jbd2_journal_commit_transaction(journal_t *journal)

/* 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);

Expand Down Expand Up @@ -1164,7 +1164,7 @@ void jbd2_journal_commit_transaction(journal_t *journal)
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);
Expand Down
34 changes: 17 additions & 17 deletions fs/jbd2/journal.c
Original file line number Diff line number Diff line change
Expand Up @@ -203,11 +203,11 @@ static int kjournald2(void *arg)
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);
Expand All @@ -222,7 +222,7 @@ static int kjournald2(void *arg)
* 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);
Expand Down Expand Up @@ -252,23 +252,23 @@ static int kjournald2(void *arg)
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;

end_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;
}
Expand Down Expand Up @@ -500,7 +500,7 @@ int __jbd2_log_start_commit(journal_t *journal, tid_t target)
*/

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;
Expand Down Expand Up @@ -705,7 +705,7 @@ int jbd2_log_wait_commit(journal_t *journal, tid_t tid)
}
#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);
Expand Down Expand Up @@ -1117,7 +1117,7 @@ int __jbd2_update_log_tail(journal_t *journal, tid_t tid, unsigned long block)
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);
Expand Down Expand Up @@ -1496,7 +1496,7 @@ journal_t *jbd2_journal_init_inode(struct inode *inode)
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);

Expand Down Expand Up @@ -1575,7 +1575,7 @@ static int journal_reset(journal_t *journal)
* 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);
Expand Down Expand Up @@ -1678,7 +1678,7 @@ int jbd2_journal_update_sb_log_tail(journal_t *journal, tid_t tail_tid,
}

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);
Expand Down Expand Up @@ -1719,7 +1719,7 @@ static void jbd2_mark_journal_empty(journal_t *journal, int write_op)
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);
Expand Down Expand Up @@ -1862,7 +1862,7 @@ void jbd2_journal_update_sb_errno(journal_t *journal)
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);
Expand Down Expand Up @@ -2334,7 +2334,7 @@ int jbd2_journal_set_features(journal_t *journal, unsigned long compat,
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;
Expand Down Expand Up @@ -2403,7 +2403,7 @@ void jbd2_journal_clear_features(journal_t *journal, unsigned long compat,
{
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;
Expand Down Expand Up @@ -2860,7 +2860,7 @@ static struct journal_head *journal_alloc_journal_head(void)
#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);
Expand Down
Loading

0 comments on commit cb3b3bf

Please sign in to comment.