diff options
author | Joe Perches <joe@perches.com> | 2011-10-10 04:08:06 -0400 |
---|---|---|
committer | Jan Kara <jack@suse.cz> | 2011-10-31 18:43:58 -0400 |
commit | c2bff36c299b88ca5e05638dfa210d709e2a87ef (patch) | |
tree | 29039a1fbd12fa25b1ba76be929b261e58c9ddd8 /fs/udf/super.c | |
parent | 78ace70c4186c0d18314eb001637aa97d1585e65 (diff) |
udf: Neaten logging output, use vsprintf extension %pV
Use %pV and remove a static buffer to save some text space and fix possible
issues when several processes call error reporting function in parallel. Also
change error level from KERN_CRIT to KERN_ERR.
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Jan Kara <jack@suse.cz>
Diffstat (limited to 'fs/udf/super.c')
-rw-r--r-- | fs/udf/super.c | 28 |
1 files changed, 17 insertions, 11 deletions
diff --git a/fs/udf/super.c b/fs/udf/super.c index 39e3f351c7a6..926228e7435a 100644 --- a/fs/udf/super.c +++ b/fs/udf/super.c | |||
@@ -75,8 +75,6 @@ | |||
75 | 75 | ||
76 | #define UDF_DEFAULT_BLOCKSIZE 2048 | 76 | #define UDF_DEFAULT_BLOCKSIZE 2048 |
77 | 77 | ||
78 | static char error_buf[1024]; | ||
79 | |||
80 | /* These are the "meat" - everything else is stuffing */ | 78 | /* These are the "meat" - everything else is stuffing */ |
81 | static int udf_fill_super(struct super_block *, void *, int); | 79 | static int udf_fill_super(struct super_block *, void *, int); |
82 | static void udf_put_super(struct super_block *); | 80 | static void udf_put_super(struct super_block *); |
@@ -2077,29 +2075,37 @@ error_out: | |||
2077 | void _udf_err(struct super_block *sb, const char *function, | 2075 | void _udf_err(struct super_block *sb, const char *function, |
2078 | const char *fmt, ...) | 2076 | const char *fmt, ...) |
2079 | { | 2077 | { |
2078 | struct va_format vaf; | ||
2080 | va_list args; | 2079 | va_list args; |
2081 | 2080 | ||
2082 | if (!(sb->s_flags & MS_RDONLY)) { | 2081 | /* mark sb error */ |
2083 | /* mark sb error */ | 2082 | if (!(sb->s_flags & MS_RDONLY)) |
2084 | sb->s_dirt = 1; | 2083 | sb->s_dirt = 1; |
2085 | } | 2084 | |
2086 | va_start(args, fmt); | 2085 | va_start(args, fmt); |
2087 | vsnprintf(error_buf, sizeof(error_buf), fmt, args); | 2086 | |
2087 | vaf.fmt = fmt; | ||
2088 | vaf.va = &args; | ||
2089 | |||
2090 | pr_err("error (device %s): %s: %pV", sb->s_id, function, &vaf); | ||
2091 | |||
2088 | va_end(args); | 2092 | va_end(args); |
2089 | pr_crit("error (device %s): %s: %s", | ||
2090 | sb->s_id, function, error_buf); | ||
2091 | } | 2093 | } |
2092 | 2094 | ||
2093 | void _udf_warn(struct super_block *sb, const char *function, | 2095 | void _udf_warn(struct super_block *sb, const char *function, |
2094 | const char *fmt, ...) | 2096 | const char *fmt, ...) |
2095 | { | 2097 | { |
2098 | struct va_format vaf; | ||
2096 | va_list args; | 2099 | va_list args; |
2097 | 2100 | ||
2098 | va_start(args, fmt); | 2101 | va_start(args, fmt); |
2099 | vsnprintf(error_buf, sizeof(error_buf), fmt, args); | 2102 | |
2103 | vaf.fmt = fmt; | ||
2104 | vaf.va = &args; | ||
2105 | |||
2106 | pr_warn("warning (device %s): %s: %pV", sb->s_id, function, &vaf); | ||
2107 | |||
2100 | va_end(args); | 2108 | va_end(args); |
2101 | pr_warn("warning (device %s): %s: %s", | ||
2102 | sb->s_id, function, error_buf); | ||
2103 | } | 2109 | } |
2104 | 2110 | ||
2105 | static void udf_put_super(struct super_block *sb) | 2111 | static void udf_put_super(struct super_block *sb) |