diff options
author | Joe Perches <joe@perches.com> | 2015-04-14 18:43:46 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2015-04-14 19:48:58 -0400 |
commit | 1543306e75ee40662b2c6d37c43c8659f3d6f880 (patch) | |
tree | d35d258cd98eea1c568210f1fb60acf25a4be2b6 /fs/ocfs2 | |
parent | e2ac55b6a8e337fac7cc59c6f452caac92ab5ee6 (diff) |
ocfs2: logging: remove static buffer, use vsprintf extension %pV
Use the vsprintf %pV extension to avoid using a static buffer and remove
the now unnecessary buffer.
Signed-off-by: Joe Perches <joe@perches.com>
Cc: Mark Fasheh <mfasheh@suse.com>
Cc: Joel Becker <jlbec@evilplan.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/ocfs2')
-rw-r--r-- | fs/ocfs2/super.c | 33 |
1 files changed, 18 insertions, 15 deletions
diff --git a/fs/ocfs2/super.c b/fs/ocfs2/super.c index fb43de586791..c558bff99165 100644 --- a/fs/ocfs2/super.c +++ b/fs/ocfs2/super.c | |||
@@ -2564,22 +2564,22 @@ static void ocfs2_handle_error(struct super_block *sb) | |||
2564 | ocfs2_set_ro_flag(osb, 0); | 2564 | ocfs2_set_ro_flag(osb, 0); |
2565 | } | 2565 | } |
2566 | 2566 | ||
2567 | static char error_buf[1024]; | 2567 | void __ocfs2_error(struct super_block *sb, const char *function, |
2568 | 2568 | const char *fmt, ...) | |
2569 | void __ocfs2_error(struct super_block *sb, | ||
2570 | const char *function, | ||
2571 | const char *fmt, ...) | ||
2572 | { | 2569 | { |
2570 | struct va_format vaf; | ||
2573 | va_list args; | 2571 | va_list args; |
2574 | 2572 | ||
2575 | va_start(args, fmt); | 2573 | va_start(args, fmt); |
2576 | vsnprintf(error_buf, sizeof(error_buf), fmt, args); | 2574 | vaf.fmt = fmt; |
2577 | va_end(args); | 2575 | vaf.va = &args; |
2578 | 2576 | ||
2579 | /* Not using mlog here because we want to show the actual | 2577 | /* Not using mlog here because we want to show the actual |
2580 | * function the error came from. */ | 2578 | * function the error came from. */ |
2581 | printk(KERN_CRIT "OCFS2: ERROR (device %s): %s: %s\n", | 2579 | printk(KERN_CRIT "OCFS2: ERROR (device %s): %s: %pV\n", |
2582 | sb->s_id, function, error_buf); | 2580 | sb->s_id, function, &vaf); |
2581 | |||
2582 | va_end(args); | ||
2583 | 2583 | ||
2584 | ocfs2_handle_error(sb); | 2584 | ocfs2_handle_error(sb); |
2585 | } | 2585 | } |
@@ -2587,18 +2587,21 @@ void __ocfs2_error(struct super_block *sb, | |||
2587 | /* Handle critical errors. This is intentionally more drastic than | 2587 | /* Handle critical errors. This is intentionally more drastic than |
2588 | * ocfs2_handle_error, so we only use for things like journal errors, | 2588 | * ocfs2_handle_error, so we only use for things like journal errors, |
2589 | * etc. */ | 2589 | * etc. */ |
2590 | void __ocfs2_abort(struct super_block* sb, | 2590 | void __ocfs2_abort(struct super_block *sb, const char *function, |
2591 | const char *function, | ||
2592 | const char *fmt, ...) | 2591 | const char *fmt, ...) |
2593 | { | 2592 | { |
2593 | struct va_format vaf; | ||
2594 | va_list args; | 2594 | va_list args; |
2595 | 2595 | ||
2596 | va_start(args, fmt); | 2596 | va_start(args, fmt); |
2597 | vsnprintf(error_buf, sizeof(error_buf), fmt, args); | ||
2598 | va_end(args); | ||
2599 | 2597 | ||
2600 | printk(KERN_CRIT "OCFS2: abort (device %s): %s: %s\n", | 2598 | vaf.fmt = fmt; |
2601 | sb->s_id, function, error_buf); | 2599 | vaf.va = &args; |
2600 | |||
2601 | printk(KERN_CRIT "OCFS2: abort (device %s): %s: %pV\n", | ||
2602 | sb->s_id, function, &vaf); | ||
2603 | |||
2604 | va_end(args); | ||
2602 | 2605 | ||
2603 | /* We don't have the cluster support yet to go straight to | 2606 | /* We don't have the cluster support yet to go straight to |
2604 | * hard readonly in here. Until then, we want to keep | 2607 | * hard readonly in here. Until then, we want to keep |