|
6 | 6 |
|
7 | 7 | struct xfs_mount; |
8 | 8 |
|
9 | | -extern __printf(2, 3) |
10 | | -void xfs_emerg(const struct xfs_mount *mp, const char *fmt, ...); |
11 | | -extern __printf(2, 3) |
12 | | -void xfs_alert(const struct xfs_mount *mp, const char *fmt, ...); |
13 | 9 | extern __printf(3, 4) |
14 | | -void xfs_alert_tag(const struct xfs_mount *mp, int tag, const char *fmt, ...); |
15 | | -extern __printf(2, 3) |
16 | | -void xfs_crit(const struct xfs_mount *mp, const char *fmt, ...); |
17 | | -extern __printf(2, 3) |
18 | | -void xfs_err(const struct xfs_mount *mp, const char *fmt, ...); |
19 | | -extern __printf(2, 3) |
20 | | -void xfs_warn(const struct xfs_mount *mp, const char *fmt, ...); |
21 | | -extern __printf(2, 3) |
22 | | -void xfs_notice(const struct xfs_mount *mp, const char *fmt, ...); |
23 | | -extern __printf(2, 3) |
24 | | -void xfs_info(const struct xfs_mount *mp, const char *fmt, ...); |
| 10 | +void xfs_printk_level(const char *kern_level, const struct xfs_mount *mp, |
| 11 | + const char *fmt, ...); |
25 | 12 |
|
| 13 | +#define xfs_printk_index_wrap(kern_level, mp, fmt, ...) \ |
| 14 | +({ \ |
| 15 | + printk_index_subsys_emit("%sXFS%s: ", kern_level, fmt); \ |
| 16 | + xfs_printk_level(kern_level, mp, fmt, ##__VA_ARGS__); \ |
| 17 | +}) |
| 18 | +#define xfs_emerg(mp, fmt, ...) \ |
| 19 | + xfs_printk_index_wrap(KERN_EMERG, mp, fmt, ##__VA_ARGS__) |
| 20 | +#define xfs_alert(mp, fmt, ...) \ |
| 21 | + xfs_printk_index_wrap(KERN_ALERT, mp, fmt, ##__VA_ARGS__) |
| 22 | +#define xfs_crit(mp, fmt, ...) \ |
| 23 | + xfs_printk_index_wrap(KERN_CRIT, mp, fmt, ##__VA_ARGS__) |
| 24 | +#define xfs_err(mp, fmt, ...) \ |
| 25 | + xfs_printk_index_wrap(KERN_ERR, mp, fmt, ##__VA_ARGS__) |
| 26 | +#define xfs_warn(mp, fmt, ...) \ |
| 27 | + xfs_printk_index_wrap(KERN_WARNING, mp, fmt, ##__VA_ARGS__) |
| 28 | +#define xfs_notice(mp, fmt, ...) \ |
| 29 | + xfs_printk_index_wrap(KERN_NOTICE, mp, fmt, ##__VA_ARGS__) |
| 30 | +#define xfs_info(mp, fmt, ...) \ |
| 31 | + xfs_printk_index_wrap(KERN_INFO, mp, fmt, ##__VA_ARGS__) |
26 | 32 | #ifdef DEBUG |
27 | | -extern __printf(2, 3) |
28 | | -void xfs_debug(const struct xfs_mount *mp, const char *fmt, ...); |
| 33 | +#define xfs_debug(mp, fmt, ...) \ |
| 34 | + xfs_printk_index_wrap(KERN_DEBUG, mp, fmt, ##__VA_ARGS__) |
29 | 35 | #else |
30 | | -static inline __printf(2, 3) |
31 | | -void xfs_debug(const struct xfs_mount *mp, const char *fmt, ...) |
32 | | -{ |
33 | | -} |
| 36 | +#define xfs_debug(mp, fmt, ...) do {} while (0) |
34 | 37 | #endif |
35 | 38 |
|
| 39 | +#define xfs_alert_tag(mp, tag, fmt, ...) \ |
| 40 | +({ \ |
| 41 | + printk_index_subsys_emit("%sXFS%s: ", KERN_ALERT, fmt); \ |
| 42 | + _xfs_alert_tag(mp, tag, fmt, ##__VA_ARGS__); \ |
| 43 | +}) |
| 44 | + |
| 45 | +extern __printf(3, 4) |
| 46 | +void _xfs_alert_tag(const struct xfs_mount *mp, int tag, const char *fmt, ...); |
| 47 | + |
36 | 48 | #define xfs_printk_ratelimited(func, dev, fmt, ...) \ |
37 | 49 | do { \ |
38 | 50 | static DEFINE_RATELIMIT_STATE(_rs, \ |
|
0 commit comments