aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChuck Lever <chuck.lever@oracle.com>2008-03-14 14:18:30 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2008-03-19 18:00:44 -0400
commit90d5b18061656993410dfd57ddb88aa5a3f34563 (patch)
tree7e640753a3961d5af11518f046ed11920c8f649d
parent1e40316bc44851c5920490df01482ed862e4dbc4 (diff)
NLM: LOCKD fails to load if CONFIG_SYSCTL is not set
Bruce Fields says: "By the way, we've got another config-related nit here: http://bugzilla.linux-nfs.org/show_bug.cgi?id=156 You can build lockd without CONFIG_SYSCTL set, but then the module will fail to load." For now, disable the sysctl registration calls in lockd if CONFIG_SYSCTL is not enabled. This allows the kernel to build properly if PROC_FS or SYSCTL is not enabled, but an NFS client is desired. In the long run, we would like to be able to build the kernel with an NFS client but without lockd. This makes sense, for example, if you want an NFSv4-only NFS client, as NFSv4 doesn't use NLM at all. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
-rw-r--r--fs/lockd/svc.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/fs/lockd/svc.c b/fs/lockd/svc.c
index 1ed8bd4de941..38c2f0b1dd7d 100644
--- a/fs/lockd/svc.c
+++ b/fs/lockd/svc.c
@@ -74,7 +74,9 @@ static const unsigned long nlm_timeout_min = 3;
74static const unsigned long nlm_timeout_max = 20; 74static const unsigned long nlm_timeout_max = 20;
75static const int nlm_port_min = 0, nlm_port_max = 65535; 75static const int nlm_port_min = 0, nlm_port_max = 65535;
76 76
77#ifdef CONFIG_SYSCTL
77static struct ctl_table_header * nlm_sysctl_table; 78static struct ctl_table_header * nlm_sysctl_table;
79#endif
78 80
79static unsigned long get_lockd_grace_period(void) 81static unsigned long get_lockd_grace_period(void)
80{ 82{
@@ -359,6 +361,8 @@ out:
359} 361}
360EXPORT_SYMBOL(lockd_down); 362EXPORT_SYMBOL(lockd_down);
361 363
364#ifdef CONFIG_SYSCTL
365
362/* 366/*
363 * Sysctl parameters (same as module parameters, different interface). 367 * Sysctl parameters (same as module parameters, different interface).
364 */ 368 */
@@ -443,6 +447,8 @@ static ctl_table nlm_sysctl_root[] = {
443 { .ctl_name = 0 } 447 { .ctl_name = 0 }
444}; 448};
445 449
450#endif /* CONFIG_SYSCTL */
451
446/* 452/*
447 * Module (and sysfs) parameters. 453 * Module (and sysfs) parameters.
448 */ 454 */
@@ -516,15 +522,21 @@ module_param(nsm_use_hostnames, bool, 0644);
516 522
517static int __init init_nlm(void) 523static int __init init_nlm(void)
518{ 524{
525#ifdef CONFIG_SYSCTL
519 nlm_sysctl_table = register_sysctl_table(nlm_sysctl_root); 526 nlm_sysctl_table = register_sysctl_table(nlm_sysctl_root);
520 return nlm_sysctl_table ? 0 : -ENOMEM; 527 return nlm_sysctl_table ? 0 : -ENOMEM;
528#else
529 return 0;
530#endif
521} 531}
522 532
523static void __exit exit_nlm(void) 533static void __exit exit_nlm(void)
524{ 534{
525 /* FIXME: delete all NLM clients */ 535 /* FIXME: delete all NLM clients */
526 nlm_shutdown_hosts(); 536 nlm_shutdown_hosts();
537#ifdef CONFIG_SYSCTL
527 unregister_sysctl_table(nlm_sysctl_table); 538 unregister_sysctl_table(nlm_sysctl_table);
539#endif
528} 540}
529 541
530module_init(init_nlm); 542module_init(init_nlm);