Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 127475
b: refs/heads/master
c: 49b5699
h: refs/heads/master
i:
  127473: bb4241d
  127471: ddf4635
v: v3
  • Loading branch information
Chuck Lever authored and J. Bruce Fields committed Jan 6, 2009
1 parent 7da2465 commit d2e994e
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 32 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: b7ba597fb964dfa44284904b3b3d74d44b8e1c42
refs/heads/master: 49b5699b3fc22b363534c509c1b7dba06bc677bf
51 changes: 20 additions & 31 deletions trunk/fs/lockd/mon.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -408,30 +421,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.
*
Expand Down

0 comments on commit d2e994e

Please sign in to comment.