diff options
author | Joe Perches <joe@perches.com> | 2010-12-19 22:43:19 -0500 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2010-12-19 22:43:19 -0500 |
commit | 0ff2ea7d84e31176a046a1eabea59d6e4eecd998 (patch) | |
tree | 6aafc9e97bc6fc15923039d0039c8acfd6311722 /fs/ext4/super.c | |
parent | 94de56ab2062be59d80e2efb7c0dc60ecf616075 (diff) |
ext4: Use printf extension %pV
Using %pV reduces the number of printk calls and eliminates any
possible message interleaving from other printk calls.
In function __ext4_grp_locked_error also added KERN_CONT to some
printks.
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'fs/ext4/super.c')
-rw-r--r-- | fs/ext4/super.c | 40 |
1 files changed, 23 insertions, 17 deletions
diff --git a/fs/ext4/super.c b/fs/ext4/super.c index 10290f8f5922..c228da112de0 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c | |||
@@ -388,13 +388,14 @@ static void ext4_handle_error(struct super_block *sb) | |||
388 | void __ext4_error(struct super_block *sb, const char *function, | 388 | void __ext4_error(struct super_block *sb, const char *function, |
389 | unsigned int line, const char *fmt, ...) | 389 | unsigned int line, const char *fmt, ...) |
390 | { | 390 | { |
391 | struct va_format vaf; | ||
391 | va_list args; | 392 | va_list args; |
392 | 393 | ||
393 | va_start(args, fmt); | 394 | va_start(args, fmt); |
394 | printk(KERN_CRIT "EXT4-fs error (device %s): %s:%d: comm %s: ", | 395 | vaf.fmt = fmt; |
395 | sb->s_id, function, line, current->comm); | 396 | vaf.va = &args; |
396 | vprintk(fmt, args); | 397 | printk(KERN_CRIT "EXT4-fs error (device %s): %s:%d: comm %s: %pV\n", |
397 | printk("\n"); | 398 | sb->s_id, function, line, current->comm, &vaf); |
398 | va_end(args); | 399 | va_end(args); |
399 | 400 | ||
400 | ext4_handle_error(sb); | 401 | ext4_handle_error(sb); |
@@ -543,28 +544,29 @@ void __ext4_abort(struct super_block *sb, const char *function, | |||
543 | panic("EXT4-fs panic from previous error\n"); | 544 | panic("EXT4-fs panic from previous error\n"); |
544 | } | 545 | } |
545 | 546 | ||
546 | void ext4_msg (struct super_block * sb, const char *prefix, | 547 | void ext4_msg(struct super_block *sb, const char *prefix, const char *fmt, ...) |
547 | const char *fmt, ...) | ||
548 | { | 548 | { |
549 | struct va_format vaf; | ||
549 | va_list args; | 550 | va_list args; |
550 | 551 | ||
551 | va_start(args, fmt); | 552 | va_start(args, fmt); |
552 | printk("%sEXT4-fs (%s): ", prefix, sb->s_id); | 553 | vaf.fmt = fmt; |
553 | vprintk(fmt, args); | 554 | vaf.va = &args; |
554 | printk("\n"); | 555 | printk("%sEXT4-fs (%s): %pV\n", prefix, sb->s_id, &vaf); |
555 | va_end(args); | 556 | va_end(args); |
556 | } | 557 | } |
557 | 558 | ||
558 | void __ext4_warning(struct super_block *sb, const char *function, | 559 | void __ext4_warning(struct super_block *sb, const char *function, |
559 | unsigned int line, const char *fmt, ...) | 560 | unsigned int line, const char *fmt, ...) |
560 | { | 561 | { |
562 | struct va_format vaf; | ||
561 | va_list args; | 563 | va_list args; |
562 | 564 | ||
563 | va_start(args, fmt); | 565 | va_start(args, fmt); |
564 | printk(KERN_WARNING "EXT4-fs warning (device %s): %s:%d: ", | 566 | vaf.fmt = fmt; |
565 | sb->s_id, function, line); | 567 | vaf.va = &args; |
566 | vprintk(fmt, args); | 568 | printk(KERN_WARNING "EXT4-fs warning (device %s): %s:%d: %pV\n", |
567 | printk("\n"); | 569 | sb->s_id, function, line, &vaf); |
568 | va_end(args); | 570 | va_end(args); |
569 | } | 571 | } |
570 | 572 | ||
@@ -575,21 +577,25 @@ void __ext4_grp_locked_error(const char *function, unsigned int line, | |||
575 | __releases(bitlock) | 577 | __releases(bitlock) |
576 | __acquires(bitlock) | 578 | __acquires(bitlock) |
577 | { | 579 | { |
580 | struct va_format vaf; | ||
578 | va_list args; | 581 | va_list args; |
579 | struct ext4_super_block *es = EXT4_SB(sb)->s_es; | 582 | struct ext4_super_block *es = EXT4_SB(sb)->s_es; |
580 | 583 | ||
581 | es->s_last_error_ino = cpu_to_le32(ino); | 584 | es->s_last_error_ino = cpu_to_le32(ino); |
582 | es->s_last_error_block = cpu_to_le64(block); | 585 | es->s_last_error_block = cpu_to_le64(block); |
583 | __save_error_info(sb, function, line); | 586 | __save_error_info(sb, function, line); |
587 | |||
584 | va_start(args, fmt); | 588 | va_start(args, fmt); |
589 | |||
590 | vaf.fmt = fmt; | ||
591 | vaf.va = &args; | ||
585 | printk(KERN_CRIT "EXT4-fs error (device %s): %s:%d: group %u", | 592 | printk(KERN_CRIT "EXT4-fs error (device %s): %s:%d: group %u", |
586 | sb->s_id, function, line, grp); | 593 | sb->s_id, function, line, grp); |
587 | if (ino) | 594 | if (ino) |
588 | printk("inode %lu: ", ino); | 595 | printk(KERN_CONT "inode %lu: ", ino); |
589 | if (block) | 596 | if (block) |
590 | printk("block %llu:", (unsigned long long) block); | 597 | printk(KERN_CONT "block %llu:", (unsigned long long) block); |
591 | vprintk(fmt, args); | 598 | printk(KERN_CONT "%pV\n", &vaf); |
592 | printk("\n"); | ||
593 | va_end(args); | 599 | va_end(args); |
594 | 600 | ||
595 | if (test_opt(sb, ERRORS_CONT)) { | 601 | if (test_opt(sb, ERRORS_CONT)) { |