aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ext4
diff options
context:
space:
mode:
authorTheodore Ts'o <tytso@mit.edu>2012-03-19 23:41:49 -0400
committerTheodore Ts'o <tytso@mit.edu>2012-03-19 23:41:49 -0400
commit92b9781658dba287a1354ad74ed351f68c3ee740 (patch)
tree1dc2a11343544374321bf18340b0bf886c898f97 /fs/ext4
parentd9ee81da93e86ac45aef30b2493a1e68fc71b9d0 (diff)
ext4: change some printk() calls to use ext4_msg() instead
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'fs/ext4')
-rw-r--r--fs/ext4/dir.c5
-rw-r--r--fs/ext4/extents.c19
-rw-r--r--fs/ext4/ialloc.c19
-rw-r--r--fs/ext4/inode.c23
-rw-r--r--fs/ext4/resize.c19
-rw-r--r--fs/ext4/super.c4
6 files changed, 48 insertions, 41 deletions
diff --git a/fs/ext4/dir.c b/fs/ext4/dir.c
index a4a0234cb5cb..ad56866d729a 100644
--- a/fs/ext4/dir.c
+++ b/fs/ext4/dir.c
@@ -425,8 +425,9 @@ static int call_filldir(struct file *filp, void *dirent,
425 sb = inode->i_sb; 425 sb = inode->i_sb;
426 426
427 if (!fname) { 427 if (!fname) {
428 printk(KERN_ERR "EXT4-fs: call_filldir: called with " 428 ext4_msg(sb, KERN_ERR, "%s:%d: inode #%lu: comm %s: "
429 "null fname?!?\n"); 429 "called with null fname?!?", __func__, __LINE__,
430 inode->i_ino, current->comm);
430 return 0; 431 return 0;
431 } 432 }
432 curr_pos = hash2pos(fname->hash, fname->minor_hash); 433 curr_pos = hash2pos(fname->hash, fname->minor_hash);
diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
index 5c9c067abca0..d075f34f9bae 100644
--- a/fs/ext4/extents.c
+++ b/fs/ext4/extents.c
@@ -2728,17 +2728,17 @@ void ext4_ext_init(struct super_block *sb)
2728 2728
2729 if (EXT4_HAS_INCOMPAT_FEATURE(sb, EXT4_FEATURE_INCOMPAT_EXTENTS)) { 2729 if (EXT4_HAS_INCOMPAT_FEATURE(sb, EXT4_FEATURE_INCOMPAT_EXTENTS)) {
2730#if defined(AGGRESSIVE_TEST) || defined(CHECK_BINSEARCH) || defined(EXTENTS_STATS) 2730#if defined(AGGRESSIVE_TEST) || defined(CHECK_BINSEARCH) || defined(EXTENTS_STATS)
2731 printk(KERN_INFO "EXT4-fs: file extents enabled"); 2731 printk(KERN_INFO "EXT4-fs: file extents enabled"
2732#ifdef AGGRESSIVE_TEST 2732#ifdef AGGRESSIVE_TEST
2733 printk(", aggressive tests"); 2733 ", aggressive tests"
2734#endif 2734#endif
2735#ifdef CHECK_BINSEARCH 2735#ifdef CHECK_BINSEARCH
2736 printk(", check binsearch"); 2736 ", check binsearch"
2737#endif 2737#endif
2738#ifdef EXTENTS_STATS 2738#ifdef EXTENTS_STATS
2739 printk(", stats"); 2739 ", stats"
2740#endif 2740#endif
2741 printk("\n"); 2741 "\n");
2742#endif 2742#endif
2743#ifdef EXTENTS_STATS 2743#ifdef EXTENTS_STATS
2744 spin_lock_init(&EXT4_SB(sb)->s_ext_stats_lock); 2744 spin_lock_init(&EXT4_SB(sb)->s_ext_stats_lock);
@@ -4412,10 +4412,11 @@ int ext4_convert_unwritten_extents(struct inode *inode, loff_t offset,
4412 EXT4_GET_BLOCKS_IO_CONVERT_EXT); 4412 EXT4_GET_BLOCKS_IO_CONVERT_EXT);
4413 if (ret <= 0) { 4413 if (ret <= 0) {
4414 WARN_ON(ret <= 0); 4414 WARN_ON(ret <= 0);
4415 printk(KERN_ERR "%s: ext4_ext_map_blocks " 4415 ext4_msg(inode->i_sb, KERN_ERR,
4416 "returned error inode#%lu, block=%u, " 4416 "%s:%d: inode #%lu: block %u: len %u: "
4417 "max_blocks=%u", __func__, 4417 "ext4_ext_map_blocks returned %d",
4418 inode->i_ino, map.m_lblk, map.m_len); 4418 __func__, __LINE__, inode->i_ino, map.m_lblk,
4419 map.m_len, ret);
4419 } 4420 }
4420 ext4_mark_inode_dirty(handle, inode); 4421 ext4_mark_inode_dirty(handle, inode);
4421 ret2 = ext4_journal_stop(handle); 4422 ret2 = ext4_journal_stop(handle);
diff --git a/fs/ext4/ialloc.c b/fs/ext4/ialloc.c
index 75e2eae74cd1..409c2ee7750a 100644
--- a/fs/ext4/ialloc.c
+++ b/fs/ext4/ialloc.c
@@ -204,19 +204,20 @@ void ext4_free_inode(handle_t *handle, struct inode *inode)
204 struct ext4_sb_info *sbi; 204 struct ext4_sb_info *sbi;
205 int fatal = 0, err, count, cleared; 205 int fatal = 0, err, count, cleared;
206 206
207 if (atomic_read(&inode->i_count) > 1) { 207 if (!sb) {
208 printk(KERN_ERR "ext4_free_inode: inode has count=%d\n", 208 printk(KERN_ERR "EXT4-fs: %s:%d: inode on "
209 atomic_read(&inode->i_count)); 209 "nonexistent device\n", __func__, __LINE__);
210 return; 210 return;
211 } 211 }
212 if (inode->i_nlink) { 212 if (atomic_read(&inode->i_count) > 1) {
213 printk(KERN_ERR "ext4_free_inode: inode has nlink=%d\n", 213 ext4_msg(sb, KERN_ERR, "%s:%d: inode #%lu: count=%d",
214 inode->i_nlink); 214 __func__, __LINE__, inode->i_ino,
215 atomic_read(&inode->i_count));
215 return; 216 return;
216 } 217 }
217 if (!sb) { 218 if (inode->i_nlink) {
218 printk(KERN_ERR "ext4_free_inode: inode on " 219 ext4_msg(sb, KERN_ERR, "%s:%d: inode #%lu: nlink=%d\n",
219 "nonexistent device\n"); 220 __func__, __LINE__, inode->i_ino, inode->i_nlink);
220 return; 221 return;
221 } 222 }
222 sbi = EXT4_SB(sb); 223 sbi = EXT4_SB(sb);
diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
index a11264ebd1f3..83a2daeb813c 100644
--- a/fs/ext4/inode.c
+++ b/fs/ext4/inode.c
@@ -1428,20 +1428,22 @@ static void ext4_da_block_invalidatepages(struct mpage_da_data *mpd)
1428static void ext4_print_free_blocks(struct inode *inode) 1428static void ext4_print_free_blocks(struct inode *inode)
1429{ 1429{
1430 struct ext4_sb_info *sbi = EXT4_SB(inode->i_sb); 1430 struct ext4_sb_info *sbi = EXT4_SB(inode->i_sb);
1431 printk(KERN_CRIT "Total free blocks count %lld\n", 1431 struct super_block *sb = inode->i_sb;
1432
1433 ext4_msg(sb, KERN_CRIT, "Total free blocks count %lld",
1432 EXT4_C2B(EXT4_SB(inode->i_sb), 1434 EXT4_C2B(EXT4_SB(inode->i_sb),
1433 ext4_count_free_clusters(inode->i_sb))); 1435 ext4_count_free_clusters(inode->i_sb)));
1434 printk(KERN_CRIT "Free/Dirty block details\n"); 1436 ext4_msg(sb, KERN_CRIT, "Free/Dirty block details");
1435 printk(KERN_CRIT "free_blocks=%lld\n", 1437 ext4_msg(sb, KERN_CRIT, "free_blocks=%lld",
1436 (long long) EXT4_C2B(EXT4_SB(inode->i_sb), 1438 (long long) EXT4_C2B(EXT4_SB(inode->i_sb),
1437 percpu_counter_sum(&sbi->s_freeclusters_counter))); 1439 percpu_counter_sum(&sbi->s_freeclusters_counter)));
1438 printk(KERN_CRIT "dirty_blocks=%lld\n", 1440 ext4_msg(sb, KERN_CRIT, "dirty_blocks=%lld",
1439 (long long) EXT4_C2B(EXT4_SB(inode->i_sb), 1441 (long long) EXT4_C2B(EXT4_SB(inode->i_sb),
1440 percpu_counter_sum(&sbi->s_dirtyclusters_counter))); 1442 percpu_counter_sum(&sbi->s_dirtyclusters_counter)));
1441 printk(KERN_CRIT "Block reservation details\n"); 1443 ext4_msg(sb, KERN_CRIT, "Block reservation details");
1442 printk(KERN_CRIT "i_reserved_data_blocks=%u\n", 1444 ext4_msg(sb, KERN_CRIT, "i_reserved_data_blocks=%u",
1443 EXT4_I(inode)->i_reserved_data_blocks); 1445 EXT4_I(inode)->i_reserved_data_blocks);
1444 printk(KERN_CRIT "i_reserved_meta_blocks=%u\n", 1446 ext4_msg(sb, KERN_CRIT, "i_reserved_meta_blocks=%u",
1445 EXT4_I(inode)->i_reserved_meta_blocks); 1447 EXT4_I(inode)->i_reserved_meta_blocks);
1446 return; 1448 return;
1447} 1449}
@@ -2809,8 +2811,9 @@ static void ext4_end_io_buffer_write(struct buffer_head *bh, int uptodate)
2809 goto out; 2811 goto out;
2810 2812
2811 if (!(io_end->inode->i_sb->s_flags & MS_ACTIVE)) { 2813 if (!(io_end->inode->i_sb->s_flags & MS_ACTIVE)) {
2812 printk("sb umounted, discard end_io request for inode %lu\n", 2814 ext4_msg(io_end->inode->i_sb, KERN_INFO,
2813 io_end->inode->i_ino); 2815 "sb umounted, discard end_io request for inode %lu",
2816 io_end->inode->i_ino);
2814 ext4_free_io_end(io_end); 2817 ext4_free_io_end(io_end);
2815 goto out; 2818 goto out;
2816 } 2819 }
diff --git a/fs/ext4/resize.c b/fs/ext4/resize.c
index 3fed79da0d2c..b6ad461930ca 100644
--- a/fs/ext4/resize.c
+++ b/fs/ext4/resize.c
@@ -1512,16 +1512,17 @@ int ext4_group_extend(struct super_block *sb, struct ext4_super_block *es,
1512 o_blocks_count = ext4_blocks_count(es); 1512 o_blocks_count = ext4_blocks_count(es);
1513 1513
1514 if (test_opt(sb, DEBUG)) 1514 if (test_opt(sb, DEBUG))
1515 printk(KERN_DEBUG "EXT4-fs: extending last group from %llu to %llu blocks\n", 1515 ext4_msg(sb, KERN_DEBUG,
1516 o_blocks_count, n_blocks_count); 1516 "extending last group from %llu to %llu blocks",
1517 o_blocks_count, n_blocks_count);
1517 1518
1518 if (n_blocks_count == 0 || n_blocks_count == o_blocks_count) 1519 if (n_blocks_count == 0 || n_blocks_count == o_blocks_count)
1519 return 0; 1520 return 0;
1520 1521
1521 if (n_blocks_count > (sector_t)(~0ULL) >> (sb->s_blocksize_bits - 9)) { 1522 if (n_blocks_count > (sector_t)(~0ULL) >> (sb->s_blocksize_bits - 9)) {
1522 printk(KERN_ERR "EXT4-fs: filesystem on %s:" 1523 ext4_msg(sb, KERN_ERR,
1523 " too large to resize to %llu blocks safely\n", 1524 "filesystem too large to resize to %llu blocks safely",
1524 sb->s_id, n_blocks_count); 1525 n_blocks_count);
1525 if (sizeof(sector_t) < 8) 1526 if (sizeof(sector_t) < 8)
1526 ext4_warning(sb, "CONFIG_LBDAF not enabled"); 1527 ext4_warning(sb, "CONFIG_LBDAF not enabled");
1527 return -EINVAL; 1528 return -EINVAL;
@@ -1591,8 +1592,8 @@ int ext4_resize_fs(struct super_block *sb, ext4_fsblk_t n_blocks_count)
1591 o_blocks_count = ext4_blocks_count(es); 1592 o_blocks_count = ext4_blocks_count(es);
1592 1593
1593 if (test_opt(sb, DEBUG)) 1594 if (test_opt(sb, DEBUG))
1594 printk(KERN_DEBUG "EXT4-fs: resizing filesystem from %llu " 1595 ext4_msg(sb, KERN_DEBUG, "resizing filesystem from %llu "
1595 "upto %llu blocks\n", o_blocks_count, n_blocks_count); 1596 "to %llu blocks", o_blocks_count, n_blocks_count);
1596 1597
1597 if (n_blocks_count < o_blocks_count) { 1598 if (n_blocks_count < o_blocks_count) {
1598 /* On-line shrinking not supported */ 1599 /* On-line shrinking not supported */
@@ -1676,7 +1677,7 @@ out:
1676 1677
1677 iput(resize_inode); 1678 iput(resize_inode);
1678 if (test_opt(sb, DEBUG)) 1679 if (test_opt(sb, DEBUG))
1679 printk(KERN_DEBUG "EXT4-fs: resized filesystem from %llu " 1680 ext4_msg(sb, KERN_DEBUG, "resized filesystem from %llu "
1680 "upto %llu blocks\n", o_blocks_count, n_blocks_count); 1681 "upto %llu blocks", o_blocks_count, n_blocks_count);
1681 return err; 1682 return err;
1682} 1683}
diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index 11dfaad232cf..1e26f4a0b555 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -376,7 +376,7 @@ void ext4_journal_abort_handle(const char *caller, unsigned int line,
376 if (is_handle_aborted(handle)) 376 if (is_handle_aborted(handle))
377 return; 377 return;
378 378
379 printk(KERN_ERR "%s:%d: aborting transaction: %s in %s\n", 379 printk(KERN_ERR "EXT4-fs: %s:%d: aborting transaction: %s in %s\n",
380 caller, line, errstr, err_fn); 380 caller, line, errstr, err_fn);
381 381
382 jbd2_journal_abort_handle(handle); 382 jbd2_journal_abort_handle(handle);
@@ -2809,7 +2809,7 @@ static int ext4_run_lazyinit_thread(void)
2809 ext4_clear_request_list(); 2809 ext4_clear_request_list();
2810 kfree(ext4_li_info); 2810 kfree(ext4_li_info);
2811 ext4_li_info = NULL; 2811 ext4_li_info = NULL;
2812 printk(KERN_CRIT "EXT4: error %d creating inode table " 2812 printk(KERN_CRIT "EXT4-fs: error %d creating inode table "
2813 "initialization thread\n", 2813 "initialization thread\n",
2814 err); 2814 err);
2815 return err; 2815 return err;