diff options
author | Pavel Emelyanov <xemul@parallels.com> | 2010-10-04 08:57:40 -0400 |
---|---|---|
committer | J. Bruce Fields <bfields@redhat.com> | 2010-10-19 10:48:15 -0400 |
commit | cdd518d524b49e6e80b109bf985376456a2985ce (patch) | |
tree | 875aab959d443e7eb48071454d4ea3f009d80829 | |
parent | 7dfe1fc36278c3aa0db29356c491db6353678e98 (diff) |
sunrpc: Remove TCP worker wrappers
The v4 and the v6 wrappers only pass the respective family
to the xs_tcp_setup_socket. This family can be taken from the
xprt's sockaddr.
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>
-rw-r--r-- | net/sunrpc/xprtsock.c | 39 |
1 files changed, 7 insertions, 32 deletions
diff --git a/net/sunrpc/xprtsock.c b/net/sunrpc/xprtsock.c index 3dbc5d631d66..31ee5748dfaf 100644 --- a/net/sunrpc/xprtsock.c +++ b/net/sunrpc/xprtsock.c | |||
@@ -1826,8 +1826,10 @@ static int xs_tcp_finish_connecting(struct rpc_xprt *xprt, struct socket *sock) | |||
1826 | * | 1826 | * |
1827 | * Invoked by a work queue tasklet. | 1827 | * Invoked by a work queue tasklet. |
1828 | */ | 1828 | */ |
1829 | static void xs_tcp_setup_socket(struct sock_xprt *transport, int family) | 1829 | static void xs_tcp_setup_socket(struct work_struct *work) |
1830 | { | 1830 | { |
1831 | struct sock_xprt *transport = | ||
1832 | container_of(work, struct sock_xprt, connect_worker.work); | ||
1831 | struct socket *sock = transport->sock; | 1833 | struct socket *sock = transport->sock; |
1832 | struct rpc_xprt *xprt = &transport->xprt; | 1834 | struct rpc_xprt *xprt = &transport->xprt; |
1833 | int status = -EIO; | 1835 | int status = -EIO; |
@@ -1837,7 +1839,8 @@ static void xs_tcp_setup_socket(struct sock_xprt *transport, int family) | |||
1837 | 1839 | ||
1838 | if (!sock) { | 1840 | if (!sock) { |
1839 | clear_bit(XPRT_CONNECTION_ABORT, &xprt->state); | 1841 | clear_bit(XPRT_CONNECTION_ABORT, &xprt->state); |
1840 | sock = xs_create_sock(xprt, transport, family, SOCK_STREAM, IPPROTO_TCP); | 1842 | sock = xs_create_sock(xprt, transport, |
1843 | xs_addr(xprt)->sa_family, SOCK_STREAM, IPPROTO_TCP); | ||
1841 | if (IS_ERR(sock)) { | 1844 | if (IS_ERR(sock)) { |
1842 | status = PTR_ERR(sock); | 1845 | status = PTR_ERR(sock); |
1843 | goto out; | 1846 | goto out; |
@@ -1898,34 +1901,6 @@ out: | |||
1898 | } | 1901 | } |
1899 | 1902 | ||
1900 | /** | 1903 | /** |
1901 | * xs_tcp_connect_worker4 - connect a TCP socket to a remote endpoint | ||
1902 | * @work: RPC transport to connect | ||
1903 | * | ||
1904 | * Invoked by a work queue tasklet. | ||
1905 | */ | ||
1906 | static void xs_tcp_connect_worker4(struct work_struct *work) | ||
1907 | { | ||
1908 | struct sock_xprt *transport = | ||
1909 | container_of(work, struct sock_xprt, connect_worker.work); | ||
1910 | |||
1911 | xs_tcp_setup_socket(transport, PF_INET); | ||
1912 | } | ||
1913 | |||
1914 | /** | ||
1915 | * xs_tcp_connect_worker6 - connect a TCP socket to a remote endpoint | ||
1916 | * @work: RPC transport to connect | ||
1917 | * | ||
1918 | * Invoked by a work queue tasklet. | ||
1919 | */ | ||
1920 | static void xs_tcp_connect_worker6(struct work_struct *work) | ||
1921 | { | ||
1922 | struct sock_xprt *transport = | ||
1923 | container_of(work, struct sock_xprt, connect_worker.work); | ||
1924 | |||
1925 | xs_tcp_setup_socket(transport, PF_INET6); | ||
1926 | } | ||
1927 | |||
1928 | /** | ||
1929 | * xs_connect - connect a socket to a remote endpoint | 1904 | * xs_connect - connect a socket to a remote endpoint |
1930 | * @task: address of RPC task that manages state of connect request | 1905 | * @task: address of RPC task that manages state of connect request |
1931 | * | 1906 | * |
@@ -2328,7 +2303,7 @@ static struct rpc_xprt *xs_setup_tcp(struct xprt_create *args) | |||
2328 | xprt_set_bound(xprt); | 2303 | xprt_set_bound(xprt); |
2329 | 2304 | ||
2330 | INIT_DELAYED_WORK(&transport->connect_worker, | 2305 | INIT_DELAYED_WORK(&transport->connect_worker, |
2331 | xs_tcp_connect_worker4); | 2306 | xs_tcp_setup_socket); |
2332 | xs_format_peer_addresses(xprt, "tcp", RPCBIND_NETID_TCP); | 2307 | xs_format_peer_addresses(xprt, "tcp", RPCBIND_NETID_TCP); |
2333 | break; | 2308 | break; |
2334 | case AF_INET6: | 2309 | case AF_INET6: |
@@ -2336,7 +2311,7 @@ static struct rpc_xprt *xs_setup_tcp(struct xprt_create *args) | |||
2336 | xprt_set_bound(xprt); | 2311 | xprt_set_bound(xprt); |
2337 | 2312 | ||
2338 | INIT_DELAYED_WORK(&transport->connect_worker, | 2313 | INIT_DELAYED_WORK(&transport->connect_worker, |
2339 | xs_tcp_connect_worker6); | 2314 | xs_tcp_setup_socket); |
2340 | xs_format_peer_addresses(xprt, "tcp", RPCBIND_NETID_TCP6); | 2315 | xs_format_peer_addresses(xprt, "tcp", RPCBIND_NETID_TCP6); |
2341 | break; | 2316 | break; |
2342 | default: | 2317 | default: |