diff options
author | Pavel Emelyanov <xemul@parallels.com> | 2010-10-04 16:55:38 +0400 |
---|---|---|
committer | J. Bruce Fields <bfields@redhat.com> | 2010-10-19 10:48:15 -0400 |
commit | 573018c07e040b2c3f3cb8251f66fa4a5cb7425d (patch) | |
tree | 179674de7b92fd31b9e83bc64a82092de52cf504 /net/sunrpc/xprtsock.c | |
parent | 22d44a7d8a03456aa6d0a047c051aa28728e6ecd (diff) | |
download | lwn-573018c07e040b2c3f3cb8251f66fa4a5cb7425d.tar.gz lwn-573018c07e040b2c3f3cb8251f66fa4a5cb7425d.zip |
sunrpc: Call xs_create_sockX directly from setup_socket
Remove now unneeded wrappers that just add type and protocol
to socket creation callback.
Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Reviewed-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'net/sunrpc/xprtsock.c')
-rw-r--r-- | net/sunrpc/xprtsock.c | 40 |
1 files changed, 8 insertions, 32 deletions
diff --git a/net/sunrpc/xprtsock.c b/net/sunrpc/xprtsock.c index 96128d0fd8d2..7fdf2bb956a9 100644 --- a/net/sunrpc/xprtsock.c +++ b/net/sunrpc/xprtsock.c @@ -1710,7 +1710,7 @@ static void xs_udp_finish_connecting(struct rpc_xprt *xprt, struct socket *sock) static void xs_udp_setup_socket(struct sock_xprt *transport, struct socket *(*create_sock)(struct rpc_xprt *, - struct sock_xprt *)) + struct sock_xprt *, int type, int protocol)) { struct rpc_xprt *xprt = &transport->xprt; struct socket *sock = transport->sock; @@ -1721,7 +1721,7 @@ static void xs_udp_setup_socket(struct sock_xprt *transport, /* Start by resetting any existing state */ xs_reset_transport(transport); - sock = create_sock(xprt, transport); + sock = create_sock(xprt, transport, SOCK_DGRAM, IPPROTO_UDP); if (IS_ERR(sock)) goto out; @@ -1745,18 +1745,12 @@ out: * Invoked by a work queue tasklet. */ -static struct socket *xs_create_udp_sock4(struct rpc_xprt *xprt, - struct sock_xprt *transport) -{ - return xs_create_sock4(xprt, transport, SOCK_DGRAM, IPPROTO_UDP); -} - static void xs_udp_connect_worker4(struct work_struct *work) { struct sock_xprt *transport = container_of(work, struct sock_xprt, connect_worker.work); - xs_udp_setup_socket(transport, xs_create_udp_sock4); + xs_udp_setup_socket(transport, xs_create_sock4); } /** @@ -1766,18 +1760,12 @@ static void xs_udp_connect_worker4(struct work_struct *work) * Invoked by a work queue tasklet. */ -static struct socket *xs_create_udp_sock6(struct rpc_xprt *xprt, - struct sock_xprt *transport) -{ - return xs_create_sock6(xprt, transport, SOCK_DGRAM, IPPROTO_UDP); -} - static void xs_udp_connect_worker6(struct work_struct *work) { struct sock_xprt *transport = container_of(work, struct sock_xprt, connect_worker.work); - xs_udp_setup_socket(transport, xs_create_udp_sock6); + xs_udp_setup_socket(transport, xs_create_sock6); } /* @@ -1883,7 +1871,7 @@ static int xs_tcp_finish_connecting(struct rpc_xprt *xprt, struct socket *sock) */ static void xs_tcp_setup_socket(struct sock_xprt *transport, struct socket *(*create_sock)(struct rpc_xprt *, - struct sock_xprt *)) + struct sock_xprt *, int type, int protocol)) { struct socket *sock = transport->sock; struct rpc_xprt *xprt = &transport->xprt; @@ -1894,7 +1882,7 @@ static void xs_tcp_setup_socket(struct sock_xprt *transport, if (!sock) { clear_bit(XPRT_CONNECTION_ABORT, &xprt->state); - sock = create_sock(xprt, transport); + sock = create_sock(xprt, transport, SOCK_STREAM, IPPROTO_TCP); if (IS_ERR(sock)) { status = PTR_ERR(sock); goto out; @@ -1954,12 +1942,6 @@ out: xprt_wake_pending_tasks(xprt, status); } -static struct socket *xs_create_tcp_sock4(struct rpc_xprt *xprt, - struct sock_xprt *transport) -{ - return xs_create_sock4(xprt, transport, SOCK_STREAM, IPPROTO_TCP); -} - /** * xs_tcp_connect_worker4 - connect a TCP socket to a remote endpoint * @work: RPC transport to connect @@ -1971,13 +1953,7 @@ static void xs_tcp_connect_worker4(struct work_struct *work) struct sock_xprt *transport = container_of(work, struct sock_xprt, connect_worker.work); - xs_tcp_setup_socket(transport, xs_create_tcp_sock4); -} - -static struct socket *xs_create_tcp_sock6(struct rpc_xprt *xprt, - struct sock_xprt *transport) -{ - return xs_create_sock6(xprt, transport, SOCK_STREAM, IPPROTO_TCP); + xs_tcp_setup_socket(transport, xs_create_sock4); } /** @@ -1991,7 +1967,7 @@ static void xs_tcp_connect_worker6(struct work_struct *work) struct sock_xprt *transport = container_of(work, struct sock_xprt, connect_worker.work); - xs_tcp_setup_socket(transport, xs_create_tcp_sock6); + xs_tcp_setup_socket(transport, xs_create_sock6); } /** |