summaryrefslogtreecommitdiffstats
path: root/fs/cifs/cifs_debug.h
diff options
context:
space:
mode:
authorRonnie Sahlberg <lsahlber@redhat.com>2019-08-28 17:15:35 +1000
committerSteve French <stfrench@microsoft.com>2019-09-16 11:43:37 -0500
commitafe6f65353b644f55875d42d812ffe87f1887d68 (patch)
tree98c7bdf6bacc724c70e44b4f64f07630a30ac607 /fs/cifs/cifs_debug.h
parentdc9300a670aebb22e9b04b3664da6b218b29ab60 (diff)
downloadlinux-afe6f65353b644f55875d42d812ffe87f1887d68.tar.gz
linux-afe6f65353b644f55875d42d812ffe87f1887d68.tar.bz2
linux-afe6f65353b644f55875d42d812ffe87f1887d68.zip
cifs: add new debugging macro cifs_server_dbg
which can be used from contexts where we have a TCP_Server_Info *server. This new macro will prepend the debugging string with "Server:<servername> " which will help when debugging issues on hosts with many cifs connections to several different servers. Convert a bunch of cifs_dbg(VFS) calls to cifs_server_dbg(VFS) Signed-off-by: Ronnie Sahlberg <lsahlber@redhat.com> Signed-off-by: Steve French <stfrench@microsoft.com>
Diffstat (limited to 'fs/cifs/cifs_debug.h')
-rw-r--r--fs/cifs/cifs_debug.h31
1 files changed, 31 insertions, 0 deletions
diff --git a/fs/cifs/cifs_debug.h b/fs/cifs/cifs_debug.h
index 3d392620a2f4..567af916f103 100644
--- a/fs/cifs/cifs_debug.h
+++ b/fs/cifs/cifs_debug.h
@@ -80,6 +80,30 @@ do { \
type, fmt, ##__VA_ARGS__); \
} while (0)
+#define cifs_server_dbg_func(ratefunc, type, fmt, ...) \
+do { \
+ if ((type) & FYI && cifsFYI & CIFS_INFO) { \
+ pr_debug_ ## ratefunc("%s: Server:%s " fmt, \
+ __FILE__, server->hostname, ##__VA_ARGS__);\
+ } else if ((type) & VFS) { \
+ pr_err_ ## ratefunc("CIFS VFS: Server:%s " fmt, \
+ server->hostname, ##__VA_ARGS__); \
+ } else if ((type) & NOISY && (NOISY != 0)) { \
+ pr_debug_ ## ratefunc("Server:%s " fmt, \
+ server->hostname, ##__VA_ARGS__); \
+ } \
+} while (0)
+
+#define cifs_server_dbg(type, fmt, ...) \
+do { \
+ if ((type) & ONCE) \
+ cifs_server_dbg_func(once, \
+ type, fmt, ##__VA_ARGS__); \
+ else \
+ cifs_server_dbg_func(ratelimited, \
+ type, fmt, ##__VA_ARGS__); \
+} while (0)
+
/*
* debug OFF
* ---------
@@ -91,6 +115,13 @@ do { \
pr_debug(fmt, ##__VA_ARGS__); \
} while (0)
+#define cifs_server_dbg(type, fmt, ...) \
+do { \
+ if (0) \
+ pr_debug("Server:%s " fmt, \
+ server->hostname, ##__VA_ARGS__); \
+} while (0)
+
#define cifs_info(fmt, ...) \
do { \
pr_info("CIFS: "fmt, ##__VA_ARGS__); \