diff options
Diffstat (limited to 'net/9p/mod.c')
-rw-r--r-- | net/9p/mod.c | 31 |
1 files changed, 29 insertions, 2 deletions
diff --git a/net/9p/mod.c b/net/9p/mod.c index 2664d1292291..6ab36aea7727 100644 --- a/net/9p/mod.c +++ b/net/9p/mod.c | |||
@@ -24,7 +24,11 @@ | |||
24 | * | 24 | * |
25 | */ | 25 | */ |
26 | 26 | ||
27 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
28 | |||
27 | #include <linux/module.h> | 29 | #include <linux/module.h> |
30 | #include <linux/errno.h> | ||
31 | #include <linux/sched.h> | ||
28 | #include <linux/moduleparam.h> | 32 | #include <linux/moduleparam.h> |
29 | #include <net/9p/9p.h> | 33 | #include <net/9p/9p.h> |
30 | #include <linux/fs.h> | 34 | #include <linux/fs.h> |
@@ -39,6 +43,29 @@ unsigned int p9_debug_level = 0; /* feature-rific global debug level */ | |||
39 | EXPORT_SYMBOL(p9_debug_level); | 43 | EXPORT_SYMBOL(p9_debug_level); |
40 | module_param_named(debug, p9_debug_level, uint, 0); | 44 | module_param_named(debug, p9_debug_level, uint, 0); |
41 | MODULE_PARM_DESC(debug, "9P debugging level"); | 45 | MODULE_PARM_DESC(debug, "9P debugging level"); |
46 | |||
47 | void _p9_debug(enum p9_debug_flags level, const char *func, | ||
48 | const char *fmt, ...) | ||
49 | { | ||
50 | struct va_format vaf; | ||
51 | va_list args; | ||
52 | |||
53 | if ((p9_debug_level & level) != level) | ||
54 | return; | ||
55 | |||
56 | va_start(args, fmt); | ||
57 | |||
58 | vaf.fmt = fmt; | ||
59 | vaf.va = &args; | ||
60 | |||
61 | if (level == P9_DEBUG_9P) | ||
62 | pr_notice("(%8.8d) %pV", task_pid_nr(current), &vaf); | ||
63 | else | ||
64 | pr_notice("-- %s (%d): %pV", func, task_pid_nr(current), &vaf); | ||
65 | |||
66 | va_end(args); | ||
67 | } | ||
68 | EXPORT_SYMBOL(_p9_debug); | ||
42 | #endif | 69 | #endif |
43 | 70 | ||
44 | /* | 71 | /* |
@@ -147,7 +174,7 @@ static int __init init_p9(void) | |||
147 | int ret = 0; | 174 | int ret = 0; |
148 | 175 | ||
149 | p9_error_init(); | 176 | p9_error_init(); |
150 | printk(KERN_INFO "Installing 9P2000 support\n"); | 177 | pr_info("Installing 9P2000 support\n"); |
151 | p9_trans_fd_init(); | 178 | p9_trans_fd_init(); |
152 | 179 | ||
153 | return ret; | 180 | return ret; |
@@ -160,7 +187,7 @@ static int __init init_p9(void) | |||
160 | 187 | ||
161 | static void __exit exit_p9(void) | 188 | static void __exit exit_p9(void) |
162 | { | 189 | { |
163 | printk(KERN_INFO "Unloading 9P2000 support\n"); | 190 | pr_info("Unloading 9P2000 support\n"); |
164 | 191 | ||
165 | p9_trans_fd_exit(); | 192 | p9_trans_fd_exit(); |
166 | } | 193 | } |