summaryrefslogtreecommitdiffstats
path: root/net/sunrpc/xprt.c
diff options
context:
space:
mode:
authorChuck Lever <chuck.lever@oracle.com>2006-08-22 20:06:21 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2006-09-22 23:24:51 -0400
commitff9aa5e56df60cc8565a93cc868fe25ae3f20e49 (patch)
treeae1045652699feacd18aecbc7023edd430c2695e /net/sunrpc/xprt.c
parent9e1968c58d72c4b85d8a69bda1e194f9701fb224 (diff)
downloadlinux-ff9aa5e56df60cc8565a93cc868fe25ae3f20e49.tar.gz
linux-ff9aa5e56df60cc8565a93cc868fe25ae3f20e49.tar.bz2
linux-ff9aa5e56df60cc8565a93cc868fe25ae3f20e49.zip
SUNRPC: Eliminate xprt_create_proto and rpc_create_client
The two function call API for creating a new RPC client is now obsolete. Remove it. Also, remove an unnecessary check to see whether the caller is capable of using privileged network services. The kernel RPC client always uses a privileged ephemeral port by default; callers are responsible for checking the authority of users to make use of any RPC service, or for specifying that a nonprivileged port is acceptable. Test plan: Repeated runs of Connectathon locking suite. Check network trace to ensure correctness of NLM requests and replies. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
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
return xprt;
}
-static struct rpc_xprt *xprt_setup(int proto, struct sockaddr_in *ap, struct rpc_timeout *to)
-{
- int result;
- struct rpc_xprt *xprt;
- struct rpc_rqst *req;
-
- if ((xprt = kzalloc(sizeof(struct rpc_xprt), GFP_KERNEL)) == NULL)
- return ERR_PTR(-ENOMEM);
-
- memcpy(&xprt->addr, ap, sizeof(*ap));
- xprt->addrlen = sizeof(*ap);
-
- switch (proto) {
- case IPPROTO_UDP:
- result = xs_setup_udp(xprt, to);
- break;
- case IPPROTO_TCP:
- result = xs_setup_tcp(xprt, to);
- break;
- default:
- printk(KERN_ERR "RPC: unrecognized transport protocol: %d\n",
- proto);
- result = -EIO;
- break;
- }
- if (result) {
- kfree(xprt);
- return ERR_PTR(result);
- }
-
- spin_lock_init(&xprt->transport_lock);
- spin_lock_init(&xprt->reserve_lock);
-
- INIT_LIST_HEAD(&xprt->free);
- INIT_LIST_HEAD(&xprt->recv);
- INIT_WORK(&xprt->task_cleanup, xprt_autoclose, xprt);
- init_timer(&xprt->timer);
- xprt->timer.function = xprt_init_autodisconnect;
- xprt->timer.data = (unsigned long) xprt;
- xprt->last_used = jiffies;
- xprt->cwnd = RPC_INITCWND;
-
- rpc_init_wait_queue(&xprt->binding, "xprt_binding");
- rpc_init_wait_queue(&xprt->pending, "xprt_pending");
- rpc_init_wait_queue(&xprt->sending, "xprt_sending");
- rpc_init_wait_queue(&xprt->resend, "xprt_resend");
- rpc_init_priority_wait_queue(&xprt->backlog, "xprt_backlog");
-
- /* initialize free list */
- for (req = &xprt->slot[xprt->max_reqs-1]; req >= &xprt->slot[0]; req--)
- list_add(&req->rq_list, &xprt->free);
-
- xprt_init_xid(xprt);
-
- dprintk("RPC: created transport %p with %u slots\n", xprt,
- xprt->max_reqs);
-
- return xprt;
-}
-
-/**
- * xprt_create_proto - create an RPC client transport
- * @proto: requested transport protocol
- * @sap: remote peer's address
- * @to: timeout parameters for new transport
- *
- */
-struct rpc_xprt *xprt_create_proto(int proto, struct sockaddr_in *sap, struct rpc_timeout *to)
-{
- struct rpc_xprt *xprt;
-
- xprt = xprt_setup(proto, sap, to);
- if (IS_ERR(xprt))
- dprintk("RPC: xprt_create_proto failed\n");
- else
- dprintk("RPC: xprt_create_proto created xprt %p\n", xprt);
- return xprt;
-}
-
/**
* xprt_destroy - destroy an RPC transport, killing off all requests.
* @xprt: transport to destroy