diff options
author | Pavel Emelyanov <xemul@parallels.com> | 2010-09-29 08:04:18 -0400 |
---|---|---|
committer | J. Bruce Fields <bfields@redhat.com> | 2010-10-01 17:18:55 -0400 |
commit | 62832c039eab9d03cd28a66427ce8276988f28b0 (patch) | |
tree | 47d0b7fbd5ca567aa31661146ba16218149d67c8 /net | |
parent | fc5d00b04a3a58cac8620403dfe9f43f72578ec1 (diff) |
sunrpc: Pull net argument downto svc_create_socket
After this the socket creation in it knows the context.
Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'net')
-rw-r--r-- | net/sunrpc/svc_xprt.c | 5 | ||||
-rw-r--r-- | net/sunrpc/svcsock.c | 10 | ||||
-rw-r--r-- | net/sunrpc/xprtrdma/svc_rdma_transport.c | 2 |
3 files changed, 12 insertions, 5 deletions
diff --git a/net/sunrpc/svc_xprt.c b/net/sunrpc/svc_xprt.c index d80789a37d88..678b6ee4da7b 100644 --- a/net/sunrpc/svc_xprt.c +++ b/net/sunrpc/svc_xprt.c | |||
@@ -166,6 +166,7 @@ EXPORT_SYMBOL_GPL(svc_xprt_init); | |||
166 | 166 | ||
167 | static struct svc_xprt *__svc_xpo_create(struct svc_xprt_class *xcl, | 167 | static struct svc_xprt *__svc_xpo_create(struct svc_xprt_class *xcl, |
168 | struct svc_serv *serv, | 168 | struct svc_serv *serv, |
169 | struct net *net, | ||
169 | const int family, | 170 | const int family, |
170 | const unsigned short port, | 171 | const unsigned short port, |
171 | int flags) | 172 | int flags) |
@@ -200,7 +201,7 @@ static struct svc_xprt *__svc_xpo_create(struct svc_xprt_class *xcl, | |||
200 | return ERR_PTR(-EAFNOSUPPORT); | 201 | return ERR_PTR(-EAFNOSUPPORT); |
201 | } | 202 | } |
202 | 203 | ||
203 | return xcl->xcl_ops->xpo_create(serv, sap, len, flags); | 204 | return xcl->xcl_ops->xpo_create(serv, net, sap, len, flags); |
204 | } | 205 | } |
205 | 206 | ||
206 | int svc_create_xprt(struct svc_serv *serv, const char *xprt_name, | 207 | int svc_create_xprt(struct svc_serv *serv, const char *xprt_name, |
@@ -221,7 +222,7 @@ int svc_create_xprt(struct svc_serv *serv, const char *xprt_name, | |||
221 | goto err; | 222 | goto err; |
222 | 223 | ||
223 | spin_unlock(&svc_xprt_class_lock); | 224 | spin_unlock(&svc_xprt_class_lock); |
224 | newxprt = __svc_xpo_create(xcl, serv, family, port, flags); | 225 | newxprt = __svc_xpo_create(xcl, serv, net, family, port, flags); |
225 | if (IS_ERR(newxprt)) { | 226 | if (IS_ERR(newxprt)) { |
226 | module_put(xcl->xcl_owner); | 227 | module_put(xcl->xcl_owner); |
227 | return PTR_ERR(newxprt); | 228 | return PTR_ERR(newxprt); |
diff --git a/net/sunrpc/svcsock.c b/net/sunrpc/svcsock.c index 7e534dd09077..559338527f47 100644 --- a/net/sunrpc/svcsock.c +++ b/net/sunrpc/svcsock.c | |||
@@ -64,7 +64,8 @@ static void svc_tcp_sock_detach(struct svc_xprt *); | |||
64 | static void svc_sock_free(struct svc_xprt *); | 64 | static void svc_sock_free(struct svc_xprt *); |
65 | 65 | ||
66 | static struct svc_xprt *svc_create_socket(struct svc_serv *, int, | 66 | static struct svc_xprt *svc_create_socket(struct svc_serv *, int, |
67 | struct sockaddr *, int, int); | 67 | struct net *, struct sockaddr *, |
68 | int, int); | ||
68 | #ifdef CONFIG_DEBUG_LOCK_ALLOC | 69 | #ifdef CONFIG_DEBUG_LOCK_ALLOC |
69 | static struct lock_class_key svc_key[2]; | 70 | static struct lock_class_key svc_key[2]; |
70 | static struct lock_class_key svc_slock_key[2]; | 71 | static struct lock_class_key svc_slock_key[2]; |
@@ -657,10 +658,11 @@ static struct svc_xprt *svc_udp_accept(struct svc_xprt *xprt) | |||
657 | } | 658 | } |
658 | 659 | ||
659 | static struct svc_xprt *svc_udp_create(struct svc_serv *serv, | 660 | static struct svc_xprt *svc_udp_create(struct svc_serv *serv, |
661 | struct net *net, | ||
660 | struct sockaddr *sa, int salen, | 662 | struct sockaddr *sa, int salen, |
661 | int flags) | 663 | int flags) |
662 | { | 664 | { |
663 | return svc_create_socket(serv, IPPROTO_UDP, sa, salen, flags); | 665 | return svc_create_socket(serv, IPPROTO_UDP, net, sa, salen, flags); |
664 | } | 666 | } |
665 | 667 | ||
666 | static struct svc_xprt_ops svc_udp_ops = { | 668 | static struct svc_xprt_ops svc_udp_ops = { |
@@ -1178,10 +1180,11 @@ static int svc_tcp_has_wspace(struct svc_xprt *xprt) | |||
1178 | } | 1180 | } |
1179 | 1181 | ||
1180 | static struct svc_xprt *svc_tcp_create(struct svc_serv *serv, | 1182 | static struct svc_xprt *svc_tcp_create(struct svc_serv *serv, |
1183 | struct net *net, | ||
1181 | struct sockaddr *sa, int salen, | 1184 | struct sockaddr *sa, int salen, |
1182 | int flags) | 1185 | int flags) |
1183 | { | 1186 | { |
1184 | return svc_create_socket(serv, IPPROTO_TCP, sa, salen, flags); | 1187 | return svc_create_socket(serv, IPPROTO_TCP, net, sa, salen, flags); |
1185 | } | 1188 | } |
1186 | 1189 | ||
1187 | static struct svc_xprt_ops svc_tcp_ops = { | 1190 | static struct svc_xprt_ops svc_tcp_ops = { |
@@ -1385,6 +1388,7 @@ EXPORT_SYMBOL_GPL(svc_addsock); | |||
1385 | */ | 1388 | */ |
1386 | static struct svc_xprt *svc_create_socket(struct svc_serv *serv, | 1389 | static struct svc_xprt *svc_create_socket(struct svc_serv *serv, |
1387 | int protocol, | 1390 | int protocol, |
1391 | struct net *net, | ||
1388 | struct sockaddr *sin, int len, | 1392 | struct sockaddr *sin, int len, |
1389 | int flags) | 1393 | int flags) |
1390 | { | 1394 | { |
diff --git a/net/sunrpc/xprtrdma/svc_rdma_transport.c b/net/sunrpc/xprtrdma/svc_rdma_transport.c index edea15a54e51..950a206600c0 100644 --- a/net/sunrpc/xprtrdma/svc_rdma_transport.c +++ b/net/sunrpc/xprtrdma/svc_rdma_transport.c | |||
@@ -52,6 +52,7 @@ | |||
52 | #define RPCDBG_FACILITY RPCDBG_SVCXPRT | 52 | #define RPCDBG_FACILITY RPCDBG_SVCXPRT |
53 | 53 | ||
54 | static struct svc_xprt *svc_rdma_create(struct svc_serv *serv, | 54 | static struct svc_xprt *svc_rdma_create(struct svc_serv *serv, |
55 | struct net *net, | ||
55 | struct sockaddr *sa, int salen, | 56 | struct sockaddr *sa, int salen, |
56 | int flags); | 57 | int flags); |
57 | static struct svc_xprt *svc_rdma_accept(struct svc_xprt *xprt); | 58 | static struct svc_xprt *svc_rdma_accept(struct svc_xprt *xprt); |
@@ -670,6 +671,7 @@ static int rdma_cma_handler(struct rdma_cm_id *cma_id, | |||
670 | * Create a listening RDMA service endpoint. | 671 | * Create a listening RDMA service endpoint. |
671 | */ | 672 | */ |
672 | static struct svc_xprt *svc_rdma_create(struct svc_serv *serv, | 673 | static struct svc_xprt *svc_rdma_create(struct svc_serv *serv, |
674 | struct net *net, | ||
673 | struct sockaddr *sa, int salen, | 675 | struct sockaddr *sa, int salen, |
674 | int flags) | 676 | int flags) |
675 | { | 677 | { |