Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 127485
b: refs/heads/master
c: d3fe5ea
h: refs/heads/master
i:
  127483: 535f159
v: v3
  • Loading branch information
Chuck Lever authored and J. Bruce Fields committed Jan 7, 2009
1 parent 0bd1a1f commit 8bfc0a3
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 16 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: 55ef1274dddd4de387c54d110e354ffbb6cdc706
refs/heads/master: d3fe5ea7cf815c037c90b1f1464ffc1ab5e8601b
31 changes: 16 additions & 15 deletions trunk/fs/lockd/svc.c
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,19 @@ lockd(void *vrqstp)
return 0;
}

static int create_lockd_listener(struct svc_serv *serv, char *name,
unsigned short port)
{
struct svc_xprt *xprt;

xprt = svc_find_xprt(serv, name, 0, 0);
if (xprt == NULL)
return svc_create_xprt(serv, name, port, SVC_SOCK_DEFAULTS);

svc_xprt_put(xprt);
return 0;
}

/*
* Ensure there are active UDP and TCP listeners for lockd.
*
Expand All @@ -217,23 +230,11 @@ lockd(void *vrqstp)
static int make_socks(struct svc_serv *serv)
{
static int warned;
struct svc_xprt *xprt;
int err = 0;

xprt = svc_find_xprt(serv, "udp", 0, 0);
if (!xprt)
err = svc_create_xprt(serv, "udp", nlm_udpport,
SVC_SOCK_DEFAULTS);
else
svc_xprt_put(xprt);
if (err >= 0) {
xprt = svc_find_xprt(serv, "tcp", 0, 0);
if (!xprt)
err = svc_create_xprt(serv, "tcp", nlm_tcpport,
SVC_SOCK_DEFAULTS);
else
svc_xprt_put(xprt);
}
err = create_lockd_listener(serv, "udp", nlm_udpport);
if (err >= 0)
err = create_lockd_listener(serv, "tcp", nlm_tcpport);
if (err >= 0) {
warned = 0;
err = 0;
Expand Down

0 comments on commit 8bfc0a3

Please sign in to comment.