[PATCH] cifs: don't present the cifsFYI procfile when CONFIG_CIFS_DEBUG is disabled

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



If all of the debug messages are compiled out, then this knob is no
longer connected to anything useful. There's no point in presenting
it at all in that case.

Signed-off-by: Jeff Layton <jlayton@xxxxxxxxxx>
---
 fs/cifs/cifs_debug.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/fs/cifs/cifs_debug.c b/fs/cifs/cifs_debug.c
index d9ea6ed..f5de4c9 100644
--- a/fs/cifs/cifs_debug.c
+++ b/fs/cifs/cifs_debug.c
@@ -371,7 +371,11 @@ static const struct file_operations cifs_stats_proc_fops = {
 #endif /* STATS */
 
 static struct proc_dir_entry *proc_fs_cifs;
+
+#ifdef CONFIG_CIFS_DEBUG
 static const struct file_operations cifsFYI_proc_fops;
+#endif /* CONFIG_CIFS_DEBUG */
+
 static const struct file_operations cifs_lookup_cache_proc_fops;
 static const struct file_operations traceSMB_proc_fops;
 static const struct file_operations cifs_security_flags_proc_fops;
@@ -389,7 +393,9 @@ cifs_proc_init(void)
 #ifdef CONFIG_CIFS_STATS
 	proc_create("Stats", 0, proc_fs_cifs, &cifs_stats_proc_fops);
 #endif /* STATS */
+#ifdef CONFIG_CIFS_DEBUG
 	proc_create("cifsFYI", 0, proc_fs_cifs, &cifsFYI_proc_fops);
+#endif /* CONFIG_CIFS_DEBUG */
 	proc_create("traceSMB", 0, proc_fs_cifs, &traceSMB_proc_fops);
 	proc_create("LinuxExtensionsEnabled", 0, proc_fs_cifs,
 		    &cifs_linux_ext_proc_fops);
@@ -406,7 +412,9 @@ cifs_proc_clean(void)
 		return;
 
 	remove_proc_entry("DebugData", proc_fs_cifs);
+#ifdef CONFIG_CIFS_DEBUG
 	remove_proc_entry("cifsFYI", proc_fs_cifs);
+#endif /* CONFIG_CIFS_DEBUG */
 	remove_proc_entry("traceSMB", proc_fs_cifs);
 #ifdef CONFIG_CIFS_STATS
 	remove_proc_entry("Stats", proc_fs_cifs);
@@ -417,6 +425,7 @@ cifs_proc_clean(void)
 	remove_proc_entry("fs/cifs", NULL);
 }
 
+#ifdef CONFIG_CIFS_DEBUG
 static int cifsFYI_proc_show(struct seq_file *m, void *v)
 {
 	seq_printf(m, "%d\n", cifsFYI);
@@ -455,6 +464,7 @@ static const struct file_operations cifsFYI_proc_fops = {
 	.release	= single_release,
 	.write		= cifsFYI_proc_write,
 };
+#endif /* CONFIG_CIFS_DEBUG */
 
 static int cifs_linux_ext_proc_show(struct seq_file *m, void *v)
 {
-- 
1.7.11.7

--
To unsubscribe from this list: send the line "unsubscribe linux-cifs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux