dect
/
linux-2.6
Archived
13
0
Fork 0

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>
This commit is contained in:
Joe Perches 2011-10-10 01:08:03 -07:00 committed by Jan Kara
parent 7e273e3b41
commit 8076c363da
3 changed files with 23 additions and 29 deletions

View File

@ -212,7 +212,7 @@ struct buffer_head *udf_read_tagged(struct super_block *sb, uint32_t block,
bh = udf_tread(sb, block); bh = udf_tread(sb, block);
if (!bh) { if (!bh) {
udf_error(sb, __func__, "read failed, block=%u, location=%d\n", udf_err(sb, "read failed, block=%u, location=%d\n",
block, location); block, location);
return NULL; return NULL;
} }
@ -230,8 +230,7 @@ struct buffer_head *udf_read_tagged(struct super_block *sb, uint32_t block,
/* Verify the tag checksum */ /* Verify the tag checksum */
checksum = udf_tag_checksum(tag_p); checksum = udf_tag_checksum(tag_p);
if (checksum != tag_p->tagChecksum) { if (checksum != tag_p->tagChecksum) {
udf_error(sb, __func__, udf_err(sb, "tag checksum failed, block %u: 0x%02x != 0x%02x\n",
"tag checksum failed, block %u: 0x%02x != 0x%02x\n",
block, checksum, tag_p->tagChecksum); block, checksum, tag_p->tagChecksum);
goto error_out; goto error_out;
} }
@ -239,8 +238,7 @@ struct buffer_head *udf_read_tagged(struct super_block *sb, uint32_t block,
/* Verify the tag version */ /* Verify the tag version */
if (tag_p->descVersion != cpu_to_le16(0x0002U) && if (tag_p->descVersion != cpu_to_le16(0x0002U) &&
tag_p->descVersion != cpu_to_le16(0x0003U)) { tag_p->descVersion != cpu_to_le16(0x0003U)) {
udf_error(sb, __func__, udf_err(sb, "tag version 0x%04x != 0x0002 || 0x0003, block %u\n",
"tag version 0x%04x != 0x0002 || 0x0003, block %u\n",
le16_to_cpu(tag_p->descVersion), block); le16_to_cpu(tag_p->descVersion), block);
goto error_out; goto error_out;
} }
@ -253,8 +251,8 @@ struct buffer_head *udf_read_tagged(struct super_block *sb, uint32_t block,
return bh; return bh;
udf_debug("Crc failure block %d: crc = %d, crclen = %d\n", block, udf_debug("Crc failure block %d: crc = %d, crclen = %d\n", block,
le16_to_cpu(tag_p->descCRC), le16_to_cpu(tag_p->descCRCLength)); le16_to_cpu(tag_p->descCRC),
le16_to_cpu(tag_p->descCRCLength));
error_out: error_out:
brelse(bh); brelse(bh);
return NULL; return NULL;

View File

@ -242,8 +242,7 @@ static int udf_sb_alloc_partition_maps(struct super_block *sb, u32 count)
sbi->s_partmaps = kcalloc(count, sizeof(struct udf_part_map), sbi->s_partmaps = kcalloc(count, sizeof(struct udf_part_map),
GFP_KERNEL); GFP_KERNEL);
if (!sbi->s_partmaps) { if (!sbi->s_partmaps) {
udf_error(sb, __func__, udf_err(sb, "Unable to allocate space for %d partition maps\n",
"Unable to allocate space for %d partition maps",
count); count);
sbi->s_partitions = 0; sbi->s_partitions = 0;
return -ENOMEM; return -ENOMEM;
@ -879,8 +878,7 @@ static int udf_load_metadata_files(struct super_block *sb, int partition)
if (mdata->s_mirror_fe == NULL) { if (mdata->s_mirror_fe == NULL) {
if (fe_error) { if (fe_error) {
udf_error(sb, __func__, "mirror inode efe not found " udf_err(sb, "mirror inode efe not found and metadata inode is missing too, exiting...\n");
"and metadata inode is missing too, exiting...");
goto error_exit; goto error_exit;
} else } else
udf_warning(sb, __func__, "mirror inode efe not found," 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)
"not found but it's ok since the disc" "not found but it's ok since the disc"
" is mounted read-only"); " is mounted read-only");
else { else {
udf_error(sb, __func__, "bitmap inode efe not " udf_err(sb, "bitmap inode efe not found and attempted read-write mount\n");
"found and attempted read-write mount");
goto error_exit; goto error_exit;
} }
} }
@ -969,9 +966,8 @@ static struct udf_bitmap *udf_sb_alloc_bitmap(struct super_block *sb, u32 index)
bitmap = vzalloc(size); /* TODO: get rid of vzalloc */ bitmap = vzalloc(size); /* TODO: get rid of vzalloc */
if (bitmap == NULL) { if (bitmap == NULL) {
udf_error(sb, __func__, udf_err(sb, "Unable to allocate space for bitmap and %d buffer_head pointers\n",
"Unable to allocate space for bitmap " nr_groups);
"and %d buffer_head pointers", nr_groups);
return NULL; return NULL;
} }
@ -1935,8 +1931,7 @@ static int udf_fill_super(struct super_block *sb, void *options, int silent)
if (uopt.flags & (1 << UDF_FLAG_UTF8) && if (uopt.flags & (1 << UDF_FLAG_UTF8) &&
uopt.flags & (1 << UDF_FLAG_NLS_MAP)) { uopt.flags & (1 << UDF_FLAG_NLS_MAP)) {
udf_error(sb, "udf_read_super", udf_err(sb, "utf8 cannot be combined with iocharset\n");
"utf8 cannot be combined with iocharset\n");
goto error_out; goto error_out;
} }
#ifdef CONFIG_UDF_NLS #ifdef CONFIG_UDF_NLS
@ -2094,7 +2089,7 @@ error_out:
return -EINVAL; return -EINVAL;
} }
void udf_error(struct super_block *sb, const char *function, void _udf_err(struct super_block *sb, const char *function,
const char *fmt, ...) const char *fmt, ...)
{ {
va_list args; va_list args;
@ -2106,7 +2101,7 @@ void udf_error(struct super_block *sb, const char *function,
va_start(args, fmt); va_start(args, fmt);
vsnprintf(error_buf, sizeof(error_buf), fmt, args); vsnprintf(error_buf, sizeof(error_buf), fmt, args);
va_end(args); va_end(args);
printk(KERN_CRIT "UDF-fs error (device %s): %s: %s\n", printk(KERN_CRIT "UDF-fs error (device %s): %s: %s",
sb->s_id, function, error_buf); sb->s_id, function, error_buf);
} }

View File

@ -33,13 +33,14 @@ __attribute__((format(printf, 3, 4)))
extern void udf_warning(struct super_block *, const char *, const char *, ...); extern void udf_warning(struct super_block *, const char *, const char *, ...);
__attribute__((format(printf, 3, 4))) __attribute__((format(printf, 3, 4)))
extern void udf_error(struct super_block *sb, const char *function, extern void _udf_err(struct super_block *sb, const char *function,
const char *fmt, ...); const char *fmt, ...);
#define udf_err(sb, fmt, ...) \
_udf_err(sb, __func__, fmt, ##__VA_ARGS__)
#define udf_info(f, a...) \ #define udf_info(f, a...) \
printk(KERN_INFO "UDF-fs INFO " f, ##a); printk(KERN_INFO "UDF-fs INFO " f, ##a);
#define udf_fixed_to_variable(x) ( ( ( (x) >> 5 ) * 39 ) + ( (x) & 0x0000001F ) ) #define udf_fixed_to_variable(x) ( ( ( (x) >> 5 ) * 39 ) + ( (x) & 0x0000001F ) )
#define udf_variable_to_fixed(x) ( ( ( (x) / 39 ) << 5 ) + ( (x) % 39 ) ) #define udf_variable_to_fixed(x) ( ( ( (x) / 39 ) << 5 ) + ( (x) % 39 ) )