diff options
author | Joe Perches <joe@perches.com> | 2013-05-04 23:12:25 -0400 |
---|---|---|
committer | Steve French <smfrench@gmail.com> | 2013-05-04 23:17:23 -0400 |
commit | f96637be081141d6f8813429499f164260b49d70 (patch) | |
tree | c91f5a9b5a2b7a67bbeda15d7c9805655547a098 /fs/cifs/cifs_debug.h | |
parent | f7f7c1850eb98da758731ea7edfa830ebefe24cd (diff) |
[CIFS] cifs: Rename cERROR and cFYI to cifs_dbg
It's not obvious from reading the macro names that these macros
are for debugging. Convert the names to a single more typical
kernel style cifs_dbg macro.
cERROR(1, ...) -> cifs_dbg(VFS, ...)
cFYI(1, ...) -> cifs_dbg(FYI, ...)
cFYI(DBG2, ...) -> cifs_dbg(NOISY, ...)
Move the terminating format newline from the macro to the call site.
Add CONFIG_CIFS_DEBUG function cifs_vfs_err to emit the
"CIFS VFS: " prefix for VFS messages.
Size is reduced ~ 1% when CONFIG_CIFS_DEBUG is set (default y)
$ size fs/cifs/cifs.ko*
text data bss dec hex filename
265245 2525 132 267902 4167e fs/cifs/cifs.ko.new
268359 2525 132 271016 422a8 fs/cifs/cifs.ko.old
Other miscellaneous changes around these conversions:
o Miscellaneous typo fixes
o Add terminating \n's to almost all formats and remove them
from the macros to be more kernel style like. A few formats
previously had defective \n's
o Remove unnecessary OOM messages as kmalloc() calls dump_stack
o Coalesce formats to make grep easier,
added missing spaces when coalescing formats
o Use %s, __func__ instead of embedded function name
o Removed unnecessary "cifs: " prefixes
o Convert kzalloc with multiply to kcalloc
o Remove unused cifswarn macro
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Steve French <smfrench@gmail.com>
Diffstat (limited to 'fs/cifs/cifs_debug.h')
-rw-r--r-- | fs/cifs/cifs_debug.h | 70 |
1 files changed, 23 insertions, 47 deletions
diff --git a/fs/cifs/cifs_debug.h b/fs/cifs/cifs_debug.h index 69ae3d3c3b31..c99b40fb609b 100644 --- a/fs/cifs/cifs_debug.h +++ b/fs/cifs/cifs_debug.h | |||
@@ -25,18 +25,20 @@ | |||
25 | void cifs_dump_mem(char *label, void *data, int length); | 25 | void cifs_dump_mem(char *label, void *data, int length); |
26 | void cifs_dump_detail(void *); | 26 | void cifs_dump_detail(void *); |
27 | void cifs_dump_mids(struct TCP_Server_Info *); | 27 | void cifs_dump_mids(struct TCP_Server_Info *); |
28 | #ifdef CONFIG_CIFS_DEBUG2 | ||
29 | #define DBG2 2 | ||
30 | #else | ||
31 | #define DBG2 0 | ||
32 | #endif | ||
33 | extern int traceSMB; /* flag which enables the function below */ | 28 | extern int traceSMB; /* flag which enables the function below */ |
34 | void dump_smb(void *, int); | 29 | void dump_smb(void *, int); |
35 | #define CIFS_INFO 0x01 | 30 | #define CIFS_INFO 0x01 |
36 | #define CIFS_RC 0x02 | 31 | #define CIFS_RC 0x02 |
37 | #define CIFS_TIMER 0x04 | 32 | #define CIFS_TIMER 0x04 |
38 | 33 | ||
34 | #define VFS 1 | ||
35 | #define FYI 2 | ||
39 | extern int cifsFYI; | 36 | extern int cifsFYI; |
37 | #ifdef CONFIG_CIFS_DEBUG2 | ||
38 | #define NOISY 4 | ||
39 | #else | ||
40 | #define NOISY 0 | ||
41 | #endif | ||
40 | 42 | ||
41 | /* | 43 | /* |
42 | * debug ON | 44 | * debug ON |
@@ -44,31 +46,21 @@ extern int cifsFYI; | |||
44 | */ | 46 | */ |
45 | #ifdef CONFIG_CIFS_DEBUG | 47 | #ifdef CONFIG_CIFS_DEBUG |
46 | 48 | ||
47 | /* information message: e.g., configuration, major event */ | 49 | __printf(1, 2) void cifs_vfs_err(const char *fmt, ...); |
48 | #define cifsfyi(fmt, ...) \ | ||
49 | do { \ | ||
50 | if (cifsFYI & CIFS_INFO) \ | ||
51 | printk(KERN_DEBUG "%s: " fmt "\n", \ | ||
52 | __FILE__, ##__VA_ARGS__); \ | ||
53 | } while (0) | ||
54 | |||
55 | #define cFYI(set, fmt, ...) \ | ||
56 | do { \ | ||
57 | if (set) \ | ||
58 | cifsfyi(fmt, ##__VA_ARGS__); \ | ||
59 | } while (0) | ||
60 | 50 | ||
61 | #define cifswarn(fmt, ...) \ | 51 | /* information message: e.g., configuration, major event */ |
62 | printk(KERN_WARNING fmt "\n", ##__VA_ARGS__) | 52 | #define cifs_dbg(type, fmt, ...) \ |
63 | |||
64 | /* error event message: e.g., i/o error */ | ||
65 | #define cifserror(fmt, ...) \ | ||
66 | printk(KERN_ERR "CIFS VFS: " fmt "\n", ##__VA_ARGS__); \ | ||
67 | |||
68 | #define cERROR(set, fmt, ...) \ | ||
69 | do { \ | 53 | do { \ |
70 | if (set) \ | 54 | if (type == FYI) { \ |
71 | cifserror(fmt, ##__VA_ARGS__); \ | 55 | if (cifsFYI & CIFS_INFO) { \ |
56 | printk(KERN_DEBUG "%s: " fmt, \ | ||
57 | __FILE__, ##__VA_ARGS__); \ | ||
58 | } \ | ||
59 | } else if (type == VFS) { \ | ||
60 | cifs_vfs_err(fmt, ##__VA_ARGS__); \ | ||
61 | } else if (type == NOISY && type != 0) { \ | ||
62 | printk(KERN_DEBUG fmt, ##__VA_ARGS__); \ | ||
63 | } \ | ||
72 | } while (0) | 64 | } while (0) |
73 | 65 | ||
74 | /* | 66 | /* |
@@ -76,27 +68,11 @@ do { \ | |||
76 | * --------- | 68 | * --------- |
77 | */ | 69 | */ |
78 | #else /* _CIFS_DEBUG */ | 70 | #else /* _CIFS_DEBUG */ |
79 | #define cifsfyi(fmt, ...) \ | 71 | #define cifs_dbg(type, fmt, ...) \ |
80 | do { \ | 72 | do { \ |
81 | if (0) \ | 73 | if (0) \ |
82 | printk(KERN_DEBUG "%s: " fmt "\n", \ | 74 | printk(KERN_DEBUG fmt, ##__VA_ARGS__); \ |
83 | __FILE__, ##__VA_ARGS__); \ | ||
84 | } while (0) | 75 | } while (0) |
85 | #define cFYI(set, fmt, ...) \ | 76 | #endif |
86 | do { \ | ||
87 | if (0 && set) \ | ||
88 | cifsfyi(fmt, ##__VA_ARGS__); \ | ||
89 | } while (0) | ||
90 | #define cifserror(fmt, ...) \ | ||
91 | do { \ | ||
92 | if (0) \ | ||
93 | printk(KERN_ERR "CIFS VFS: " fmt "\n", ##__VA_ARGS__); \ | ||
94 | } while (0) | ||
95 | #define cERROR(set, fmt, ...) \ | ||
96 | do { \ | ||
97 | if (0 && set) \ | ||
98 | cifserror(fmt, ##__VA_ARGS__); \ | ||
99 | } while (0) | ||
100 | #endif /* _CIFS_DEBUG */ | ||
101 | 77 | ||
102 | #endif /* _H_CIFS_DEBUG */ | 78 | #endif /* _H_CIFS_DEBUG */ |