]> Git Repo - linux.git/blame - fs/xfs/xfs_message.h
xfs: validate extsz hints against rt extent size when rtinherit is set
[linux.git] / fs / xfs / xfs_message.h
CommitLineData
b2441318 1/* SPDX-License-Identifier: GPL-2.0 */
10e38391
DC
2#ifndef __XFS_MESSAGE_H
3#define __XFS_MESSAGE_H 1
4
5struct xfs_mount;
6
b9075fa9
JP
7extern __printf(2, 3)
8void xfs_emerg(const struct xfs_mount *mp, const char *fmt, ...);
9extern __printf(2, 3)
10void xfs_alert(const struct xfs_mount *mp, const char *fmt, ...);
11extern __printf(3, 4)
12void xfs_alert_tag(const struct xfs_mount *mp, int tag, const char *fmt, ...);
13extern __printf(2, 3)
14void xfs_crit(const struct xfs_mount *mp, const char *fmt, ...);
15extern __printf(2, 3)
16void xfs_err(const struct xfs_mount *mp, const char *fmt, ...);
17extern __printf(2, 3)
18void xfs_warn(const struct xfs_mount *mp, const char *fmt, ...);
19extern __printf(2, 3)
20void xfs_notice(const struct xfs_mount *mp, const char *fmt, ...);
21extern __printf(2, 3)
22void xfs_info(const struct xfs_mount *mp, const char *fmt, ...);
10e38391
DC
23
24#ifdef DEBUG
b9075fa9
JP
25extern __printf(2, 3)
26void xfs_debug(const struct xfs_mount *mp, const char *fmt, ...);
10e38391 27#else
b9075fa9
JP
28static inline __printf(2, 3)
29void xfs_debug(const struct xfs_mount *mp, const char *fmt, ...)
957935dc
CH
30{
31}
10e38391
DC
32#endif
33
ec43f6da 34#define xfs_printk_ratelimited(func, dev, fmt, ...) \
3d6e0361
RJ
35do { \
36 static DEFINE_RATELIMIT_STATE(_rs, \
37 DEFAULT_RATELIMIT_INTERVAL, \
38 DEFAULT_RATELIMIT_BURST); \
39 if (__ratelimit(&_rs)) \
ec43f6da 40 func(dev, fmt, ##__VA_ARGS__); \
3d6e0361
RJ
41} while (0)
42
ec43f6da
ES
43#define xfs_printk_once(func, dev, fmt, ...) \
44({ \
33def849 45 static bool __section(".data.once") __print_once; \
ec43f6da
ES
46 bool __ret_print_once = !__print_once; \
47 \
48 if (!__print_once) { \
49 __print_once = true; \
50 func(dev, fmt, ##__VA_ARGS__); \
51 } \
52 unlikely(__ret_print_once); \
53})
54
3d6e0361
RJ
55#define xfs_emerg_ratelimited(dev, fmt, ...) \
56 xfs_printk_ratelimited(xfs_emerg, dev, fmt, ##__VA_ARGS__)
57#define xfs_alert_ratelimited(dev, fmt, ...) \
58 xfs_printk_ratelimited(xfs_alert, dev, fmt, ##__VA_ARGS__)
59#define xfs_crit_ratelimited(dev, fmt, ...) \
60 xfs_printk_ratelimited(xfs_crit, dev, fmt, ##__VA_ARGS__)
61#define xfs_err_ratelimited(dev, fmt, ...) \
62 xfs_printk_ratelimited(xfs_err, dev, fmt, ##__VA_ARGS__)
63#define xfs_warn_ratelimited(dev, fmt, ...) \
64 xfs_printk_ratelimited(xfs_warn, dev, fmt, ##__VA_ARGS__)
65#define xfs_notice_ratelimited(dev, fmt, ...) \
66 xfs_printk_ratelimited(xfs_notice, dev, fmt, ##__VA_ARGS__)
67#define xfs_info_ratelimited(dev, fmt, ...) \
68 xfs_printk_ratelimited(xfs_info, dev, fmt, ##__VA_ARGS__)
69#define xfs_debug_ratelimited(dev, fmt, ...) \
70 xfs_printk_ratelimited(xfs_debug, dev, fmt, ##__VA_ARGS__)
71
ec43f6da
ES
72#define xfs_warn_once(dev, fmt, ...) \
73 xfs_printk_once(xfs_warn, dev, fmt, ##__VA_ARGS__)
74#define xfs_notice_once(dev, fmt, ...) \
75 xfs_printk_once(xfs_notice, dev, fmt, ##__VA_ARGS__)
603f000b
DW
76#define xfs_info_once(dev, fmt, ...) \
77 xfs_printk_once(xfs_info, dev, fmt, ##__VA_ARGS__)
ec43f6da 78
9842b56c
DW
79void assfail(struct xfs_mount *mp, char *expr, char *f, int l);
80void asswarn(struct xfs_mount *mp, char *expr, char *f, int l);
9130090b 81
d243b89a 82extern void xfs_hex_dump(const void *p, int length);
9130090b 83
f9bccfcc
BF
84void xfs_buf_alert_ratelimited(struct xfs_buf *bp, const char *rlmsg,
85 const char *fmt, ...);
86
10e38391 87#endif /* __XFS_MESSAGE_H */
This page took 0.603957 seconds and 4 git commands to generate.