udf: Convert printks to pr_<level>

Use the current logging styles.

Convert a few printks that should have been udf_warn and udf_err.
Coalesce formats.  Add #define pr_fmt.
Move an #include "udfdecls.h" above other includes in udftime.c
so pr_fmt works correctly.  Strip prefixes from conversions as appropriate.
Reorder logging definitions in udfdecl.h

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:05 -07:00
committed by Jan Kara
parent a40ecd7b3c
commit 78ace70c41
7 changed files with 83 additions and 98 deletions

View File

@@ -1,6 +1,8 @@
#ifndef __UDF_DECL_H
#define __UDF_DECL_H
#define pr_fmt(fmt) "UDF-fs: " fmt
#include "ecma_167.h"
#include "osta_udf.h"
@@ -16,18 +18,11 @@
#define UDF_PREALLOCATE
#define UDF_DEFAULT_PREALLOC_BLOCKS 8
#undef UDFFS_DEBUG
#ifdef UDFFS_DEBUG
#define udf_debug(f, a...) \
do { \
printk(KERN_DEBUG "UDF-fs DEBUG %s:%d:%s: ", \
__FILE__, __LINE__, __func__); \
printk(f, ##a); \
} while (0)
#else
#define udf_debug(f, a...) /**/
#endif
__attribute__((format(printf, 3, 4)))
extern void _udf_err(struct super_block *sb, const char *function,
const char *fmt, ...);
#define udf_err(sb, fmt, ...) \
_udf_err(sb, __func__, fmt, ##__VA_ARGS__)
__attribute__((format(printf, 3, 4)))
extern void _udf_warn(struct super_block *sb, const char *function,
@@ -35,14 +30,19 @@ extern void _udf_warn(struct super_block *sb, const char *function,
#define udf_warn(sb, fmt, ...) \
_udf_warn(sb, __func__, fmt, ##__VA_ARGS__)
__attribute__((format(printf, 3, 4)))
extern void _udf_err(struct super_block *sb, const char *function,
const char *fmt, ...);
#define udf_err(sb, fmt, ...) \
_udf_err(sb, __func__, fmt, ##__VA_ARGS__)
#define udf_info(fmt, ...) \
pr_info("INFO " fmt, ##__VA_ARGS__)
#define udf_info(f, a...) \
printk(KERN_INFO "UDF-fs INFO " f, ##a);
#undef UDFFS_DEBUG
#ifdef UDFFS_DEBUG
#define udf_debug(fmt, ...) \
printk(KERN_DEBUG pr_fmt("%s:%d:%s: " fmt), \
__FILE__, __LINE__, __func__, ##__VA_ARGS__)
#else
#define udf_debug(fmt, ...) \
no_printk(fmt, ##__VA_ARGS__)
#endif
#define udf_fixed_to_variable(x) ( ( ( (x) >> 5 ) * 39 ) + ( (x) & 0x0000001F ) )
#define udf_variable_to_fixed(x) ( ( ( (x) / 39 ) << 5 ) + ( (x) % 39 ) )