diff options
author | Tom Tucker <tom@opengridcomputing.com> | 2007-12-30 22:07:44 -0500 |
---|---|---|
committer | J. Bruce Fields <bfields@citi.umich.edu> | 2008-02-01 16:42:09 -0500 |
commit | d7c9f1ed972b4a468dd24a2457721704dfe9ca70 (patch) | |
tree | 40cd2b38db79df4d90753b58789c3e4bc274095f | |
parent | b700cbb11fced2a0e953fdd19eac07ffaad86598 (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>
-rw-r--r-- | fs/lockd/svc.c | 17 | ||||
-rw-r--r-- | fs/nfs/callback.c | 4 | ||||
-rw-r--r-- | fs/nfsd/nfssvc.c | 4 | ||||
-rw-r--r-- | include/linux/sunrpc/svcsock.h | 1 | ||||
-rw-r--r-- | net/sunrpc/sunrpc_syms.c | 1 | ||||
-rw-r--r-- | net/sunrpc/svcsock.c | 22 |
6 files changed, 12 insertions, 37 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 | 222 | static int find_xprt(struct svc_serv *serv, char *proto) | |
223 | static 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(); |
diff --git a/include/linux/sunrpc/svcsock.h b/include/linux/sunrpc/svcsock.h index 9882ce0ee33c..3181d9d4caa0 100644 --- a/include/linux/sunrpc/svcsock.h +++ b/include/linux/sunrpc/svcsock.h | |||
@@ -67,7 +67,6 @@ struct svc_sock { | |||
67 | /* | 67 | /* |
68 | * Function prototypes. | 68 | * Function prototypes. |
69 | */ | 69 | */ |
70 | int svc_makesock(struct svc_serv *, int, unsigned short, int flags); | ||
71 | void svc_force_close_socket(struct svc_sock *); | 70 | void svc_force_close_socket(struct svc_sock *); |
72 | int svc_recv(struct svc_rqst *, long); | 71 | int svc_recv(struct svc_rqst *, long); |
73 | int svc_send(struct svc_rqst *); | 72 | int svc_send(struct svc_rqst *); |
diff --git a/net/sunrpc/sunrpc_syms.c b/net/sunrpc/sunrpc_syms.c index 11b309817b8f..ab8a7362e890 100644 --- a/net/sunrpc/sunrpc_syms.c +++ b/net/sunrpc/sunrpc_syms.c | |||
@@ -33,7 +33,6 @@ EXPORT_SYMBOL(svc_drop); | |||
33 | EXPORT_SYMBOL(svc_process); | 33 | EXPORT_SYMBOL(svc_process); |
34 | EXPORT_SYMBOL(svc_recv); | 34 | EXPORT_SYMBOL(svc_recv); |
35 | EXPORT_SYMBOL(svc_wake_up); | 35 | EXPORT_SYMBOL(svc_wake_up); |
36 | EXPORT_SYMBOL(svc_makesock); | ||
37 | EXPORT_SYMBOL(svc_reserve); | 36 | EXPORT_SYMBOL(svc_reserve); |
38 | EXPORT_SYMBOL(svc_auth_register); | 37 | EXPORT_SYMBOL(svc_auth_register); |
39 | EXPORT_SYMBOL(auth_domain_lookup); | 38 | EXPORT_SYMBOL(auth_domain_lookup); |
diff --git a/net/sunrpc/svcsock.c b/net/sunrpc/svcsock.c index 9f0f6d088969..e6bb1b0563ec 100644 --- a/net/sunrpc/svcsock.c +++ b/net/sunrpc/svcsock.c | |||
@@ -1988,28 +1988,6 @@ void svc_force_close_socket(struct svc_sock *svsk) | |||
1988 | svc_close_socket(svsk); | 1988 | svc_close_socket(svsk); |
1989 | } | 1989 | } |
1990 | 1990 | ||
1991 | /** | ||
1992 | * svc_makesock - Make a socket for nfsd and lockd | ||
1993 | * @serv: RPC server structure | ||
1994 | * @protocol: transport protocol to use | ||
1995 | * @port: port to use | ||
1996 | * @flags: requested socket characteristics | ||
1997 | * | ||
1998 | */ | ||
1999 | int svc_makesock(struct svc_serv *serv, int protocol, unsigned short port, | ||
2000 | int flags) | ||
2001 | { | ||
2002 | dprintk("svc: creating socket proto = %d\n", protocol); | ||
2003 | switch (protocol) { | ||
2004 | case IPPROTO_TCP: | ||
2005 | return svc_create_xprt(serv, "tcp", port, flags); | ||
2006 | case IPPROTO_UDP: | ||
2007 | return svc_create_xprt(serv, "udp", port, flags); | ||
2008 | default: | ||
2009 | return -EINVAL; | ||
2010 | } | ||
2011 | } | ||
2012 | |||
2013 | /* | 1991 | /* |
2014 | * Handle defer and revisit of requests | 1992 | * Handle defer and revisit of requests |
2015 | */ | 1993 | */ |