All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 4/4] Make sunrpc and lockd use register_sysctl_table_path
@ 2006-08-03 11:05 Olaf Kirch
  0 siblings, 0 replies; only message in thread
From: Olaf Kirch @ 2006-08-03 11:05 UTC (permalink / raw)
  To: nfs

From: Olaf Kirch <okir@suse.de>
Subject: Make sunrpc and lockd use register_sysctl_table_path

  This changes lockd and sunrpc to use the new register_sysctl_table_path
  call.

Signed-off-by: Olaf Kirch <okir@suse.de>

 fs/lockd/svc.c      |   29 ++++++-----------------------
 net/sunrpc/sysctl.c |   16 ++++------------
 2 files changed, 10 insertions(+), 35 deletions(-)

Index: linux-2.6.18/net/sunrpc/sysctl.c
===================================================================
--- linux-2.6.18.orig/net/sunrpc/sysctl.c
+++ linux-2.6.18/net/sunrpc/sysctl.c
@@ -38,7 +38,9 @@ void
 rpc_register_sysctl(void)
 {
 	if (!sunrpc_table_header) {
-		sunrpc_table_header = register_sysctl_table(sunrpc_table, 1);
+		struct ctl_path ctl_path[] = { { CTL_SUNRPC, "sunrpc", 0555 }, { 0 } };
+
+		sunrpc_table_header = register_sysctl_table_path(sunrpc_table, ctl_path);
 #ifdef CONFIG_PROC_FS
 		if (sunrpc_table[0].de)
 			sunrpc_table[0].de->owner = THIS_MODULE;
@@ -125,7 +127,7 @@ static unsigned int max_slot_table_size 
 static unsigned int xprt_min_resvport_limit = RPC_MIN_RESVPORT;
 static unsigned int xprt_max_resvport_limit = RPC_MAX_RESVPORT;
 
-static ctl_table debug_table[] = {
+static ctl_table sunrpc_table[] = {
 	{
 		.ctl_name	= CTL_RPCDEBUG,
 		.procname	= "rpc_debug",
@@ -205,14 +207,4 @@ static ctl_table debug_table[] = {
 	{ .ctl_name = 0 }
 };
 
-static ctl_table sunrpc_table[] = {
-	{
-		.ctl_name	= CTL_SUNRPC,
-		.procname	= "sunrpc",
-		.mode		= 0555,
-		.child		= debug_table
-	},
-	{ .ctl_name = 0 }
-};
-
 #endif
Index: linux-2.6.18/fs/lockd/svc.c
===================================================================
--- linux-2.6.18.orig/fs/lockd/svc.c
+++ linux-2.6.18/fs/lockd/svc.c
@@ -371,26 +371,6 @@ static ctl_table nlm_sysctls[] = {
 	{ .ctl_name = 0 }
 };
 
-static ctl_table nlm_sysctl_dir[] = {
-	{
-		.ctl_name	= CTL_UNNUMBERED,
-		.procname	= "nfs",
-		.mode		= 0555,
-		.child		= nlm_sysctls,
-	},
-	{ .ctl_name = 0 }
-};
-
-static ctl_table nlm_sysctl_root[] = {
-	{
-		.ctl_name	= CTL_FS,
-		.procname	= "fs",
-		.mode		= 0555,
-		.child		= nlm_sysctl_dir,
-	},
-	{ .ctl_name = 0 }
-};
-
 /*
  * Module (and driverfs) parameters.
  */
@@ -463,15 +443,18 @@ module_param_call(nlm_tcpport, param_set
 
 static int __init init_nlm(void)
 {
-	nlm_sysctl_table = register_sysctl_table(nlm_sysctl_root, 0);
-	return nlm_sysctl_table ? 0 : -ENOMEM;
+	struct ctl_path ctl_path[] = { { CTL_FS, "fs", 0555 }, { -2, "nfs", 0555 }, { 0 } };
+
+	nlm_sysctl_table = register_sysctl_table_path(nlm_sysctls, ctl_path);
+	return 0;
 }
 
 static void __exit exit_nlm(void)
 {
 	/* FIXME: delete all NLM clients */
 	nlm_shutdown_hosts();
-	unregister_sysctl_table(nlm_sysctl_table);
+	if (nlm_sysctl_table)
+		unregister_sysctl_table(nlm_sysctl_table);
 }
 
 module_init(init_nlm);

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
NFS maillist  -  NFS@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nfs

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2006-08-03 11:05 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-08-03 11:05 [PATCH 4/4] Make sunrpc and lockd use register_sysctl_table_path Olaf Kirch

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.