aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/nfsroot.c
diff options
context:
space:
mode:
authorChuck Lever <chuck.lever@oracle.com>2010-09-17 10:54:37 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2010-09-17 10:54:37 -0400
commit306a075362a288683f6346185f97dd0e06df19da (patch)
treebcade14a2a0b634c5bf64eab87db8219d8d6981c /fs/nfs/nfsroot.c
parent8d2321037896aa4868a67f45b2d6ed52b579a48a (diff)
NFS: Allow NFSROOT debugging messages to be enabled dynamically
As a convenience, introduce a kernel command line option to enable NFSROOT debugging messages. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/nfsroot.c')
-rw-r--r--fs/nfs/nfsroot.c19
1 files changed, 13 insertions, 6 deletions
diff --git a/fs/nfs/nfsroot.c b/fs/nfs/nfsroot.c
index 8e7d623173a9..460df3652889 100644
--- a/fs/nfs/nfsroot.c
+++ b/fs/nfs/nfsroot.c
@@ -67,6 +67,7 @@
67 * NFS over TCP. 67 * NFS over TCP.
68 * Fabian Frederick: Option parser rebuilt (using parser lib) 68 * Fabian Frederick: Option parser rebuilt (using parser lib)
69 * Chuck Lever : Use super.c's text-based mount option parsing 69 * Chuck Lever : Use super.c's text-based mount option parsing
70 * Chuck Lever : Add "nfsrootdebug".
70 */ 71 */
71 72
72#include <linux/types.h> 73#include <linux/types.h>
@@ -80,8 +81,6 @@
80 81
81#include "internal.h" 82#include "internal.h"
82 83
83/* Define this to allow debugging output */
84#undef NFSROOT_DEBUG
85#define NFSDBG_FACILITY NFSDBG_ROOT 84#define NFSDBG_FACILITY NFSDBG_ROOT
86 85
87/* Default path we try to mount. "%s" gets replaced by our IP address */ 86/* Default path we try to mount. "%s" gets replaced by our IP address */
@@ -103,6 +102,18 @@ static char nfs_export_path[NFS_MAXPATHLEN + 1] __initdata = "";
103static char nfs_root_device[NFS_MAXPATHLEN + 1] __initdata = ""; 102static char nfs_root_device[NFS_MAXPATHLEN + 1] __initdata = "";
104 103
105/* 104/*
105 * When the "nfsrootdebug" kernel command line option is specified,
106 * enable debugging messages for NFSROOT.
107 */
108static int __init nfs_root_debug(char *__unused)
109{
110 nfs_debug |= NFSDBG_ROOT | NFSDBG_MOUNT;
111 return 1;
112}
113
114__setup("nfsrootdebug", nfs_root_debug);
115
116/*
106 * Parse NFS server and directory information passed on the kernel 117 * Parse NFS server and directory information passed on the kernel
107 * command line. 118 * command line.
108 * 119 *
@@ -282,10 +293,6 @@ out_devnametoolong:
282 */ 293 */
283int __init nfs_root_data(char **root_device, char **root_data) 294int __init nfs_root_data(char **root_device, char **root_data)
284{ 295{
285#ifdef NFSROOT_DEBUG
286 nfs_debug |= NFSDBG_ROOT | NFSDBG_MOUNT;
287#endif /* NFSROOT_DEBUG */
288
289 servaddr = root_server_addr; 296 servaddr = root_server_addr;
290 if (servaddr == htonl(INADDR_NONE)) { 297 if (servaddr == htonl(INADDR_NONE)) {
291 printk(KERN_ERR "Root-NFS: no NFS server address\n"); 298 printk(KERN_ERR "Root-NFS: no NFS server address\n");