diff options
author | Joe Perches <joe@perches.com> | 2010-11-09 13:16:03 -0500 |
---|---|---|
committer | Jan Kara <jack@suse.cz> | 2011-01-06 05:52:14 -0500 |
commit | 23a2ad6d0e58d0f2fb1647c2d6fef935bcaf9299 (patch) | |
tree | f268f1676127a48dac66810c885d5e4801f305f7 /fs/ext2 | |
parent | 31d710a7bd42f0d89e30d53bdaad427c5f191d0d (diff) |
fs/ext2/super.c: Use printf extension %pV
Using %pV reduces the number of printk calls and
eliminates any possible message interleaving from
other printk calls.
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Jan Kara <jack@suse.cz>
Diffstat (limited to 'fs/ext2')
-rw-r--r-- | fs/ext2/super.c | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/fs/ext2/super.c b/fs/ext2/super.c index d89e0b6a2d78..27822b98f74d 100644 --- a/fs/ext2/super.c +++ b/fs/ext2/super.c | |||
@@ -43,9 +43,10 @@ static int ext2_remount (struct super_block * sb, int * flags, char * data); | |||
43 | static int ext2_statfs (struct dentry * dentry, struct kstatfs * buf); | 43 | static int ext2_statfs (struct dentry * dentry, struct kstatfs * buf); |
44 | static int ext2_sync_fs(struct super_block *sb, int wait); | 44 | static int ext2_sync_fs(struct super_block *sb, int wait); |
45 | 45 | ||
46 | void ext2_error (struct super_block * sb, const char * function, | 46 | void ext2_error(struct super_block *sb, const char *function, |
47 | const char * fmt, ...) | 47 | const char *fmt, ...) |
48 | { | 48 | { |
49 | struct va_format vaf; | ||
49 | va_list args; | 50 | va_list args; |
50 | struct ext2_sb_info *sbi = EXT2_SB(sb); | 51 | struct ext2_sb_info *sbi = EXT2_SB(sb); |
51 | struct ext2_super_block *es = sbi->s_es; | 52 | struct ext2_super_block *es = sbi->s_es; |
@@ -59,9 +60,13 @@ void ext2_error (struct super_block * sb, const char * function, | |||
59 | } | 60 | } |
60 | 61 | ||
61 | va_start(args, fmt); | 62 | va_start(args, fmt); |
62 | printk(KERN_CRIT "EXT2-fs (%s): error: %s: ", sb->s_id, function); | 63 | |
63 | vprintk(fmt, args); | 64 | vaf.fmt = fmt; |
64 | printk("\n"); | 65 | vaf.va = &args; |
66 | |||
67 | printk(KERN_CRIT "EXT2-fs (%s): error: %s: %pV\n", | ||
68 | sb->s_id, function, &vaf); | ||
69 | |||
65 | va_end(args); | 70 | va_end(args); |
66 | 71 | ||
67 | if (test_opt(sb, ERRORS_PANIC)) | 72 | if (test_opt(sb, ERRORS_PANIC)) |
@@ -76,12 +81,16 @@ void ext2_error (struct super_block * sb, const char * function, | |||
76 | void ext2_msg(struct super_block *sb, const char *prefix, | 81 | void ext2_msg(struct super_block *sb, const char *prefix, |
77 | const char *fmt, ...) | 82 | const char *fmt, ...) |
78 | { | 83 | { |
84 | struct va_format vaf; | ||
79 | va_list args; | 85 | va_list args; |
80 | 86 | ||
81 | va_start(args, fmt); | 87 | va_start(args, fmt); |
82 | printk("%sEXT2-fs (%s): ", prefix, sb->s_id); | 88 | |
83 | vprintk(fmt, args); | 89 | vaf.fmt = fmt; |
84 | printk("\n"); | 90 | vaf.va = &args; |
91 | |||
92 | printk("%sEXT2-fs (%s): %pV\n", prefix, sb->s_id, &vaf); | ||
93 | |||
85 | va_end(args); | 94 | va_end(args); |
86 | } | 95 | } |
87 | 96 | ||