diff options
author | Joe Perches <joe@perches.com> | 2011-10-10 04:08:03 -0400 |
---|---|---|
committer | Jan Kara <jack@suse.cz> | 2011-10-10 13:29:01 -0400 |
commit | 8076c363da15e7c35a4094974d1b4bcc196b5fa9 (patch) | |
tree | e15e500b2371cc41c736433aeb8840c28fe9c4da /fs/udf | |
parent | 7e273e3b41e32716dc122b293b5f15635af495ff (diff) |
udf: Rename udf_error to udf_err
Rename udf_error to udf_err for consistency with normal logging
uses of pr_err.
Rename function udf_err to _udf_err.
Remove __func__ from uses and move __func__ to a new udf_err
macro that calls _udf_err.
Some of the udf_error uses had \n terminations, some did not so
standardize \n's to udf_err uses, remove \n from _udf_err function.
Coalesce udf_err formats.
One message prefixed with udf_read_super is now prefixed with
udf_fill_super.
Reviewed-by: NamJae Jeon <linkinjeon@gmail.com>
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Jan Kara <jack@suse.cz>
Diffstat (limited to 'fs/udf')
-rw-r--r-- | fs/udf/misc.c | 18 | ||||
-rw-r--r-- | fs/udf/super.c | 27 | ||||
-rw-r--r-- | fs/udf/udfdecl.h | 7 |
3 files changed, 23 insertions, 29 deletions
diff --git a/fs/udf/misc.c b/fs/udf/misc.c index a85fa7c55b0a..c175b4dabc14 100644 --- a/fs/udf/misc.c +++ b/fs/udf/misc.c | |||
@@ -212,8 +212,8 @@ struct buffer_head *udf_read_tagged(struct super_block *sb, uint32_t block, | |||
212 | 212 | ||
213 | bh = udf_tread(sb, block); | 213 | bh = udf_tread(sb, block); |
214 | if (!bh) { | 214 | if (!bh) { |
215 | udf_error(sb, __func__, "read failed, block=%u, location=%d\n", | 215 | udf_err(sb, "read failed, block=%u, location=%d\n", |
216 | block, location); | 216 | block, location); |
217 | return NULL; | 217 | return NULL; |
218 | } | 218 | } |
219 | 219 | ||
@@ -230,18 +230,16 @@ struct buffer_head *udf_read_tagged(struct super_block *sb, uint32_t block, | |||
230 | /* Verify the tag checksum */ | 230 | /* Verify the tag checksum */ |
231 | checksum = udf_tag_checksum(tag_p); | 231 | checksum = udf_tag_checksum(tag_p); |
232 | if (checksum != tag_p->tagChecksum) { | 232 | if (checksum != tag_p->tagChecksum) { |
233 | udf_error(sb, __func__, | 233 | udf_err(sb, "tag checksum failed, block %u: 0x%02x != 0x%02x\n", |
234 | "tag checksum failed, block %u: 0x%02x != 0x%02x\n", | 234 | block, checksum, tag_p->tagChecksum); |
235 | block, checksum, tag_p->tagChecksum); | ||
236 | goto error_out; | 235 | goto error_out; |
237 | } | 236 | } |
238 | 237 | ||
239 | /* Verify the tag version */ | 238 | /* Verify the tag version */ |
240 | if (tag_p->descVersion != cpu_to_le16(0x0002U) && | 239 | if (tag_p->descVersion != cpu_to_le16(0x0002U) && |
241 | tag_p->descVersion != cpu_to_le16(0x0003U)) { | 240 | tag_p->descVersion != cpu_to_le16(0x0003U)) { |
242 | udf_error(sb, __func__, | 241 | udf_err(sb, "tag version 0x%04x != 0x0002 || 0x0003, block %u\n", |
243 | "tag version 0x%04x != 0x0002 || 0x0003, block %u\n", | 242 | le16_to_cpu(tag_p->descVersion), block); |
244 | le16_to_cpu(tag_p->descVersion), block); | ||
245 | goto error_out; | 243 | goto error_out; |
246 | } | 244 | } |
247 | 245 | ||
@@ -253,8 +251,8 @@ struct buffer_head *udf_read_tagged(struct super_block *sb, uint32_t block, | |||
253 | return bh; | 251 | return bh; |
254 | 252 | ||
255 | udf_debug("Crc failure block %d: crc = %d, crclen = %d\n", block, | 253 | udf_debug("Crc failure block %d: crc = %d, crclen = %d\n", block, |
256 | le16_to_cpu(tag_p->descCRC), le16_to_cpu(tag_p->descCRCLength)); | 254 | le16_to_cpu(tag_p->descCRC), |
257 | 255 | le16_to_cpu(tag_p->descCRCLength)); | |
258 | error_out: | 256 | error_out: |
259 | brelse(bh); | 257 | brelse(bh); |
260 | return NULL; | 258 | return NULL; |
diff --git a/fs/udf/super.c b/fs/udf/super.c index 80f47ce515bc..76cc08f9202e 100644 --- a/fs/udf/super.c +++ b/fs/udf/super.c | |||
@@ -242,9 +242,8 @@ static int udf_sb_alloc_partition_maps(struct super_block *sb, u32 count) | |||
242 | sbi->s_partmaps = kcalloc(count, sizeof(struct udf_part_map), | 242 | sbi->s_partmaps = kcalloc(count, sizeof(struct udf_part_map), |
243 | GFP_KERNEL); | 243 | GFP_KERNEL); |
244 | if (!sbi->s_partmaps) { | 244 | if (!sbi->s_partmaps) { |
245 | udf_error(sb, __func__, | 245 | udf_err(sb, "Unable to allocate space for %d partition maps\n", |
246 | "Unable to allocate space for %d partition maps", | 246 | count); |
247 | count); | ||
248 | sbi->s_partitions = 0; | 247 | sbi->s_partitions = 0; |
249 | return -ENOMEM; | 248 | return -ENOMEM; |
250 | } | 249 | } |
@@ -879,8 +878,7 @@ static int udf_load_metadata_files(struct super_block *sb, int partition) | |||
879 | 878 | ||
880 | if (mdata->s_mirror_fe == NULL) { | 879 | if (mdata->s_mirror_fe == NULL) { |
881 | if (fe_error) { | 880 | if (fe_error) { |
882 | udf_error(sb, __func__, "mirror inode efe not found " | 881 | udf_err(sb, "mirror inode efe not found and metadata inode is missing too, exiting...\n"); |
883 | "and metadata inode is missing too, exiting..."); | ||
884 | goto error_exit; | 882 | goto error_exit; |
885 | } else | 883 | } else |
886 | udf_warning(sb, __func__, "mirror inode efe not found," | 884 | udf_warning(sb, __func__, "mirror inode efe not found," |
@@ -915,8 +913,7 @@ static int udf_load_metadata_files(struct super_block *sb, int partition) | |||
915 | "not found but it's ok since the disc" | 913 | "not found but it's ok since the disc" |
916 | " is mounted read-only"); | 914 | " is mounted read-only"); |
917 | else { | 915 | else { |
918 | udf_error(sb, __func__, "bitmap inode efe not " | 916 | udf_err(sb, "bitmap inode efe not found and attempted read-write mount\n"); |
919 | "found and attempted read-write mount"); | ||
920 | goto error_exit; | 917 | goto error_exit; |
921 | } | 918 | } |
922 | } | 919 | } |
@@ -969,9 +966,8 @@ static struct udf_bitmap *udf_sb_alloc_bitmap(struct super_block *sb, u32 index) | |||
969 | bitmap = vzalloc(size); /* TODO: get rid of vzalloc */ | 966 | bitmap = vzalloc(size); /* TODO: get rid of vzalloc */ |
970 | 967 | ||
971 | if (bitmap == NULL) { | 968 | if (bitmap == NULL) { |
972 | udf_error(sb, __func__, | 969 | udf_err(sb, "Unable to allocate space for bitmap and %d buffer_head pointers\n", |
973 | "Unable to allocate space for bitmap " | 970 | nr_groups); |
974 | "and %d buffer_head pointers", nr_groups); | ||
975 | return NULL; | 971 | return NULL; |
976 | } | 972 | } |
977 | 973 | ||
@@ -1935,8 +1931,7 @@ static int udf_fill_super(struct super_block *sb, void *options, int silent) | |||
1935 | 1931 | ||
1936 | if (uopt.flags & (1 << UDF_FLAG_UTF8) && | 1932 | if (uopt.flags & (1 << UDF_FLAG_UTF8) && |
1937 | uopt.flags & (1 << UDF_FLAG_NLS_MAP)) { | 1933 | uopt.flags & (1 << UDF_FLAG_NLS_MAP)) { |
1938 | udf_error(sb, "udf_read_super", | 1934 | udf_err(sb, "utf8 cannot be combined with iocharset\n"); |
1939 | "utf8 cannot be combined with iocharset\n"); | ||
1940 | goto error_out; | 1935 | goto error_out; |
1941 | } | 1936 | } |
1942 | #ifdef CONFIG_UDF_NLS | 1937 | #ifdef CONFIG_UDF_NLS |
@@ -2094,8 +2089,8 @@ error_out: | |||
2094 | return -EINVAL; | 2089 | return -EINVAL; |
2095 | } | 2090 | } |
2096 | 2091 | ||
2097 | void udf_error(struct super_block *sb, const char *function, | 2092 | void _udf_err(struct super_block *sb, const char *function, |
2098 | const char *fmt, ...) | 2093 | const char *fmt, ...) |
2099 | { | 2094 | { |
2100 | va_list args; | 2095 | va_list args; |
2101 | 2096 | ||
@@ -2106,8 +2101,8 @@ void udf_error(struct super_block *sb, const char *function, | |||
2106 | va_start(args, fmt); | 2101 | va_start(args, fmt); |
2107 | vsnprintf(error_buf, sizeof(error_buf), fmt, args); | 2102 | vsnprintf(error_buf, sizeof(error_buf), fmt, args); |
2108 | va_end(args); | 2103 | va_end(args); |
2109 | printk(KERN_CRIT "UDF-fs error (device %s): %s: %s\n", | 2104 | printk(KERN_CRIT "UDF-fs error (device %s): %s: %s", |
2110 | sb->s_id, function, error_buf); | 2105 | sb->s_id, function, error_buf); |
2111 | } | 2106 | } |
2112 | 2107 | ||
2113 | void udf_warning(struct super_block *sb, const char *function, | 2108 | void udf_warning(struct super_block *sb, const char *function, |
diff --git a/fs/udf/udfdecl.h b/fs/udf/udfdecl.h index 81e66afecd42..7bc3ba1415fc 100644 --- a/fs/udf/udfdecl.h +++ b/fs/udf/udfdecl.h | |||
@@ -33,13 +33,14 @@ __attribute__((format(printf, 3, 4))) | |||
33 | extern void udf_warning(struct super_block *, const char *, const char *, ...); | 33 | extern void udf_warning(struct super_block *, const char *, const char *, ...); |
34 | 34 | ||
35 | __attribute__((format(printf, 3, 4))) | 35 | __attribute__((format(printf, 3, 4))) |
36 | extern void udf_error(struct super_block *sb, const char *function, | 36 | extern void _udf_err(struct super_block *sb, const char *function, |
37 | const char *fmt, ...); | 37 | const char *fmt, ...); |
38 | #define udf_err(sb, fmt, ...) \ | ||
39 | _udf_err(sb, __func__, fmt, ##__VA_ARGS__) | ||
38 | 40 | ||
39 | #define udf_info(f, a...) \ | 41 | #define udf_info(f, a...) \ |
40 | printk(KERN_INFO "UDF-fs INFO " f, ##a); | 42 | printk(KERN_INFO "UDF-fs INFO " f, ##a); |
41 | 43 | ||
42 | |||
43 | #define udf_fixed_to_variable(x) ( ( ( (x) >> 5 ) * 39 ) + ( (x) & 0x0000001F ) ) | 44 | #define udf_fixed_to_variable(x) ( ( ( (x) >> 5 ) * 39 ) + ( (x) & 0x0000001F ) ) |
44 | #define udf_variable_to_fixed(x) ( ( ( (x) / 39 ) << 5 ) + ( (x) % 39 ) ) | 45 | #define udf_variable_to_fixed(x) ( ( ( (x) / 39 ) << 5 ) + ( (x) % 39 ) ) |
45 | 46 | ||