aboutsummaryrefslogtreecommitdiffstats
path: root/fs/lockd/svc.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2008-02-01 22:31:28 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2008-02-01 22:31:28 -0500
commit63e9b66e29357dd12e8b1d3ebf7036e7591f81e3 (patch)
tree5aa6a70a8f4bbf306e2825a1e2fa2660c2c1c187 /fs/lockd/svc.c
parent687fcdf741e4a268c2c7bac8b3734de761bb9719 (diff)
parentea339d46b93c7b16e067a29aad1812f7a389815a (diff)
Merge branch 'for-linus' of git://linux-nfs.org/~bfields/linux
* 'for-linus' of git://linux-nfs.org/~bfields/linux: (100 commits) SUNRPC: RPC program information is stored in unsigned integers SUNRPC: Move exported symbol definitions after function declaration part 2 NLM: tear down RPC clients in nlm_shutdown_hosts SUNRPC: spin svc_rqst initialization to its own function nfsd: more careful input validation in nfsctl write methods lockd: minor log message fix knfsd: don't bother mapping putrootfh enoent to eperm rdma: makefile rdma: ONCRPC RDMA protocol marshalling rdma: SVCRDMA sendto rdma: SVCRDMA recvfrom rdma: SVCRDMA Core Transport Services rdma: SVCRDMA Transport Module rdma: SVCRMDA Header File svc: Add svc_xprt_names service to replace svc_sock_names knfsd: Support adding transports by writing portlist file svc: Add svc API that queries for a transport instance svc: Add /proc/sys/sunrpc/transport files svc: Add transport hdr size for defer/revisit svc: Move the xprt independent code to the svc_xprt.c file ...
Diffstat (limited to 'fs/lockd/svc.c')
-rw-r--r--fs/lockd/svc.c39
1 files changed, 17 insertions, 22 deletions
diff --git a/fs/lockd/svc.c b/fs/lockd/svc.c
index 82e2192a0d5c..08226464e563 100644
--- a/fs/lockd/svc.c
+++ b/fs/lockd/svc.c
@@ -219,19 +219,6 @@ lockd(struct svc_rqst *rqstp)
219 module_put_and_exit(0); 219 module_put_and_exit(0);
220} 220}
221 221
222
223static int find_socket(struct svc_serv *serv, int proto)
224{
225 struct svc_sock *svsk;
226 int found = 0;
227 list_for_each_entry(svsk, &serv->sv_permsocks, sk_list)
228 if (svsk->sk_sk->sk_protocol == proto) {
229 found = 1;
230 break;
231 }
232 return found;
233}
234
235/* 222/*
236 * Make any sockets that are needed but not present. 223 * Make any sockets that are needed but not present.
237 * If nlm_udpport or nlm_tcpport were set as module 224 * If nlm_udpport or nlm_tcpport were set as module
@@ -240,17 +227,25 @@ static int find_socket(struct svc_serv *serv, int proto)
240static int make_socks(struct svc_serv *serv, int proto) 227static int make_socks(struct svc_serv *serv, int proto)
241{ 228{
242 static int warned; 229 static int warned;
230 struct svc_xprt *xprt;
243 int err = 0; 231 int err = 0;
244 232
245 if (proto == IPPROTO_UDP || nlm_udpport) 233 if (proto == IPPROTO_UDP || nlm_udpport) {
246 if (!find_socket(serv, IPPROTO_UDP)) 234 xprt = svc_find_xprt(serv, "udp", 0, 0);
247 err = svc_makesock(serv, IPPROTO_UDP, nlm_udpport, 235 if (!xprt)
248 SVC_SOCK_DEFAULTS); 236 err = svc_create_xprt(serv, "udp", nlm_udpport,
249 if (err >= 0 && (proto == IPPROTO_TCP || nlm_tcpport)) 237 SVC_SOCK_DEFAULTS);
250 if (!find_socket(serv, IPPROTO_TCP)) 238 else
251 err = svc_makesock(serv, IPPROTO_TCP, nlm_tcpport, 239 svc_xprt_put(xprt);
252 SVC_SOCK_DEFAULTS); 240 }
253 241 if (err >= 0 && (proto == IPPROTO_TCP || nlm_tcpport)) {
242 xprt = svc_find_xprt(serv, "tcp", 0, 0);
243 if (!xprt)
244 err = svc_create_xprt(serv, "tcp", nlm_tcpport,
245 SVC_SOCK_DEFAULTS);
246 else
247 svc_xprt_put(xprt);
248 }
254 if (err >= 0) { 249 if (err >= 0) {
255 warned = 0; 250 warned = 0;
256 err = 0; 251 err = 0;