From patchwork Tue Dec 18 11:48:59 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 1891361 Return-Path: X-Original-To: patchwork-cifs-client@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 2D64BDF23A for ; Tue, 18 Dec 2012 11:56:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754354Ab2LRL4c (ORCPT ); Tue, 18 Dec 2012 06:56:32 -0500 Received: from mail-gg0-f171.google.com ([209.85.161.171]:61527 "EHLO mail-gg0-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754180Ab2LRL4c (ORCPT ); Tue, 18 Dec 2012 06:56:32 -0500 X-Greylist: delayed 446 seconds by postgrey-1.27 at vger.kernel.org; Tue, 18 Dec 2012 06:56:32 EST Received: by mail-gg0-f171.google.com with SMTP id 4so85348ggm.16 for ; Tue, 18 Dec 2012 03:56:31 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:sender:from:to:cc:subject:date:message-id:x-mailer :x-gm-message-state; bh=MhmC+7iGvRzMet7PJNkFulfqkp36JyMliKib3O9FVDA=; b=BRJR13X4OGpTfiGqJEHRJlpl1yfvLpxJKN3rCdUHnhX6o04c3h+yBIrSVQwkb3Znxb tbOQU9bYhxxp3AUc3qZ4Hx7ayzz4Qz4HMZRH2nwiAtn8j7m24sMsQUcAvlyXjbNKJZcW 6VxWA5/Ay1jLffRgGqNGtOaHbxYHrs7TuIYEj0Lnscdt6ZN4JwuMKdpSq+vnnwBxhgGO wtDinoCzItLF9Xc64PIQbAywuQ4uHemR1eXmypYowmtA/1hAqXnc82P00LM2k7pKqHeL HNWp+gGemTbQJ2Iq6Qv8cuEN2VkGroQbaZy7x1ks4FZbLKZFw327VZNI5cE85464kMMn 8xrw== X-Received: by 10.236.91.173 with SMTP id h33mr1388410yhf.120.1355831345000; Tue, 18 Dec 2012 03:49:05 -0800 (PST) Received: from salusa.poochiereds.net (cpe-107-015-113-143.nc.res.rr.com. [107.15.113.143]) by mx.google.com with ESMTPS id m69sm1246087yhd.6.2012.12.18.03.49.03 (version=SSLv3 cipher=OTHER); Tue, 18 Dec 2012 03:49:04 -0800 (PST) From: Jeff Layton To: smfrench@gmail.com Cc: linux-cifs@vger.kernel.org Subject: [PATCH] cifs: don't present the cifsFYI procfile when CONFIG_CIFS_DEBUG is disabled Date: Tue, 18 Dec 2012 06:48:59 -0500 Message-Id: <1355831339-22043-1-git-send-email-jlayton@redhat.com> X-Mailer: git-send-email 1.7.11.7 X-Gm-Message-State: ALoCoQknMV3BWJw8shbqcpyasWZQTCNrQC9PYUdx6p4+mow0bHekx83YZO/krZRH6UeKfV4BmULY Sender: linux-cifs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-cifs@vger.kernel.org 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 --- 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) {