提交 14ec63c3 编写于 作者: P Pavel Emelyanov 提交者: J. Bruce Fields

sunrpc: Create sockets in net namespaces

The context is already known in all the sock_create callers.
Signed-off-by: NPavel Emelyanov <xemul@openvz.org>
Signed-off-by: NJ. Bruce Fields <bfields@redhat.com>
上级 721db93a
......@@ -1425,7 +1425,7 @@ static struct svc_xprt *svc_create_socket(struct svc_serv *serv,
return ERR_PTR(-EINVAL);
}
error = sock_create_kern(family, type, protocol, &sock);
error = __sock_create(net, family, type, protocol, &sock, 1);
if (error < 0)
return ERR_PTR(error);
......
......@@ -1680,7 +1680,7 @@ static void xs_udp_connect_worker4(struct work_struct *work)
/* Start by resetting any existing state */
xs_reset_transport(transport);
err = sock_create_kern(PF_INET, SOCK_DGRAM, IPPROTO_UDP, &sock);
err = __sock_create(xprt->xprt_net, PF_INET, SOCK_DGRAM, IPPROTO_UDP, &sock, 1);
if (err < 0) {
dprintk("RPC: can't create UDP transport socket (%d).\n", -err);
goto out;
......@@ -1725,7 +1725,7 @@ static void xs_udp_connect_worker6(struct work_struct *work)
/* Start by resetting any existing state */
xs_reset_transport(transport);
err = sock_create_kern(PF_INET6, SOCK_DGRAM, IPPROTO_UDP, &sock);
err = __sock_create(xprt->xprt_net, PF_INET6, SOCK_DGRAM, IPPROTO_UDP, &sock, 1);
if (err < 0) {
dprintk("RPC: can't create UDP transport socket (%d).\n", -err);
goto out;
......@@ -1931,7 +1931,7 @@ static struct socket *xs_create_tcp_sock4(struct rpc_xprt *xprt,
int err;
/* start from scratch */
err = sock_create_kern(PF_INET, SOCK_STREAM, IPPROTO_TCP, &sock);
err = __sock_create(xprt->xprt_net, PF_INET, SOCK_STREAM, IPPROTO_TCP, &sock, 1);
if (err < 0) {
dprintk("RPC: can't create TCP transport socket (%d).\n",
-err);
......@@ -1970,7 +1970,7 @@ static struct socket *xs_create_tcp_sock6(struct rpc_xprt *xprt,
int err;
/* start from scratch */
err = sock_create_kern(PF_INET6, SOCK_STREAM, IPPROTO_TCP, &sock);
err = __sock_create(xprt->xprt_net, PF_INET6, SOCK_STREAM, IPPROTO_TCP, &sock, 1);
if (err < 0) {
dprintk("RPC: can't create TCP transport socket (%d).\n",
-err);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册