]> err.no Git - linux-2.6/commitdiff
svc: Change services to use new svc_create_xprt service
authorTom Tucker <tom@opengridcomputing.com>
Mon, 31 Dec 2007 03:07:44 +0000 (21:07 -0600)
committerJ. Bruce Fields <bfields@citi.umich.edu>
Fri, 1 Feb 2008 21:42:09 +0000 (16:42 -0500)
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>
fs/lockd/svc.c
fs/nfs/callback.c
fs/nfsd/nfssvc.c
include/linux/sunrpc/svcsock.h
net/sunrpc/sunrpc_syms.c
net/sunrpc/svcsock.c

index 82e2192a0d5c873a72b867702c511b0c8872f6a7..868691535115e98b0c8a6b6c5b847840a226c619 100644 (file)
@@ -219,13 +219,12 @@ lockd(struct svc_rqst *rqstp)
        module_put_and_exit(0);
 }
 
-
-static int find_socket(struct svc_serv *serv, int proto)
+static int find_xprt(struct svc_serv *serv, char *proto)
 {
        struct svc_sock *svsk;
        int found = 0;
        list_for_each_entry(svsk, &serv->sv_permsocks, sk_list)
-               if (svsk->sk_sk->sk_protocol == proto) {
+               if (strcmp(svsk->sk_xprt.xpt_class->xcl_name, proto) == 0) {
                        found = 1;
                        break;
                }
@@ -243,13 +242,13 @@ static int make_socks(struct svc_serv *serv, int proto)
        int err = 0;
 
        if (proto == IPPROTO_UDP || nlm_udpport)
-               if (!find_socket(serv, IPPROTO_UDP))
-                       err = svc_makesock(serv, IPPROTO_UDP, nlm_udpport,
-                                               SVC_SOCK_DEFAULTS);
+               if (!find_xprt(serv, "udp"))
+                       err = svc_create_xprt(serv, "udp", nlm_udpport,
+                                             SVC_SOCK_DEFAULTS);
        if (err >= 0 && (proto == IPPROTO_TCP || nlm_tcpport))
-               if (!find_socket(serv, IPPROTO_TCP))
-                       err = svc_makesock(serv, IPPROTO_TCP, nlm_tcpport,
-                                               SVC_SOCK_DEFAULTS);
+               if (!find_xprt(serv, "tcp"))
+                       err = svc_create_xprt(serv, "tcp", nlm_tcpport,
+                                             SVC_SOCK_DEFAULTS);
 
        if (err >= 0) {
                warned = 0;
index 9b6bbf1b978795b8ba29668db9313f1e86bb0d36..bd185a572a23aeb0d015b701d0786dab359f260a 100644 (file)
@@ -119,8 +119,8 @@ int nfs_callback_up(void)
        if (!serv)
                goto out_err;
 
-       ret = svc_makesock(serv, IPPROTO_TCP, nfs_callback_set_tcpport,
-                                                       SVC_SOCK_ANONYMOUS);
+       ret = svc_create_xprt(serv, "tcp", nfs_callback_set_tcpport,
+                             SVC_SOCK_ANONYMOUS);
        if (ret <= 0)
                goto out_destroy;
        nfs_callback_tcpport = ret;
index 1190aeaa92be2e4563c759d04fe96bbc46a0b393..a828b0b0fb6798611dbef51dc81edba7354a34a8 100644 (file)
@@ -236,7 +236,7 @@ static int nfsd_init_socks(int port)
 
        error = lockd_up(IPPROTO_UDP);
        if (error >= 0) {
-               error = svc_makesock(nfsd_serv, IPPROTO_UDP, port,
+               error = svc_create_xprt(nfsd_serv, "udp", port,
                                        SVC_SOCK_DEFAULTS);
                if (error < 0)
                        lockd_down();
@@ -247,7 +247,7 @@ static int nfsd_init_socks(int port)
 #ifdef CONFIG_NFSD_TCP
        error = lockd_up(IPPROTO_TCP);
        if (error >= 0) {
-               error = svc_makesock(nfsd_serv, IPPROTO_TCP, port,
+               error = svc_create_xprt(nfsd_serv, "tcp", port,
                                        SVC_SOCK_DEFAULTS);
                if (error < 0)
                        lockd_down();
index 9882ce0ee33c684fc6421c93c1934de5eeca9e07..3181d9d4caa036b4b0981c02dbb8d0e79ed6a04e 100644 (file)
@@ -67,7 +67,6 @@ struct svc_sock {
 /*
  * Function prototypes.
  */
-int            svc_makesock(struct svc_serv *, int, unsigned short, int flags);
 void           svc_force_close_socket(struct svc_sock *);
 int            svc_recv(struct svc_rqst *, long);
 int            svc_send(struct svc_rqst *);
index 11b309817b8f5537daa06d929ffe984e3c336d07..ab8a7362e89031a8c0ec6ac415ff86591aa0e887 100644 (file)
@@ -33,7 +33,6 @@ EXPORT_SYMBOL(svc_drop);
 EXPORT_SYMBOL(svc_process);
 EXPORT_SYMBOL(svc_recv);
 EXPORT_SYMBOL(svc_wake_up);
-EXPORT_SYMBOL(svc_makesock);
 EXPORT_SYMBOL(svc_reserve);
 EXPORT_SYMBOL(svc_auth_register);
 EXPORT_SYMBOL(auth_domain_lookup);
index 9f0f6d088969858aa80ae9b87c6cbc2cea38a6b4..e6bb1b0563ec50af63c61facd1eaba156afcb796 100644 (file)
@@ -1988,28 +1988,6 @@ void svc_force_close_socket(struct svc_sock *svsk)
        svc_close_socket(svsk);
 }
 
-/**
- * svc_makesock - Make a socket for nfsd and lockd
- * @serv: RPC server structure
- * @protocol: transport protocol to use
- * @port: port to use
- * @flags: requested socket characteristics
- *
- */
-int svc_makesock(struct svc_serv *serv, int protocol, unsigned short port,
-                       int flags)
-{
-       dprintk("svc: creating socket proto = %d\n", protocol);
-       switch (protocol) {
-       case IPPROTO_TCP:
-               return svc_create_xprt(serv, "tcp", port, flags);
-       case IPPROTO_UDP:
-               return svc_create_xprt(serv, "udp", port, flags);
-       default:
-               return -EINVAL;
-       }
-}
-
 /*
  * Handle defer and revisit of requests
  */