aboutsummaryrefslogtreecommitdiffstats
path: root/net/sunrpc/xprt.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/sunrpc/xprt.c')
-rw-r--r--net/sunrpc/xprt.c79
1 files changed, 0 insertions, 79 deletions
diff --git a/net/sunrpc/xprt.c b/net/sunrpc/xprt.c
index 17f56cfe2412..e4f64fb58ff2 100644
--- a/net/sunrpc/xprt.c
+++ b/net/sunrpc/xprt.c
@@ -962,85 +962,6 @@ struct rpc_xprt *xprt_create_transport(int proto, struct sockaddr *ap, size_t si
962 return xprt; 962 return xprt;
963} 963}
964 964
965static struct rpc_xprt *xprt_setup(int proto, struct sockaddr_in *ap, struct rpc_timeout *to)
966{
967 int result;
968 struct rpc_xprt *xprt;
969 struct rpc_rqst *req;
970
971 if ((xprt = kzalloc(sizeof(struct rpc_xprt), GFP_KERNEL)) == NULL)
972 return ERR_PTR(-ENOMEM);
973
974 memcpy(&xprt->addr, ap, sizeof(*ap));
975 xprt->addrlen = sizeof(*ap);
976
977 switch (proto) {
978 case IPPROTO_UDP:
979 result = xs_setup_udp(xprt, to);
980 break;
981 case IPPROTO_TCP:
982 result = xs_setup_tcp(xprt, to);
983 break;
984 default:
985 printk(KERN_ERR "RPC: unrecognized transport protocol: %d\n",
986 proto);
987 result = -EIO;
988 break;
989 }
990 if (result) {
991 kfree(xprt);
992 return ERR_PTR(result);
993 }
994
995 spin_lock_init(&xprt->transport_lock);
996 spin_lock_init(&xprt->reserve_lock);
997
998 INIT_LIST_HEAD(&xprt->free);
999 INIT_LIST_HEAD(&xprt->recv);
1000 INIT_WORK(&xprt->task_cleanup, xprt_autoclose, xprt);
1001 init_timer(&xprt->timer);
1002 xprt->timer.function = xprt_init_autodisconnect;
1003 xprt->timer.data = (unsigned long) xprt;
1004 xprt->last_used = jiffies;
1005 xprt->cwnd = RPC_INITCWND;
1006
1007 rpc_init_wait_queue(&xprt->binding, "xprt_binding");
1008 rpc_init_wait_queue(&xprt->pending, "xprt_pending");
1009 rpc_init_wait_queue(&xprt->sending, "xprt_sending");
1010 rpc_init_wait_queue(&xprt->resend, "xprt_resend");
1011 rpc_init_priority_wait_queue(&xprt->backlog, "xprt_backlog");
1012
1013 /* initialize free list */
1014 for (req = &xprt->slot[xprt->max_reqs-1]; req >= &xprt->slot[0]; req--)
1015 list_add(&req->rq_list, &xprt->free);
1016
1017 xprt_init_xid(xprt);
1018
1019 dprintk("RPC: created transport %p with %u slots\n", xprt,
1020 xprt->max_reqs);
1021
1022 return xprt;
1023}
1024
1025/**
1026 * xprt_create_proto - create an RPC client transport
1027 * @proto: requested transport protocol
1028 * @sap: remote peer's address
1029 * @to: timeout parameters for new transport
1030 *
1031 */
1032struct rpc_xprt *xprt_create_proto(int proto, struct sockaddr_in *sap, struct rpc_timeout *to)
1033{
1034 struct rpc_xprt *xprt;
1035
1036 xprt = xprt_setup(proto, sap, to);
1037 if (IS_ERR(xprt))
1038 dprintk("RPC: xprt_create_proto failed\n");
1039 else
1040 dprintk("RPC: xprt_create_proto created xprt %p\n", xprt);
1041 return xprt;
1042}
1043
1044/** 965/**
1045 * xprt_destroy - destroy an RPC transport, killing off all requests. 966 * xprt_destroy - destroy an RPC transport, killing off all requests.
1046 * @xprt: transport to destroy 967 * @xprt: transport to destroy