Skip to content

Commit a40ecd7

Browse files
JoePerchesjankara
authored andcommitted
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: NamJae Jeon <linkinjeon@gmail.com> Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Jan Kara <jack@suse.cz>
1 parent 8076c36 commit a40ecd7

4 files changed

Lines changed: 15 additions & 20 deletions

File tree

‎fs/udf/namei.c‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -799,9 +799,8 @@ static int udf_rmdir(struct inode *dir, struct dentry *dentry)
799799
if (retval)
800800
goto end_rmdir;
801801
if (inode->i_nlink != 2)
802-
udf_warning(inode->i_sb, "udf_rmdir",
803-
"empty directory has nlink != 2 (%d)",
804-
inode->i_nlink);
802+
udf_warn(inode->i_sb, "empty directory has nlink != 2 (%d)\n",
803+
inode->i_nlink);
805804
clear_nlink(inode);
806805
inode->i_size = 0;
807806
inode_dec_link_count(dir);

‎fs/udf/partition.c‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -322,8 +322,7 @@ uint32_t udf_get_pblock_meta25(struct super_block *sb, uint32_t block,
322322
BUG_ON(!inode);
323323
retblk = udf_try_read_meta(inode, block, partition, offset);
324324
if (retblk == 0xFFFFFFFF) {
325-
udf_warning(sb, __func__, "error reading from METADATA, "
326-
"trying to read from MIRROR");
325+
udf_warn(sb, "error reading from METADATA, trying to read from MIRROR\n");
327326
inode = mdata->s_mirror_fe;
328327
if (!inode)
329328
return 0xFFFFFFFF;

‎fs/udf/super.c‎

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -855,13 +855,11 @@ static int udf_load_metadata_files(struct super_block *sb, int partition)
855855
mdata->s_metadata_fe = udf_iget(sb, &addr);
856856

857857
if (mdata->s_metadata_fe == NULL) {
858-
udf_warning(sb, __func__, "metadata inode efe not found, "
859-
"will try mirror inode.");
858+
udf_warn(sb, "metadata inode efe not found, will try mirror inode\n");
860859
fe_error = 1;
861860
} else if (UDF_I(mdata->s_metadata_fe)->i_alloc_type !=
862861
ICBTAG_FLAG_AD_SHORT) {
863-
udf_warning(sb, __func__, "metadata inode efe does not have "
864-
"short allocation descriptors!");
862+
udf_warn(sb, "metadata inode efe does not have short allocation descriptors!\n");
865863
fe_error = 1;
866864
iput(mdata->s_metadata_fe);
867865
mdata->s_metadata_fe = NULL;
@@ -881,12 +879,10 @@ static int udf_load_metadata_files(struct super_block *sb, int partition)
881879
udf_err(sb, "mirror inode efe not found and metadata inode is missing too, exiting...\n");
882880
goto error_exit;
883881
} else
884-
udf_warning(sb, __func__, "mirror inode efe not found,"
885-
" but metadata inode is OK");
882+
udf_warn(sb, "mirror inode efe not found, but metadata inode is OK\n");
886883
} else if (UDF_I(mdata->s_mirror_fe)->i_alloc_type !=
887884
ICBTAG_FLAG_AD_SHORT) {
888-
udf_warning(sb, __func__, "mirror inode efe does not have "
889-
"short allocation descriptors!");
885+
udf_warn(sb, "mirror inode efe does not have short allocation descriptors!\n");
890886
iput(mdata->s_mirror_fe);
891887
mdata->s_mirror_fe = NULL;
892888
if (fe_error)
@@ -909,9 +905,7 @@ static int udf_load_metadata_files(struct super_block *sb, int partition)
909905

910906
if (mdata->s_bitmap_fe == NULL) {
911907
if (sb->s_flags & MS_RDONLY)
912-
udf_warning(sb, __func__, "bitmap inode efe "
913-
"not found but it's ok since the disc"
914-
" is mounted read-only");
908+
udf_warn(sb, "bitmap inode efe not found but it's ok since the disc is mounted read-only\n");
915909
else {
916910
udf_err(sb, "bitmap inode efe not found and attempted read-write mount\n");
917911
goto error_exit;
@@ -2105,15 +2099,15 @@ void _udf_err(struct super_block *sb, const char *function,
21052099
sb->s_id, function, error_buf);
21062100
}
21072101

2108-
void udf_warning(struct super_block *sb, const char *function,
2109-
const char *fmt, ...)
2102+
void _udf_warn(struct super_block *sb, const char *function,
2103+
const char *fmt, ...)
21102104
{
21112105
va_list args;
21122106

21132107
va_start(args, fmt);
21142108
vsnprintf(error_buf, sizeof(error_buf), fmt, args);
21152109
va_end(args);
2116-
printk(KERN_WARNING "UDF-fs warning (device %s): %s: %s\n",
2110+
printk(KERN_WARNING "UDF-fs warning (device %s): %s: %s",
21172111
sb->s_id, function, error_buf);
21182112
}
21192113

‎fs/udf/udfdecl.h‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,10 @@ do { \
3030
#endif
3131

3232
__attribute__((format(printf, 3, 4)))
33-
extern void udf_warning(struct super_block *, const char *, const char *, ...);
33+
extern void _udf_warn(struct super_block *sb, const char *function,
34+
const char *fmt, ...);
35+
#define udf_warn(sb, fmt, ...) \
36+
_udf_warn(sb, __func__, fmt, ##__VA_ARGS__)
3437

3538
__attribute__((format(printf, 3, 4)))
3639
extern void _udf_err(struct super_block *sb, const char *function,

0 commit comments

Comments
 (0)