aboutsummaryrefslogtreecommitdiffstats
path: root/fs/jbd2/commit.c
diff options
context:
space:
mode:
authorTheodore Ts'o <tytso@mit.edu>2008-09-16 14:36:17 -0400
committerTheodore Ts'o <tytso@mit.edu>2008-09-16 14:36:17 -0400
commit05496769e5da83ce22ed97345afd9c7b71d6bd24 (patch)
tree545c4d66296fe69ab24d34fd2f0298fb8ee66e4f /fs/jbd2/commit.c
parent899fc1a4cf404747de2666534d508804597ee22f (diff)
jbd2: clean up how the journal device name is printed
Calculate the journal device name once and stash it away in the journal_s structure. This avoids needing to call bdevname() everywhere and reduces stack usage by not needing to allocate an on-stack buffer. In addition, we eliminate the '/' that can appear in device names (e.g. "cciss/c0d0p9" --- see kernel bugzilla #11321) that can cause problems when creating proc directory names, and include the inode number to support ocfs2 which creates multiple journals with different inode numbers. Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'fs/jbd2/commit.c')
-rw-r--r--fs/jbd2/commit.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/fs/jbd2/commit.c b/fs/jbd2/commit.c
index f2ad061e95ec..b091e5378fe0 100644
--- a/fs/jbd2/commit.c
+++ b/fs/jbd2/commit.c
@@ -147,12 +147,9 @@ static int journal_submit_commit_record(journal_t *journal,
147 * to remember if we sent a barrier request 147 * to remember if we sent a barrier request
148 */ 148 */
149 if (ret == -EOPNOTSUPP && barrier_done) { 149 if (ret == -EOPNOTSUPP && barrier_done) {
150 char b[BDEVNAME_SIZE];
151
152 printk(KERN_WARNING 150 printk(KERN_WARNING
153 "JBD: barrier-based sync failed on %s - " 151 "JBD: barrier-based sync failed on %s - "
154 "disabling barriers\n", 152 "disabling barriers\n", journal->j_devname);
155 bdevname(journal->j_dev, b));
156 spin_lock(&journal->j_state_lock); 153 spin_lock(&journal->j_state_lock);
157 journal->j_flags &= ~JBD2_BARRIER; 154 journal->j_flags &= ~JBD2_BARRIER;
158 spin_unlock(&journal->j_state_lock); 155 spin_unlock(&journal->j_state_lock);
@@ -681,11 +678,9 @@ start_journal_io:
681 */ 678 */
682 err = journal_finish_inode_data_buffers(journal, commit_transaction); 679 err = journal_finish_inode_data_buffers(journal, commit_transaction);
683 if (err) { 680 if (err) {
684 char b[BDEVNAME_SIZE];
685
686 printk(KERN_WARNING 681 printk(KERN_WARNING
687 "JBD2: Detected IO errors while flushing file data " 682 "JBD2: Detected IO errors while flushing file data "
688 "on %s\n", bdevname(journal->j_fs_dev, b)); 683 "on %s\n", journal->j_devname);
689 err = 0; 684 err = 0;
690 } 685 }
691 686