Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 92b97816 authored by Theodore Ts'o's avatar Theodore Ts'o
Browse files

ext4: change some printk() calls to use ext4_msg() instead



Signed-off-by: default avatar"Theodore Ts'o" <tytso@mit.edu>
parent d9ee81da
Loading
Loading
Loading
Loading
+3 −2
Original line number Original line Diff line number Diff line
@@ -425,8 +425,9 @@ static int call_filldir(struct file *filp, void *dirent,
	sb = inode->i_sb;
	sb = inode->i_sb;


	if (!fname) {
	if (!fname) {
		printk(KERN_ERR "EXT4-fs: call_filldir: called with "
		ext4_msg(sb, KERN_ERR, "%s:%d: inode #%lu: comm %s: "
		       "null fname?!?\n");
			 "called with null fname?!?", __func__, __LINE__,
			 inode->i_ino, current->comm);
		return 0;
		return 0;
	}
	}
	curr_pos = hash2pos(fname->hash, fname->minor_hash);
	curr_pos = hash2pos(fname->hash, fname->minor_hash);
+10 −9
Original line number Original line Diff line number Diff line
@@ -2728,17 +2728,17 @@ void ext4_ext_init(struct super_block *sb)


	if (EXT4_HAS_INCOMPAT_FEATURE(sb, EXT4_FEATURE_INCOMPAT_EXTENTS)) {
	if (EXT4_HAS_INCOMPAT_FEATURE(sb, EXT4_FEATURE_INCOMPAT_EXTENTS)) {
#if defined(AGGRESSIVE_TEST) || defined(CHECK_BINSEARCH) || defined(EXTENTS_STATS)
#if defined(AGGRESSIVE_TEST) || defined(CHECK_BINSEARCH) || defined(EXTENTS_STATS)
		printk(KERN_INFO "EXT4-fs: file extents enabled");
		printk(KERN_INFO "EXT4-fs: file extents enabled"
#ifdef AGGRESSIVE_TEST
#ifdef AGGRESSIVE_TEST
		printk(", aggressive tests");
		       ", aggressive tests"
#endif
#endif
#ifdef CHECK_BINSEARCH
#ifdef CHECK_BINSEARCH
		printk(", check binsearch");
		       ", check binsearch"
#endif
#endif
#ifdef EXTENTS_STATS
#ifdef EXTENTS_STATS
		printk(", stats");
		       ", stats"
#endif
#endif
		printk("\n");
		       "\n");
#endif
#endif
#ifdef EXTENTS_STATS
#ifdef EXTENTS_STATS
		spin_lock_init(&EXT4_SB(sb)->s_ext_stats_lock);
		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,
				      EXT4_GET_BLOCKS_IO_CONVERT_EXT);
				      EXT4_GET_BLOCKS_IO_CONVERT_EXT);
		if (ret <= 0) {
		if (ret <= 0) {
			WARN_ON(ret <= 0);
			WARN_ON(ret <= 0);
			printk(KERN_ERR "%s: ext4_ext_map_blocks "
			ext4_msg(inode->i_sb, KERN_ERR,
				    "returned error inode#%lu, block=%u, "
				 "%s:%d: inode #%lu: block %u: len %u: "
				    "max_blocks=%u", __func__,
				 "ext4_ext_map_blocks returned %d",
				    inode->i_ino, map.m_lblk, map.m_len);
				 __func__, __LINE__, inode->i_ino, map.m_lblk,
				 map.m_len, ret);
		}
		}
		ext4_mark_inode_dirty(handle, inode);
		ext4_mark_inode_dirty(handle, inode);
		ret2 = ext4_journal_stop(handle);
		ret2 = ext4_journal_stop(handle);
+10 −9
Original line number Original line Diff line number Diff line
@@ -204,19 +204,20 @@ void ext4_free_inode(handle_t *handle, struct inode *inode)
	struct ext4_sb_info *sbi;
	struct ext4_sb_info *sbi;
	int fatal = 0, err, count, cleared;
	int fatal = 0, err, count, cleared;


	if (!sb) {
		printk(KERN_ERR "EXT4-fs: %s:%d: inode on "
		       "nonexistent device\n", __func__, __LINE__);
		return;
	}
	if (atomic_read(&inode->i_count) > 1) {
	if (atomic_read(&inode->i_count) > 1) {
		printk(KERN_ERR "ext4_free_inode: inode has count=%d\n",
		ext4_msg(sb, KERN_ERR, "%s:%d: inode #%lu: count=%d",
			 __func__, __LINE__, inode->i_ino,
			 atomic_read(&inode->i_count));
			 atomic_read(&inode->i_count));
		return;
		return;
	}
	}
	if (inode->i_nlink) {
	if (inode->i_nlink) {
		printk(KERN_ERR "ext4_free_inode: inode has nlink=%d\n",
		ext4_msg(sb, KERN_ERR, "%s:%d: inode #%lu: nlink=%d\n",
		       inode->i_nlink);
			 __func__, __LINE__, inode->i_ino, inode->i_nlink);
		return;
	}
	if (!sb) {
		printk(KERN_ERR "ext4_free_inode: inode on "
		       "nonexistent device\n");
		return;
		return;
	}
	}
	sbi = EXT4_SB(sb);
	sbi = EXT4_SB(sb);
+13 −10
Original line number Original line Diff line number Diff line
@@ -1428,20 +1428,22 @@ static void ext4_da_block_invalidatepages(struct mpage_da_data *mpd)
static void ext4_print_free_blocks(struct inode *inode)
static void ext4_print_free_blocks(struct inode *inode)
{
{
	struct ext4_sb_info *sbi = EXT4_SB(inode->i_sb);
	struct ext4_sb_info *sbi = EXT4_SB(inode->i_sb);
	printk(KERN_CRIT "Total free blocks count %lld\n",
	struct super_block *sb = inode->i_sb;

	ext4_msg(sb, KERN_CRIT, "Total free blocks count %lld",
	       EXT4_C2B(EXT4_SB(inode->i_sb),
	       EXT4_C2B(EXT4_SB(inode->i_sb),
			ext4_count_free_clusters(inode->i_sb)));
			ext4_count_free_clusters(inode->i_sb)));
	printk(KERN_CRIT "Free/Dirty block details\n");
	ext4_msg(sb, KERN_CRIT, "Free/Dirty block details");
	printk(KERN_CRIT "free_blocks=%lld\n",
	ext4_msg(sb, KERN_CRIT, "free_blocks=%lld",
	       (long long) EXT4_C2B(EXT4_SB(inode->i_sb),
	       (long long) EXT4_C2B(EXT4_SB(inode->i_sb),
		percpu_counter_sum(&sbi->s_freeclusters_counter)));
		percpu_counter_sum(&sbi->s_freeclusters_counter)));
	printk(KERN_CRIT "dirty_blocks=%lld\n",
	ext4_msg(sb, KERN_CRIT, "dirty_blocks=%lld",
	       (long long) EXT4_C2B(EXT4_SB(inode->i_sb),
	       (long long) EXT4_C2B(EXT4_SB(inode->i_sb),
		percpu_counter_sum(&sbi->s_dirtyclusters_counter)));
		percpu_counter_sum(&sbi->s_dirtyclusters_counter)));
	printk(KERN_CRIT "Block reservation details\n");
	ext4_msg(sb, KERN_CRIT, "Block reservation details");
	printk(KERN_CRIT "i_reserved_data_blocks=%u\n",
	ext4_msg(sb, KERN_CRIT, "i_reserved_data_blocks=%u",
		 EXT4_I(inode)->i_reserved_data_blocks);
		 EXT4_I(inode)->i_reserved_data_blocks);
	printk(KERN_CRIT "i_reserved_meta_blocks=%u\n",
	ext4_msg(sb, KERN_CRIT, "i_reserved_meta_blocks=%u",
	       EXT4_I(inode)->i_reserved_meta_blocks);
	       EXT4_I(inode)->i_reserved_meta_blocks);
	return;
	return;
}
}
@@ -2809,7 +2811,8 @@ static void ext4_end_io_buffer_write(struct buffer_head *bh, int uptodate)
		goto out;
		goto out;


	if (!(io_end->inode->i_sb->s_flags & MS_ACTIVE)) {
	if (!(io_end->inode->i_sb->s_flags & MS_ACTIVE)) {
		printk("sb umounted, discard end_io request for inode %lu\n",
		ext4_msg(io_end->inode->i_sb, KERN_INFO,
			 "sb umounted, discard end_io request for inode %lu",
			 io_end->inode->i_ino);
			 io_end->inode->i_ino);
		ext4_free_io_end(io_end);
		ext4_free_io_end(io_end);
		goto out;
		goto out;
+10 −9
Original line number Original line Diff line number Diff line
@@ -1512,16 +1512,17 @@ int ext4_group_extend(struct super_block *sb, struct ext4_super_block *es,
	o_blocks_count = ext4_blocks_count(es);
	o_blocks_count = ext4_blocks_count(es);


	if (test_opt(sb, DEBUG))
	if (test_opt(sb, DEBUG))
		printk(KERN_DEBUG "EXT4-fs: extending last group from %llu to %llu blocks\n",
		ext4_msg(sb, KERN_DEBUG,
			 "extending last group from %llu to %llu blocks",
			 o_blocks_count, n_blocks_count);
			 o_blocks_count, n_blocks_count);


	if (n_blocks_count == 0 || n_blocks_count == o_blocks_count)
	if (n_blocks_count == 0 || n_blocks_count == o_blocks_count)
		return 0;
		return 0;


	if (n_blocks_count > (sector_t)(~0ULL) >> (sb->s_blocksize_bits - 9)) {
	if (n_blocks_count > (sector_t)(~0ULL) >> (sb->s_blocksize_bits - 9)) {
		printk(KERN_ERR "EXT4-fs: filesystem on %s:"
		ext4_msg(sb, KERN_ERR,
			" too large to resize to %llu blocks safely\n",
			 "filesystem too large to resize to %llu blocks safely",
			sb->s_id, n_blocks_count);
			 n_blocks_count);
		if (sizeof(sector_t) < 8)
		if (sizeof(sector_t) < 8)
			ext4_warning(sb, "CONFIG_LBDAF not enabled");
			ext4_warning(sb, "CONFIG_LBDAF not enabled");
		return -EINVAL;
		return -EINVAL;
@@ -1591,8 +1592,8 @@ int ext4_resize_fs(struct super_block *sb, ext4_fsblk_t n_blocks_count)
	o_blocks_count = ext4_blocks_count(es);
	o_blocks_count = ext4_blocks_count(es);


	if (test_opt(sb, DEBUG))
	if (test_opt(sb, DEBUG))
		printk(KERN_DEBUG "EXT4-fs: resizing filesystem from %llu "
		ext4_msg(sb, KERN_DEBUG, "resizing filesystem from %llu "
		       "upto %llu blocks\n", o_blocks_count, n_blocks_count);
		       "to %llu blocks", o_blocks_count, n_blocks_count);


	if (n_blocks_count < o_blocks_count) {
	if (n_blocks_count < o_blocks_count) {
		/* On-line shrinking not supported */
		/* On-line shrinking not supported */
@@ -1676,7 +1677,7 @@ out:


	iput(resize_inode);
	iput(resize_inode);
	if (test_opt(sb, DEBUG))
	if (test_opt(sb, DEBUG))
		printk(KERN_DEBUG "EXT4-fs: resized filesystem from %llu "
		ext4_msg(sb, KERN_DEBUG, "resized filesystem from %llu "
		       "upto %llu blocks\n", o_blocks_count, n_blocks_count);
		       "upto %llu blocks", o_blocks_count, n_blocks_count);
	return err;
	return err;
}
}
Loading