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,
dprintk("RPC: creating %s client for %s (xprt %p)\n",
program->name, servname, xprt);
#ifdef RPC_DEBUG
rpc_register_sysctl();
#endif
if (!xprt)
goto out;
if (vers >= program->nrvers || !(version = program->version[vers]))
......
......@@ -15,6 +15,7 @@
#define __NO_VERSION__
#include <linux/module.h>
#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/sched.h>
#include <linux/proc_fs.h>
......@@ -181,10 +182,9 @@ rpc_proc_exit(void)
}
}
#ifdef MODULE
int
init_module(void)
static int __init
init_sunrpc(void)
{
#ifdef RPC_DEBUG
rpc_register_sysctl();
......@@ -193,13 +193,14 @@ init_module(void)
return 0;
}
void
cleanup_module(void)
static void __exit
cleanup_sunrpc(void)
{
#ifdef RPC_DEBUG
rpc_unregister_sysctl();
#endif
rpc_proc_exit();
}
#endif
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)
{
struct svc_serv *serv;
#ifdef RPC_DEBUG
rpc_register_sysctl();
#endif
if (!(serv = (struct svc_serv *) kmalloc(sizeof(*serv), GFP_KERNEL)))
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