summaryrefslogtreecommitdiffstats
path: root/fs/lockd/mon.c
diff options
context:
space:
mode:
authorChuck Lever <chuck.lever@oracle.com>2008-12-11 17:56:37 -0500
committerJ. Bruce Fields <bfields@citi.umich.edu>2009-01-06 11:53:56 -0500
commit49b5699b3fc22b363534c509c1b7dba06bc677bf (patch)
treee5c1e0d74918a902f1830dddf170d8c07155204e /fs/lockd/mon.c
parentb7ba597fb964dfa44284904b3b3d74d44b8e1c42 (diff)
downloadop-kernel-dev-49b5699b3fc22b363534c509c1b7dba06bc677bf.zip
op-kernel-dev-49b5699b3fc22b363534c509c1b7dba06bc677bf.tar.gz
NSM: Move nsm_create()
Clean up: one last thing... relocate nsm_create() to eliminate the forward declaration and group it near the only function that actually uses it. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
Diffstat (limited to 'fs/lockd/mon.c')
-rw-r--r--fs/lockd/mon.c51
1 files changed, 20 insertions, 31 deletions
diff --git a/fs/lockd/mon.c b/fs/lockd/mon.c
index fafa0ea..5e2c4d5 100644
--- a/fs/lockd/mon.c
+++ b/fs/lockd/mon.c
@@ -44,8 +44,6 @@ struct nsm_res {
u32 state;
};
-static struct rpc_clnt * nsm_create(void);
-
static struct rpc_program nsm_program;
static LIST_HEAD(nsm_handles);
static DEFINE_SPINLOCK(nsm_lock);
@@ -98,11 +96,26 @@ static void nsm_display_address(const struct sockaddr *sap,
}
}
-/*
- * Common procedure for NSMPROC_MON/NSMPROC_UNMON calls
- */
-static int
-nsm_mon_unmon(struct nsm_handle *nsm, u32 proc, struct nsm_res *res)
+static struct rpc_clnt *nsm_create(void)
+{
+ struct sockaddr_in sin = {
+ .sin_family = AF_INET,
+ .sin_addr.s_addr = htonl(INADDR_LOOPBACK),
+ };
+ struct rpc_create_args args = {
+ .protocol = XPRT_TRANSPORT_UDP,
+ .address = (struct sockaddr *)&sin,
+ .addrsize = sizeof(sin),
+ .servername = "rpc.statd",
+ .program = &nsm_program,
+ .version = NSM_VERSION,
+ .authflavor = RPC_AUTH_NULL,
+ };
+
+ return rpc_create(&args);
+}
+
+static int nsm_mon_unmon(struct nsm_handle *nsm, u32 proc, struct nsm_res *res)
{
struct rpc_clnt *clnt;
int status;
@@ -409,30 +422,6 @@ void nsm_release(struct nsm_handle *nsm)
}
/*
- * Create NSM client for the local host
- */
-static struct rpc_clnt *
-nsm_create(void)
-{
- struct sockaddr_in sin = {
- .sin_family = AF_INET,
- .sin_addr.s_addr = htonl(INADDR_LOOPBACK),
- .sin_port = 0,
- };
- struct rpc_create_args args = {
- .protocol = XPRT_TRANSPORT_UDP,
- .address = (struct sockaddr *)&sin,
- .addrsize = sizeof(sin),
- .servername = "localhost",
- .program = &nsm_program,
- .version = NSM_VERSION,
- .authflavor = RPC_AUTH_NULL,
- };
-
- return rpc_create(&args);
-}
-
-/*
* XDR functions for NSM.
*
* See http://www.opengroup.org/ for details on the Network
OpenPOWER on IntegriCloud