Commit 99fbb1e2 authored by Joe Perches's avatar Joe Perches Committed by Jan Kara

fs/ext3/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: default avatarJoe Perches <joe@perches.com>
Signed-off-by: default avatarJan Kara <jack@suse.cz>
parent 23a2ad6d
...@@ -143,12 +143,16 @@ void ext3_journal_abort_handle(const char *caller, const char *err_fn, ...@@ -143,12 +143,16 @@ void ext3_journal_abort_handle(const char *caller, const char *err_fn,
void ext3_msg(struct super_block *sb, const char *prefix, void ext3_msg(struct super_block *sb, const char *prefix,
const char *fmt, ...) const char *fmt, ...)
{ {
struct va_format vaf;
va_list args; va_list args;
va_start(args, fmt); va_start(args, fmt);
printk("%sEXT3-fs (%s): ", prefix, sb->s_id);
vprintk(fmt, args); vaf.fmt = fmt;
printk("\n"); vaf.va = &args;
printk("%sEXT3-fs (%s): %pV\n", prefix, sb->s_id, &vaf);
va_end(args); va_end(args);
} }
...@@ -195,15 +199,20 @@ static void ext3_handle_error(struct super_block *sb) ...@@ -195,15 +199,20 @@ static void ext3_handle_error(struct super_block *sb)
sb->s_id); sb->s_id);
} }
void ext3_error (struct super_block * sb, const char * function, void ext3_error(struct super_block *sb, const char *function,
const char * fmt, ...) const char *fmt, ...)
{ {
struct va_format vaf;
va_list args; va_list args;
va_start(args, fmt); va_start(args, fmt);
printk(KERN_CRIT "EXT3-fs error (device %s): %s: ",sb->s_id, function);
vprintk(fmt, args); vaf.fmt = fmt;
printk("\n"); vaf.va = &args;
printk(KERN_CRIT "EXT3-fs error (device %s): %s: %pV\n",
sb->s_id, function, &vaf);
va_end(args); va_end(args);
ext3_handle_error(sb); ext3_handle_error(sb);
...@@ -274,15 +283,20 @@ void __ext3_std_error (struct super_block * sb, const char * function, ...@@ -274,15 +283,20 @@ void __ext3_std_error (struct super_block * sb, const char * function,
* case we take the easy way out and panic immediately. * case we take the easy way out and panic immediately.
*/ */
void ext3_abort (struct super_block * sb, const char * function, void ext3_abort(struct super_block *sb, const char *function,
const char * fmt, ...) const char *fmt, ...)
{ {
struct va_format vaf;
va_list args; va_list args;
va_start(args, fmt); va_start(args, fmt);
printk(KERN_CRIT "EXT3-fs (%s): error: %s: ", sb->s_id, function);
vprintk(fmt, args); vaf.fmt = fmt;
printk("\n"); vaf.va = &args;
printk(KERN_CRIT "EXT3-fs (%s): error: %s: %pV\n",
sb->s_id, function, &vaf);
va_end(args); va_end(args);
if (test_opt(sb, ERRORS_PANIC)) if (test_opt(sb, ERRORS_PANIC))
...@@ -300,16 +314,20 @@ void ext3_abort (struct super_block * sb, const char * function, ...@@ -300,16 +314,20 @@ void ext3_abort (struct super_block * sb, const char * function,
journal_abort(EXT3_SB(sb)->s_journal, -EIO); journal_abort(EXT3_SB(sb)->s_journal, -EIO);
} }
void ext3_warning (struct super_block * sb, const char * function, void ext3_warning(struct super_block *sb, const char *function,
const char * fmt, ...) const char *fmt, ...)
{ {
struct va_format vaf;
va_list args; va_list args;
va_start(args, fmt); va_start(args, fmt);
printk(KERN_WARNING "EXT3-fs (%s): warning: %s: ",
sb->s_id, function); vaf.fmt = fmt;
vprintk(fmt, args); vaf.va = &args;
printk("\n");
printk(KERN_WARNING "EXT3-fs (%s): warning: %s: %pV\n",
sb->s_id, function, &vaf);
va_end(args); va_end(args);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment