]> git.karo-electronics.de Git - mv-sheeva.git/commitdiff
SUNRPC/NFS: Add Kbuild dependencies for NFS_DEBUG/RPC_DEBUG
authorTrond Myklebust <Trond.Myklebust@netapp.com>
Sun, 18 Mar 2012 18:07:42 +0000 (14:07 -0400)
committerTrond Myklebust <Trond.Myklebust@netapp.com>
Tue, 20 Mar 2012 17:08:26 +0000 (13:08 -0400)
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>
fs/nfs/Kconfig
fs/nfs/inode.c
fs/nfs/mount_clnt.c
fs/nfs/nfsroot.c
include/linux/nfs_fs.h
include/linux/sunrpc/debug.h
net/sunrpc/Kconfig

index 7bce64c7060e8982e1b782fe334122e837f809c4..2a0e6c599147aac9e66a5969c9c00593aa0dd380 100644 (file)
@@ -144,3 +144,9 @@ config NFS_USE_KERNEL_DNS
        depends on NFS_V4 && !NFS_USE_LEGACY_DNS
        select DNS_RESOLVER
        default y
+
+config NFS_DEBUG
+       bool
+       depends on NFS_FS && SUNRPC_DEBUG
+       select CRC32
+       default y
index 1a19f8d30c1435ab7f572c2da59be13eeddfee65..7bb4d13c1cd5ecaa10bbab88b8942ccbd9f9b444 100644 (file)
@@ -1047,7 +1047,7 @@ struct nfs_fh *nfs_alloc_fhandle(void)
        return fh;
 }
 
-#ifdef RPC_DEBUG
+#ifdef NFS_DEBUG
 /*
  * _nfs_display_fhandle_hash - calculate the crc32 hash for the filehandle
  *                             in the same way that wireshark does
index b37ca34af9034110002a057cd40bd34b6df4f79b..8e65c7f1f87c526707959c0e691e36532406d1fa 100644 (file)
@@ -16,7 +16,7 @@
 #include <linux/nfs_fs.h>
 #include "internal.h"
 
-#ifdef RPC_DEBUG
+#ifdef NFS_DEBUG
 # define NFSDBG_FACILITY       NFSDBG_MOUNT
 #endif
 
index c4744e1d513c826545898e3310631c5f8153ae98..cd3c910d2d129ee687d197da97b00c9c0cb3cc13 100644 (file)
@@ -104,7 +104,7 @@ static char nfs_export_path[NFS_MAXPATHLEN + 1] __initdata = "";
 /* server:export path string passed to super.c */
 static char nfs_root_device[NFS_MAXPATHLEN + 1] __initdata = "";
 
-#ifdef RPC_DEBUG
+#ifdef NFS_DEBUG
 /*
  * When the "nfsrootdebug" kernel command line option is specified,
  * enable debugging messages for NFSROOT.
index 0a63ab2b5a7631f0993a35290cefd1a18238a1f6..8f27c2e36ddfd164fa6239ccfab73e0f568dc8b3 100644 (file)
 
 #ifdef __KERNEL__
 
+/*
+ * Enable dprintk() debugging support for nfs client.
+ */
+#ifdef CONFIG_NFS_DEBUG
+# define NFS_DEBUG
+#endif
+
 #include <linux/in.h>
 #include <linux/mm.h>
 #include <linux/pagemap.h>
@@ -391,7 +398,7 @@ static inline void nfs_free_fhandle(const struct nfs_fh *fh)
        kfree(fh);
 }
 
-#ifdef RPC_DEBUG
+#ifdef NFS_DEBUG
 extern u32 _nfs_display_fhandle_hash(const struct nfs_fh *fh);
 static inline u32 nfs_display_fhandle_hash(const struct nfs_fh *fh)
 {
@@ -650,14 +657,6 @@ nfs_fileid_to_ino_t(u64 fileid)
 
 #ifdef __KERNEL__
 
-/*
- * Enable debugging support for nfs client.
- * Requires RPC_DEBUG.
- */
-#ifdef RPC_DEBUG
-# define NFS_DEBUG
-#endif
-
 # undef ifdebug
 # ifdef NFS_DEBUG
 #  define ifdebug(fac)         if (unlikely(nfs_debug & NFSDBG_##fac))
index 6cb2517bcf759fe130a765e14ff63bab156f6a5e..9448eb5e426cb244c35f2adec7d0458673614609 100644 (file)
@@ -31,7 +31,7 @@
 /*
  * Enable RPC debugging/profiling.
  */
-#ifdef CONFIG_SYSCTL
+#ifdef CONFIG_SUNRPC_DEBUG
 #define  RPC_DEBUG
 #endif
 #ifdef CONFIG_TRACEPOINTS
index ffd243d09188dee10d2dffa34d642f7c941b9013..9fe8857d8d596e5eb59146416396b834b195b2c1 100644 (file)
@@ -39,3 +39,16 @@ config RPCSEC_GSS_KRB5
          Kerberos support should be installed.
 
          If unsure, say Y.
+
+config SUNRPC_DEBUG
+       bool "RPC: Enable dprintk debugging"
+       depends on SUNRPC && SYSCTL
+       help
+         This option enables a sysctl-based debugging interface
+         that is be used by the 'rpcdebug' utility to turn on or off
+         logging of different aspects of the kernel RPC activity.
+
+         Disabling this option will make your kernel slightly smaller,
+         but makes troubleshooting NFS issues significantly harder.
+
+         If unsure, say Y.