diff options
author | Stanislav Kinsbursky <skinsbursky@parallels.com> | 2012-01-13 04:09:27 -0500 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2012-01-31 19:28:12 -0500 |
commit | f2ac4dc911fdbc9b98a6a48b40efc45aa9161775 (patch) | |
tree | 0edcf3975fc749ef1e079b197d1711accbb386e3 /net/sunrpc/addr.c | |
parent | 90100b1766c914c820baa78b5be6845fae1159b8 (diff) |
SUNRPC: parametrize rpc_uaddr2sockaddr() by network context
Parametrize rpc_uaddr2sockaddr() by network context and thus force it's callers to pass
in network context instead of using hard-coded "init_net".
Signed-off-by: Stanislav Kinsbursky <skinsbursky@parallels.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'net/sunrpc/addr.c')
-rw-r--r-- | net/sunrpc/addr.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/net/sunrpc/addr.c b/net/sunrpc/addr.c index 82b06b73c1e1..d11418f97f1f 100644 --- a/net/sunrpc/addr.c +++ b/net/sunrpc/addr.c | |||
@@ -297,6 +297,7 @@ char *rpc_sockaddr2uaddr(const struct sockaddr *sap, gfp_t gfp_flags) | |||
297 | 297 | ||
298 | /** | 298 | /** |
299 | * rpc_uaddr2sockaddr - convert a universal address to a socket address. | 299 | * rpc_uaddr2sockaddr - convert a universal address to a socket address. |
300 | * @net: applicable network namespace | ||
300 | * @uaddr: C string containing universal address to convert | 301 | * @uaddr: C string containing universal address to convert |
301 | * @uaddr_len: length of universal address string | 302 | * @uaddr_len: length of universal address string |
302 | * @sap: buffer into which to plant socket address | 303 | * @sap: buffer into which to plant socket address |
@@ -308,8 +309,9 @@ char *rpc_sockaddr2uaddr(const struct sockaddr *sap, gfp_t gfp_flags) | |||
308 | * Returns the size of the socket address if successful; otherwise | 309 | * Returns the size of the socket address if successful; otherwise |
309 | * zero is returned. | 310 | * zero is returned. |
310 | */ | 311 | */ |
311 | size_t rpc_uaddr2sockaddr(const char *uaddr, const size_t uaddr_len, | 312 | size_t rpc_uaddr2sockaddr(struct net *net, const char *uaddr, |
312 | struct sockaddr *sap, const size_t salen) | 313 | const size_t uaddr_len, struct sockaddr *sap, |
314 | const size_t salen) | ||
313 | { | 315 | { |
314 | char *c, buf[RPCBIND_MAXUADDRLEN + sizeof('\0')]; | 316 | char *c, buf[RPCBIND_MAXUADDRLEN + sizeof('\0')]; |
315 | unsigned long portlo, porthi; | 317 | unsigned long portlo, porthi; |
@@ -341,7 +343,7 @@ size_t rpc_uaddr2sockaddr(const char *uaddr, const size_t uaddr_len, | |||
341 | port = (unsigned short)((porthi << 8) | portlo); | 343 | port = (unsigned short)((porthi << 8) | portlo); |
342 | 344 | ||
343 | *c = '\0'; | 345 | *c = '\0'; |
344 | if (rpc_pton(&init_net, buf, strlen(buf), sap, salen) == 0) | 346 | if (rpc_pton(net, buf, strlen(buf), sap, salen) == 0) |
345 | return 0; | 347 | return 0; |
346 | 348 | ||
347 | switch (sap->sa_family) { | 349 | switch (sap->sa_family) { |