提交 a40ecd7b 编写于 作者: J Joe Perches 提交者: Jan Kara

udf: Rename udf_warning to udf_warn

Rename udf_warning to udf_warn for consistency with normal logging
uses of pr_warn.

Rename function udf_warning to _udf_warn.
Remove __func__ from uses and move __func__ to a new udf_warn
macro that calls _udf_warn.
Add \n's to uses of udf_warn, remove \n from _udf_warn.
Coalesce formats.
Reviewed-by: NNamJae Jeon <linkinjeon@gmail.com>
Signed-off-by: NJoe Perches <joe@perches.com>
Signed-off-by: NJan Kara <jack@suse.cz>
上级 8076c363
...@@ -799,9 +799,8 @@ static int udf_rmdir(struct inode *dir, struct dentry *dentry) ...@@ -799,9 +799,8 @@ static int udf_rmdir(struct inode *dir, struct dentry *dentry)
if (retval) if (retval)
goto end_rmdir; goto end_rmdir;
if (inode->i_nlink != 2) if (inode->i_nlink != 2)
udf_warning(inode->i_sb, "udf_rmdir", udf_warn(inode->i_sb, "empty directory has nlink != 2 (%d)\n",
"empty directory has nlink != 2 (%d)", inode->i_nlink);
inode->i_nlink);
clear_nlink(inode); clear_nlink(inode);
inode->i_size = 0; inode->i_size = 0;
inode_dec_link_count(dir); inode_dec_link_count(dir);
......
...@@ -322,8 +322,7 @@ uint32_t udf_get_pblock_meta25(struct super_block *sb, uint32_t block, ...@@ -322,8 +322,7 @@ uint32_t udf_get_pblock_meta25(struct super_block *sb, uint32_t block,
BUG_ON(!inode); BUG_ON(!inode);
retblk = udf_try_read_meta(inode, block, partition, offset); retblk = udf_try_read_meta(inode, block, partition, offset);
if (retblk == 0xFFFFFFFF) { if (retblk == 0xFFFFFFFF) {
udf_warning(sb, __func__, "error reading from METADATA, " udf_warn(sb, "error reading from METADATA, trying to read from MIRROR\n");
"trying to read from MIRROR");
inode = mdata->s_mirror_fe; inode = mdata->s_mirror_fe;
if (!inode) if (!inode)
return 0xFFFFFFFF; return 0xFFFFFFFF;
......
...@@ -855,13 +855,11 @@ static int udf_load_metadata_files(struct super_block *sb, int partition) ...@@ -855,13 +855,11 @@ static int udf_load_metadata_files(struct super_block *sb, int partition)
mdata->s_metadata_fe = udf_iget(sb, &addr); mdata->s_metadata_fe = udf_iget(sb, &addr);
if (mdata->s_metadata_fe == NULL) { if (mdata->s_metadata_fe == NULL) {
udf_warning(sb, __func__, "metadata inode efe not found, " udf_warn(sb, "metadata inode efe not found, will try mirror inode\n");
"will try mirror inode.");
fe_error = 1; fe_error = 1;
} else if (UDF_I(mdata->s_metadata_fe)->i_alloc_type != } else if (UDF_I(mdata->s_metadata_fe)->i_alloc_type !=
ICBTAG_FLAG_AD_SHORT) { ICBTAG_FLAG_AD_SHORT) {
udf_warning(sb, __func__, "metadata inode efe does not have " udf_warn(sb, "metadata inode efe does not have short allocation descriptors!\n");
"short allocation descriptors!");
fe_error = 1; fe_error = 1;
iput(mdata->s_metadata_fe); iput(mdata->s_metadata_fe);
mdata->s_metadata_fe = NULL; mdata->s_metadata_fe = NULL;
...@@ -881,12 +879,10 @@ static int udf_load_metadata_files(struct super_block *sb, int partition) ...@@ -881,12 +879,10 @@ static int udf_load_metadata_files(struct super_block *sb, int partition)
udf_err(sb, "mirror inode efe not found and metadata inode is missing too, exiting...\n"); udf_err(sb, "mirror inode efe not found and metadata inode is missing too, exiting...\n");
goto error_exit; goto error_exit;
} else } else
udf_warning(sb, __func__, "mirror inode efe not found," udf_warn(sb, "mirror inode efe not found, but metadata inode is OK\n");
" but metadata inode is OK");
} else if (UDF_I(mdata->s_mirror_fe)->i_alloc_type != } else if (UDF_I(mdata->s_mirror_fe)->i_alloc_type !=
ICBTAG_FLAG_AD_SHORT) { ICBTAG_FLAG_AD_SHORT) {
udf_warning(sb, __func__, "mirror inode efe does not have " udf_warn(sb, "mirror inode efe does not have short allocation descriptors!\n");
"short allocation descriptors!");
iput(mdata->s_mirror_fe); iput(mdata->s_mirror_fe);
mdata->s_mirror_fe = NULL; mdata->s_mirror_fe = NULL;
if (fe_error) if (fe_error)
...@@ -909,9 +905,7 @@ static int udf_load_metadata_files(struct super_block *sb, int partition) ...@@ -909,9 +905,7 @@ static int udf_load_metadata_files(struct super_block *sb, int partition)
if (mdata->s_bitmap_fe == NULL) { if (mdata->s_bitmap_fe == NULL) {
if (sb->s_flags & MS_RDONLY) if (sb->s_flags & MS_RDONLY)
udf_warning(sb, __func__, "bitmap inode efe " udf_warn(sb, "bitmap inode efe not found but it's ok since the disc is mounted read-only\n");
"not found but it's ok since the disc"
" is mounted read-only");
else { else {
udf_err(sb, "bitmap inode efe not found and attempted read-write mount\n"); udf_err(sb, "bitmap inode efe not found and attempted read-write mount\n");
goto error_exit; goto error_exit;
...@@ -2105,15 +2099,15 @@ void _udf_err(struct super_block *sb, const char *function, ...@@ -2105,15 +2099,15 @@ void _udf_err(struct super_block *sb, const char *function,
sb->s_id, function, error_buf); sb->s_id, function, error_buf);
} }
void udf_warning(struct super_block *sb, const char *function, void _udf_warn(struct super_block *sb, const char *function,
const char *fmt, ...) const char *fmt, ...)
{ {
va_list args; va_list args;
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_WARNING "UDF-fs warning (device %s): %s: %s\n", printk(KERN_WARNING "UDF-fs warning (device %s): %s: %s",
sb->s_id, function, error_buf); sb->s_id, function, error_buf);
} }
......
...@@ -30,7 +30,10 @@ do { \ ...@@ -30,7 +30,10 @@ do { \
#endif #endif
__attribute__((format(printf, 3, 4))) __attribute__((format(printf, 3, 4)))
extern void udf_warning(struct super_block *, const char *, const char *, ...); extern void _udf_warn(struct super_block *sb, const char *function,
const char *fmt, ...);
#define udf_warn(sb, fmt, ...) \
_udf_warn(sb, __func__, fmt, ##__VA_ARGS__)
__attribute__((format(printf, 3, 4))) __attribute__((format(printf, 3, 4)))
extern void _udf_err(struct super_block *sb, const char *function, extern void _udf_err(struct super_block *sb, const char *function,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册