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;
/* 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;
* 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);
}
/**
* 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);
}
/*
*/
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;
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;
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
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);
}
/**
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);
}
/**