aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorTom Tucker <tom@opengridcomputing.com>2007-12-30 22:07:44 -0500
committerJ. Bruce Fields <bfields@citi.umich.edu>2008-02-01 16:42:09 -0500
commitd7c9f1ed972b4a468dd24a2457721704dfe9ca70 (patch)
tree40cd2b38db79df4d90753b58789c3e4bc274095f /fs
parentb700cbb11fced2a0e953fdd19eac07ffaad86598 (diff)
svc: Change services to use new svc_create_xprt service
Modify the various kernel RPC svcs to use the svc_create_xprt service. Signed-off-by: Tom Tucker <tom@opengridcomputing.com> Acked-by: Neil Brown <neilb@suse.de> Reviewed-by: Chuck Lever <chuck.lever@oracle.com> Reviewed-by: Greg Banks <gnb@sgi.com> Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
Diffstat (limited to 'fs')
-rw-r--r--fs/lockd/svc.c17
-rw-r--r--fs/nfs/callback.c4
-rw-r--r--fs/nfsd/nfssvc.c4
3 files changed, 12 insertions, 13 deletions
diff --git a/fs/lockd/svc.c b/fs/lockd/svc.c
index 82e2192a0d5c..868691535115 100644
--- a/fs/lockd/svc.c
+++ b/fs/lockd/svc.c
@@ -219,13 +219,12 @@ lockd(struct svc_rqst *rqstp)
219 module_put_and_exit(0); 219 module_put_and_exit(0);
220} 220}
221 221
222 222static int find_xprt(struct svc_serv *serv, char *proto)
223static int find_socket(struct svc_serv *serv, int proto)
224{ 223{
225 struct svc_sock *svsk; 224 struct svc_sock *svsk;
226 int found = 0; 225 int found = 0;
227 list_for_each_entry(svsk, &serv->sv_permsocks, sk_list) 226 list_for_each_entry(svsk, &serv->sv_permsocks, sk_list)
228 if (svsk->sk_sk->sk_protocol == proto) { 227 if (strcmp(svsk->sk_xprt.xpt_class->xcl_name, proto) == 0) {
229 found = 1; 228 found = 1;
230 break; 229 break;
231 } 230 }
@@ -243,13 +242,13 @@ static int make_socks(struct svc_serv *serv, int proto)
243 int err = 0; 242 int err = 0;
244 243
245 if (proto == IPPROTO_UDP || nlm_udpport) 244 if (proto == IPPROTO_UDP || nlm_udpport)
246 if (!find_socket(serv, IPPROTO_UDP)) 245 if (!find_xprt(serv, "udp"))
247 err = svc_makesock(serv, IPPROTO_UDP, nlm_udpport, 246 err = svc_create_xprt(serv, "udp", nlm_udpport,
248 SVC_SOCK_DEFAULTS); 247 SVC_SOCK_DEFAULTS);
249 if (err >= 0 && (proto == IPPROTO_TCP || nlm_tcpport)) 248 if (err >= 0 && (proto == IPPROTO_TCP || nlm_tcpport))
250 if (!find_socket(serv, IPPROTO_TCP)) 249 if (!find_xprt(serv, "tcp"))
251 err = svc_makesock(serv, IPPROTO_TCP, nlm_tcpport, 250 err = svc_create_xprt(serv, "tcp", nlm_tcpport,
252 SVC_SOCK_DEFAULTS); 251 SVC_SOCK_DEFAULTS);
253 252
254 if (err >= 0) { 253 if (err >= 0) {
255 warned = 0; 254 warned = 0;
diff --git a/fs/nfs/callback.c b/fs/nfs/callback.c
index 9b6bbf1b9787..bd185a572a23 100644
--- a/fs/nfs/callback.c
+++ b/fs/nfs/callback.c
@@ -119,8 +119,8 @@ int nfs_callback_up(void)
119 if (!serv) 119 if (!serv)
120 goto out_err; 120 goto out_err;
121 121
122 ret = svc_makesock(serv, IPPROTO_TCP, nfs_callback_set_tcpport, 122 ret = svc_create_xprt(serv, "tcp", nfs_callback_set_tcpport,
123 SVC_SOCK_ANONYMOUS); 123 SVC_SOCK_ANONYMOUS);
124 if (ret <= 0) 124 if (ret <= 0)
125 goto out_destroy; 125 goto out_destroy;
126 nfs_callback_tcpport = ret; 126 nfs_callback_tcpport = ret;
diff --git a/fs/nfsd/nfssvc.c b/fs/nfsd/nfssvc.c
index 1190aeaa92be..a828b0b0fb67 100644
--- a/fs/nfsd/nfssvc.c
+++ b/fs/nfsd/nfssvc.c
@@ -236,7 +236,7 @@ static int nfsd_init_socks(int port)
236 236
237 error = lockd_up(IPPROTO_UDP); 237 error = lockd_up(IPPROTO_UDP);
238 if (error >= 0) { 238 if (error >= 0) {
239 error = svc_makesock(nfsd_serv, IPPROTO_UDP, port, 239 error = svc_create_xprt(nfsd_serv, "udp", port,
240 SVC_SOCK_DEFAULTS); 240 SVC_SOCK_DEFAULTS);
241 if (error < 0) 241 if (error < 0)
242 lockd_down(); 242 lockd_down();
@@ -247,7 +247,7 @@ static int nfsd_init_socks(int port)
247#ifdef CONFIG_NFSD_TCP 247#ifdef CONFIG_NFSD_TCP
248 error = lockd_up(IPPROTO_TCP); 248 error = lockd_up(IPPROTO_TCP);
249 if (error >= 0) { 249 if (error >= 0) {
250 error = svc_makesock(nfsd_serv, IPPROTO_TCP, port, 250 error = svc_create_xprt(nfsd_serv, "tcp", port,
251 SVC_SOCK_DEFAULTS); 251 SVC_SOCK_DEFAULTS);
252 if (error < 0) 252 if (error < 0)
253 lockd_down(); 253 lockd_down();