|
8 | 8 | #ifndef _H_CIFS_DEBUG |
9 | 9 | #define _H_CIFS_DEBUG |
10 | 10 |
|
| 11 | +#ifdef pr_fmt |
| 12 | +#undef pr_fmt |
| 13 | +#endif |
| 14 | + |
| 15 | +#define pr_fmt(fmt) "CIFS: " fmt |
| 16 | + |
11 | 17 | void cifs_dump_mem(char *label, void *data, int length); |
12 | 18 | void cifs_dump_detail(void *buf, struct TCP_Server_Info *ptcp_info); |
13 | 19 | void cifs_dump_mids(struct TCP_Server_Info *); |
@@ -46,92 +52,81 @@ extern int cifsFYI; |
46 | 52 | */ |
47 | 53 |
|
48 | 54 | /* Information level messages, minor events */ |
49 | | -#define cifs_info_func(ratefunc, fmt, ...) \ |
50 | | -do { \ |
51 | | - pr_info_ ## ratefunc("CIFS: " fmt, ##__VA_ARGS__); \ |
52 | | -} while (0) |
| 55 | +#define cifs_info_func(ratefunc, fmt, ...) \ |
| 56 | + pr_info_ ## ratefunc(fmt, ##__VA_ARGS__) |
53 | 57 |
|
54 | | -#define cifs_info(fmt, ...) \ |
55 | | -do { \ |
56 | | - cifs_info_func(ratelimited, fmt, ##__VA_ARGS__); \ |
57 | | -} while (0) |
| 58 | +#define cifs_info(fmt, ...) \ |
| 59 | + cifs_info_func(ratelimited, fmt, ##__VA_ARGS__) |
58 | 60 |
|
59 | 61 | /* information message: e.g., configuration, major event */ |
60 | | -#define cifs_dbg_func(ratefunc, type, fmt, ...) \ |
61 | | -do { \ |
62 | | - if ((type) & FYI && cifsFYI & CIFS_INFO) { \ |
63 | | - pr_debug_ ## ratefunc("%s: " \ |
64 | | - fmt, __FILE__, ##__VA_ARGS__); \ |
65 | | - } else if ((type) & VFS) { \ |
66 | | - pr_err_ ## ratefunc("CIFS VFS: " \ |
67 | | - fmt, ##__VA_ARGS__); \ |
68 | | - } else if ((type) & NOISY && (NOISY != 0)) { \ |
69 | | - pr_debug_ ## ratefunc(fmt, ##__VA_ARGS__); \ |
70 | | - } \ |
| 62 | +#define cifs_dbg_func(ratefunc, type, fmt, ...) \ |
| 63 | +do { \ |
| 64 | + if ((type) & FYI && cifsFYI & CIFS_INFO) { \ |
| 65 | + pr_debug_ ## ratefunc("%s: " fmt, \ |
| 66 | + __FILE__, ##__VA_ARGS__); \ |
| 67 | + } else if ((type) & VFS) { \ |
| 68 | + pr_err_ ## ratefunc("VFS: " fmt, ##__VA_ARGS__); \ |
| 69 | + } else if ((type) & NOISY && (NOISY != 0)) { \ |
| 70 | + pr_debug_ ## ratefunc(fmt, ##__VA_ARGS__); \ |
| 71 | + } \ |
71 | 72 | } while (0) |
72 | 73 |
|
73 | | -#define cifs_dbg(type, fmt, ...) \ |
74 | | -do { \ |
75 | | - if ((type) & ONCE) \ |
76 | | - cifs_dbg_func(once, \ |
77 | | - type, fmt, ##__VA_ARGS__); \ |
78 | | - else \ |
79 | | - cifs_dbg_func(ratelimited, \ |
80 | | - type, fmt, ##__VA_ARGS__); \ |
| 74 | +#define cifs_dbg(type, fmt, ...) \ |
| 75 | +do { \ |
| 76 | + if ((type) & ONCE) \ |
| 77 | + cifs_dbg_func(once, type, fmt, ##__VA_ARGS__); \ |
| 78 | + else \ |
| 79 | + cifs_dbg_func(ratelimited, type, fmt, ##__VA_ARGS__); \ |
81 | 80 | } while (0) |
82 | 81 |
|
83 | | -#define cifs_server_dbg_func(ratefunc, type, fmt, ...) \ |
84 | | -do { \ |
85 | | - const char *sn = ""; \ |
86 | | - if (server && server->hostname) \ |
87 | | - sn = server->hostname; \ |
88 | | - if ((type) & FYI && cifsFYI & CIFS_INFO) { \ |
89 | | - pr_debug_ ## ratefunc("%s: \\\\%s " fmt, \ |
90 | | - __FILE__, sn, ##__VA_ARGS__); \ |
91 | | - } else if ((type) & VFS) { \ |
92 | | - pr_err_ ## ratefunc("CIFS VFS: \\\\%s " fmt, \ |
93 | | - sn, ##__VA_ARGS__); \ |
94 | | - } else if ((type) & NOISY && (NOISY != 0)) { \ |
95 | | - pr_debug_ ## ratefunc("\\\\%s " fmt, \ |
96 | | - sn, ##__VA_ARGS__); \ |
97 | | - } \ |
| 82 | +#define cifs_server_dbg_func(ratefunc, type, fmt, ...) \ |
| 83 | +do { \ |
| 84 | + const char *sn = ""; \ |
| 85 | + if (server && server->hostname) \ |
| 86 | + sn = server->hostname; \ |
| 87 | + if ((type) & FYI && cifsFYI & CIFS_INFO) { \ |
| 88 | + pr_debug_ ## ratefunc("%s: \\\\%s " fmt, \ |
| 89 | + __FILE__, sn, ##__VA_ARGS__); \ |
| 90 | + } else if ((type) & VFS) { \ |
| 91 | + pr_err_ ## ratefunc("VFS: \\\\%s " fmt, \ |
| 92 | + sn, ##__VA_ARGS__); \ |
| 93 | + } else if ((type) & NOISY && (NOISY != 0)) { \ |
| 94 | + pr_debug_ ## ratefunc("\\\\%s " fmt, \ |
| 95 | + sn, ##__VA_ARGS__); \ |
| 96 | + } \ |
98 | 97 | } while (0) |
99 | 98 |
|
100 | | -#define cifs_server_dbg(type, fmt, ...) \ |
101 | | -do { \ |
102 | | - if ((type) & ONCE) \ |
103 | | - cifs_server_dbg_func(once, \ |
104 | | - type, fmt, ##__VA_ARGS__); \ |
105 | | - else \ |
106 | | - cifs_server_dbg_func(ratelimited, \ |
107 | | - type, fmt, ##__VA_ARGS__); \ |
| 99 | +#define cifs_server_dbg(type, fmt, ...) \ |
| 100 | +do { \ |
| 101 | + if ((type) & ONCE) \ |
| 102 | + cifs_server_dbg_func(once, type, fmt, ##__VA_ARGS__); \ |
| 103 | + else \ |
| 104 | + cifs_server_dbg_func(ratelimited, type, fmt, \ |
| 105 | + ##__VA_ARGS__); \ |
108 | 106 | } while (0) |
109 | 107 |
|
110 | | -#define cifs_tcon_dbg_func(ratefunc, type, fmt, ...) \ |
111 | | -do { \ |
112 | | - const char *tn = ""; \ |
113 | | - if (tcon && tcon->treeName) \ |
114 | | - tn = tcon->treeName; \ |
115 | | - if ((type) & FYI && cifsFYI & CIFS_INFO) { \ |
116 | | - pr_debug_ ## ratefunc("%s: %s " fmt, \ |
117 | | - __FILE__, tn, ##__VA_ARGS__); \ |
118 | | - } else if ((type) & VFS) { \ |
119 | | - pr_err_ ## ratefunc("CIFS VFS: %s " fmt, \ |
120 | | - tn, ##__VA_ARGS__); \ |
121 | | - } else if ((type) & NOISY && (NOISY != 0)) { \ |
122 | | - pr_debug_ ## ratefunc("%s " fmt, \ |
123 | | - tn, ##__VA_ARGS__); \ |
124 | | - } \ |
| 108 | +#define cifs_tcon_dbg_func(ratefunc, type, fmt, ...) \ |
| 109 | +do { \ |
| 110 | + const char *tn = ""; \ |
| 111 | + if (tcon && tcon->treeName) \ |
| 112 | + tn = tcon->treeName; \ |
| 113 | + if ((type) & FYI && cifsFYI & CIFS_INFO) { \ |
| 114 | + pr_debug_ ## ratefunc("%s: %s " fmt, \ |
| 115 | + __FILE__, tn, ##__VA_ARGS__); \ |
| 116 | + } else if ((type) & VFS) { \ |
| 117 | + pr_err_ ## ratefunc("VFS: %s " fmt, tn, ##__VA_ARGS__); \ |
| 118 | + } else if ((type) & NOISY && (NOISY != 0)) { \ |
| 119 | + pr_debug_ ## ratefunc("%s " fmt, tn, ##__VA_ARGS__); \ |
| 120 | + } \ |
125 | 121 | } while (0) |
126 | 122 |
|
127 | | -#define cifs_tcon_dbg(type, fmt, ...) \ |
128 | | -do { \ |
129 | | - if ((type) & ONCE) \ |
130 | | - cifs_tcon_dbg_func(once, \ |
131 | | - type, fmt, ##__VA_ARGS__); \ |
132 | | - else \ |
133 | | - cifs_tcon_dbg_func(ratelimited, \ |
134 | | - type, fmt, ##__VA_ARGS__); \ |
| 123 | +#define cifs_tcon_dbg(type, fmt, ...) \ |
| 124 | +do { \ |
| 125 | + if ((type) & ONCE) \ |
| 126 | + cifs_tcon_dbg_func(once, type, fmt, ##__VA_ARGS__); \ |
| 127 | + else \ |
| 128 | + cifs_tcon_dbg_func(ratelimited, type, fmt, \ |
| 129 | + ##__VA_ARGS__); \ |
135 | 130 | } while (0) |
136 | 131 |
|
137 | 132 | /* |
@@ -159,9 +154,7 @@ do { \ |
159 | 154 | } while (0) |
160 | 155 |
|
161 | 156 | #define cifs_info(fmt, ...) \ |
162 | | -do { \ |
163 | | - pr_info("CIFS: "fmt, ##__VA_ARGS__); \ |
164 | | -} while (0) |
| 157 | + pr_info(fmt, ##__VA_ARGS__) |
165 | 158 | #endif |
166 | 159 |
|
167 | 160 | #endif /* _H_CIFS_DEBUG */ |
0 commit comments