Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Joe Perches and committed by
Jan Kara
8076c363 7e273e3b

+23 -29
+8 -10
fs/udf/misc.c
··· 212 212 213 213 bh = udf_tread(sb, block); 214 214 if (!bh) { 215 - udf_error(sb, __func__, "read failed, block=%u, location=%d\n", 216 - block, location); 215 + udf_err(sb, "read failed, block=%u, location=%d\n", 216 + block, location); 217 217 return NULL; 218 218 } 219 219 ··· 230 230 /* Verify the tag checksum */ 231 231 checksum = udf_tag_checksum(tag_p); 232 232 if (checksum != tag_p->tagChecksum) { 233 - udf_error(sb, __func__, 234 - "tag checksum failed, block %u: 0x%02x != 0x%02x\n", 235 - block, checksum, tag_p->tagChecksum); 233 + udf_err(sb, "tag checksum failed, block %u: 0x%02x != 0x%02x\n", 234 + block, checksum, tag_p->tagChecksum); 236 235 goto error_out; 237 236 } 238 237 239 238 /* Verify the tag version */ 240 239 if (tag_p->descVersion != cpu_to_le16(0x0002U) && 241 240 tag_p->descVersion != cpu_to_le16(0x0003U)) { 242 - udf_error(sb, __func__, 243 - "tag version 0x%04x != 0x0002 || 0x0003, block %u\n", 244 - le16_to_cpu(tag_p->descVersion), block); 241 + udf_err(sb, "tag version 0x%04x != 0x0002 || 0x0003, block %u\n", 242 + le16_to_cpu(tag_p->descVersion), block); 245 243 goto error_out; 246 244 } 247 245 ··· 251 253 return bh; 252 254 253 255 udf_debug("Crc failure block %d: crc = %d, crclen = %d\n", block, 254 - le16_to_cpu(tag_p->descCRC), le16_to_cpu(tag_p->descCRCLength)); 255 - 256 + le16_to_cpu(tag_p->descCRC), 257 + le16_to_cpu(tag_p->descCRCLength)); 256 258 error_out: 257 259 brelse(bh); 258 260 return NULL;
+11 -16
fs/udf/super.c
··· 242 242 sbi->s_partmaps = kcalloc(count, sizeof(struct udf_part_map), 243 243 GFP_KERNEL); 244 244 if (!sbi->s_partmaps) { 245 - udf_error(sb, __func__, 246 - "Unable to allocate space for %d partition maps", 247 - count); 245 + udf_err(sb, "Unable to allocate space for %d partition maps\n", 246 + count); 248 247 sbi->s_partitions = 0; 249 248 return -ENOMEM; 250 249 } ··· 878 879 879 880 if (mdata->s_mirror_fe == NULL) { 880 881 if (fe_error) { 881 - udf_error(sb, __func__, "mirror inode efe not found " 882 - "and metadata inode is missing too, exiting..."); 882 + udf_err(sb, "mirror inode efe not found and metadata inode is missing too, exiting...\n"); 883 883 goto error_exit; 884 884 } else 885 885 udf_warning(sb, __func__, "mirror inode efe not found," ··· 913 915 "not found but it's ok since the disc" 914 916 " is mounted read-only"); 915 917 else { 916 - udf_error(sb, __func__, "bitmap inode efe not " 917 - "found and attempted read-write mount"); 918 + udf_err(sb, "bitmap inode efe not found and attempted read-write mount\n"); 918 919 goto error_exit; 919 920 } 920 921 } ··· 966 969 bitmap = vzalloc(size); /* TODO: get rid of vzalloc */ 967 970 968 971 if (bitmap == NULL) { 969 - udf_error(sb, __func__, 970 - "Unable to allocate space for bitmap " 971 - "and %d buffer_head pointers", nr_groups); 972 + udf_err(sb, "Unable to allocate space for bitmap and %d buffer_head pointers\n", 973 + nr_groups); 972 974 return NULL; 973 975 } 974 976 ··· 1931 1935 1932 1936 if (uopt.flags & (1 << UDF_FLAG_UTF8) && 1933 1937 uopt.flags & (1 << UDF_FLAG_NLS_MAP)) { 1934 - udf_error(sb, "udf_read_super", 1935 - "utf8 cannot be combined with iocharset\n"); 1938 + udf_err(sb, "utf8 cannot be combined with iocharset\n"); 1936 1939 goto error_out; 1937 1940 } 1938 1941 #ifdef CONFIG_UDF_NLS ··· 2089 2094 return -EINVAL; 2090 2095 } 2091 2096 2092 - void udf_error(struct super_block *sb, const char *function, 2093 - const char *fmt, ...) 2097 + void _udf_err(struct super_block *sb, const char *function, 2098 + const char *fmt, ...) 2094 2099 { 2095 2100 va_list args; 2096 2101 ··· 2101 2106 va_start(args, fmt); 2102 2107 vsnprintf(error_buf, sizeof(error_buf), fmt, args); 2103 2108 va_end(args); 2104 - printk(KERN_CRIT "UDF-fs error (device %s): %s: %s\n", 2105 - sb->s_id, function, error_buf); 2109 + printk(KERN_CRIT "UDF-fs error (device %s): %s: %s", 2110 + sb->s_id, function, error_buf); 2106 2111 } 2107 2112 2108 2113 void udf_warning(struct super_block *sb, const char *function,
+4 -3
fs/udf/udfdecl.h
··· 33 33 extern void udf_warning(struct super_block *, const char *, const char *, ...); 34 34 35 35 __attribute__((format(printf, 3, 4))) 36 - extern void udf_error(struct super_block *sb, const char *function, 37 - const char *fmt, ...); 36 + extern void _udf_err(struct super_block *sb, const char *function, 37 + const char *fmt, ...); 38 + #define udf_err(sb, fmt, ...) \ 39 + _udf_err(sb, __func__, fmt, ##__VA_ARGS__) 38 40 39 41 #define udf_info(f, a...) \ 40 42 printk(KERN_INFO "UDF-fs INFO " f, ##a); 41 - 42 43 43 44 #define udf_fixed_to_variable(x) ( ( ( (x) >> 5 ) * 39 ) + ( (x) & 0x0000001F ) ) 44 45 #define udf_variable_to_fixed(x) ( ( ( (x) / 39 ) << 5 ) + ( (x) % 39 ) )