Commit 2b063bda authored by Neil Brown's avatar Neil Brown Committed by Linus Torvalds

[PATCH] PATCH 9/16: NFSD: RPC init tidyup

Get sunrpc to use module_init properly

rpc_register_sysctl was called in several places.
Now only once.
parent fac5a35a
...@@ -78,10 +78,6 @@ rpc_create_client(struct rpc_xprt *xprt, char *servname, ...@@ -78,10 +78,6 @@ rpc_create_client(struct rpc_xprt *xprt, char *servname,
dprintk("RPC: creating %s client for %s (xprt %p)\n", dprintk("RPC: creating %s client for %s (xprt %p)\n",
program->name, servname, xprt); program->name, servname, xprt);
#ifdef RPC_DEBUG
rpc_register_sysctl();
#endif
if (!xprt) if (!xprt)
goto out; goto out;
if (vers >= program->nrvers || !(version = program->version[vers])) if (vers >= program->nrvers || !(version = program->version[vers]))
......
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
#define __NO_VERSION__ #define __NO_VERSION__
#include <linux/module.h> #include <linux/module.h>
#include <linux/init.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/sched.h> #include <linux/sched.h>
#include <linux/proc_fs.h> #include <linux/proc_fs.h>
...@@ -181,10 +182,9 @@ rpc_proc_exit(void) ...@@ -181,10 +182,9 @@ rpc_proc_exit(void)
} }
} }
#ifdef MODULE
int static int __init
init_module(void) init_sunrpc(void)
{ {
#ifdef RPC_DEBUG #ifdef RPC_DEBUG
rpc_register_sysctl(); rpc_register_sysctl();
...@@ -193,13 +193,14 @@ init_module(void) ...@@ -193,13 +193,14 @@ init_module(void)
return 0; return 0;
} }
void static void __exit
cleanup_module(void) cleanup_sunrpc(void)
{ {
#ifdef RPC_DEBUG #ifdef RPC_DEBUG
rpc_unregister_sysctl(); rpc_unregister_sysctl();
#endif #endif
rpc_proc_exit(); rpc_proc_exit();
} }
#endif
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
module_init(init_sunrpc);
module_exit(cleanup_sunrpc);
...@@ -31,10 +31,6 @@ svc_create(struct svc_program *prog, unsigned int bufsize, unsigned int xdrsize) ...@@ -31,10 +31,6 @@ svc_create(struct svc_program *prog, unsigned int bufsize, unsigned int xdrsize)
{ {
struct svc_serv *serv; struct svc_serv *serv;
#ifdef RPC_DEBUG
rpc_register_sysctl();
#endif
if (!(serv = (struct svc_serv *) kmalloc(sizeof(*serv), GFP_KERNEL))) if (!(serv = (struct svc_serv *) kmalloc(sizeof(*serv), GFP_KERNEL)))
return NULL; return NULL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment