aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTrond Myklebust <Trond.Myklebust@netapp.com>2012-03-18 14:07:42 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2012-03-20 13:08:26 -0400
commite27d359e9b7e446190362cd5c8fe281d02194896 (patch)
tree5dece1801337b32e9d4ecc03e487a95856b413fa
parent3b3be88d67cc17d0f0ab6edaf131516793fc947e (diff)
SUNRPC/NFS: Add Kbuild dependencies for NFS_DEBUG/RPC_DEBUG
This allows us to turn on/off the dprintk() debugging interfaces for those distributions that don't ship the 'rpcdebug' utility. It also allows us to add Kbuild dependencies. Specifically, we already know that dprintk() in general relies on CONFIG_SYSCTL. Now it turns out that the NFS dprintks depend on CONFIG_CRC32 after we added support for the filehandle hash. Reported-by: Paul Gortmaker <paul.gortmaker@windriver.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
-rw-r--r--fs/nfs/Kconfig6
-rw-r--r--fs/nfs/inode.c2
-rw-r--r--fs/nfs/mount_clnt.c2
-rw-r--r--fs/nfs/nfsroot.c2
-rw-r--r--include/linux/nfs_fs.h17
-rw-r--r--include/linux/sunrpc/debug.h2
-rw-r--r--net/sunrpc/Kconfig13
7 files changed, 31 insertions, 13 deletions
diff --git a/fs/nfs/Kconfig b/fs/nfs/Kconfig
index 7bce64c7060e..2a0e6c599147 100644
--- a/fs/nfs/Kconfig
+++ b/fs/nfs/Kconfig
@@ -144,3 +144,9 @@ config NFS_USE_KERNEL_DNS
144 depends on NFS_V4 && !NFS_USE_LEGACY_DNS 144 depends on NFS_V4 && !NFS_USE_LEGACY_DNS
145 select DNS_RESOLVER 145 select DNS_RESOLVER
146 default y 146 default y
147
148config NFS_DEBUG
149 bool
150 depends on NFS_FS && SUNRPC_DEBUG
151 select CRC32
152 default y
diff --git a/fs/nfs/inode.c b/fs/nfs/inode.c
index 1a19f8d30c14..7bb4d13c1cd5 100644
--- a/fs/nfs/inode.c
+++ b/fs/nfs/inode.c
@@ -1047,7 +1047,7 @@ struct nfs_fh *nfs_alloc_fhandle(void)
1047 return fh; 1047 return fh;
1048} 1048}
1049 1049
1050#ifdef RPC_DEBUG 1050#ifdef NFS_DEBUG
1051/* 1051/*
1052 * _nfs_display_fhandle_hash - calculate the crc32 hash for the filehandle 1052 * _nfs_display_fhandle_hash - calculate the crc32 hash for the filehandle
1053 * in the same way that wireshark does 1053 * in the same way that wireshark does
diff --git a/fs/nfs/mount_clnt.c b/fs/nfs/mount_clnt.c
index b37ca34af903..8e65c7f1f87c 100644
--- a/fs/nfs/mount_clnt.c
+++ b/fs/nfs/mount_clnt.c
@@ -16,7 +16,7 @@
16#include <linux/nfs_fs.h> 16#include <linux/nfs_fs.h>
17#include "internal.h" 17#include "internal.h"
18 18
19#ifdef RPC_DEBUG 19#ifdef NFS_DEBUG
20# define NFSDBG_FACILITY NFSDBG_MOUNT 20# define NFSDBG_FACILITY NFSDBG_MOUNT
21#endif 21#endif
22 22
diff --git a/fs/nfs/nfsroot.c b/fs/nfs/nfsroot.c
index c4744e1d513c..cd3c910d2d12 100644
--- a/fs/nfs/nfsroot.c
+++ b/fs/nfs/nfsroot.c
@@ -104,7 +104,7 @@ static char nfs_export_path[NFS_MAXPATHLEN + 1] __initdata = "";
104/* server:export path string passed to super.c */ 104/* server:export path string passed to super.c */
105static char nfs_root_device[NFS_MAXPATHLEN + 1] __initdata = ""; 105static char nfs_root_device[NFS_MAXPATHLEN + 1] __initdata = "";
106 106
107#ifdef RPC_DEBUG 107#ifdef NFS_DEBUG
108/* 108/*
109 * When the "nfsrootdebug" kernel command line option is specified, 109 * When the "nfsrootdebug" kernel command line option is specified,
110 * enable debugging messages for NFSROOT. 110 * enable debugging messages for NFSROOT.
diff --git a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h
index 0a63ab2b5a76..8f27c2e36ddf 100644
--- a/include/linux/nfs_fs.h
+++ b/include/linux/nfs_fs.h
@@ -38,6 +38,13 @@
38 38
39#ifdef __KERNEL__ 39#ifdef __KERNEL__
40 40
41/*
42 * Enable dprintk() debugging support for nfs client.
43 */
44#ifdef CONFIG_NFS_DEBUG
45# define NFS_DEBUG
46#endif
47
41#include <linux/in.h> 48#include <linux/in.h>
42#include <linux/mm.h> 49#include <linux/mm.h>
43#include <linux/pagemap.h> 50#include <linux/pagemap.h>
@@ -391,7 +398,7 @@ static inline void nfs_free_fhandle(const struct nfs_fh *fh)
391 kfree(fh); 398 kfree(fh);
392} 399}
393 400
394#ifdef RPC_DEBUG 401#ifdef NFS_DEBUG
395extern u32 _nfs_display_fhandle_hash(const struct nfs_fh *fh); 402extern u32 _nfs_display_fhandle_hash(const struct nfs_fh *fh);
396static inline u32 nfs_display_fhandle_hash(const struct nfs_fh *fh) 403static inline u32 nfs_display_fhandle_hash(const struct nfs_fh *fh)
397{ 404{
@@ -650,14 +657,6 @@ nfs_fileid_to_ino_t(u64 fileid)
650 657
651#ifdef __KERNEL__ 658#ifdef __KERNEL__
652 659
653/*
654 * Enable debugging support for nfs client.
655 * Requires RPC_DEBUG.
656 */
657#ifdef RPC_DEBUG
658# define NFS_DEBUG
659#endif
660
661# undef ifdebug 660# undef ifdebug
662# ifdef NFS_DEBUG 661# ifdef NFS_DEBUG
663# define ifdebug(fac) if (unlikely(nfs_debug & NFSDBG_##fac)) 662# define ifdebug(fac) if (unlikely(nfs_debug & NFSDBG_##fac))
diff --git a/include/linux/sunrpc/debug.h b/include/linux/sunrpc/debug.h
index 6cb2517bcf75..9448eb5e426c 100644
--- a/include/linux/sunrpc/debug.h
+++ b/include/linux/sunrpc/debug.h
@@ -31,7 +31,7 @@
31/* 31/*
32 * Enable RPC debugging/profiling. 32 * Enable RPC debugging/profiling.
33 */ 33 */
34#ifdef CONFIG_SYSCTL 34#ifdef CONFIG_SUNRPC_DEBUG
35#define RPC_DEBUG 35#define RPC_DEBUG
36#endif 36#endif
37#ifdef CONFIG_TRACEPOINTS 37#ifdef CONFIG_TRACEPOINTS
diff --git a/net/sunrpc/Kconfig b/net/sunrpc/Kconfig
index ffd243d09188..9fe8857d8d59 100644
--- a/net/sunrpc/Kconfig
+++ b/net/sunrpc/Kconfig
@@ -39,3 +39,16 @@ config RPCSEC_GSS_KRB5
39 Kerberos support should be installed. 39 Kerberos support should be installed.
40 40
41 If unsure, say Y. 41 If unsure, say Y.
42
43config SUNRPC_DEBUG
44 bool "RPC: Enable dprintk debugging"
45 depends on SUNRPC && SYSCTL
46 help
47 This option enables a sysctl-based debugging interface
48 that is be used by the 'rpcdebug' utility to turn on or off
49 logging of different aspects of the kernel RPC activity.
50
51 Disabling this option will make your kernel slightly smaller,
52 but makes troubleshooting NFS issues significantly harder.
53
54 If unsure, say Y.