diff options
author | Stanislav Kinsbursky <skinsbursky@parallels.com> | 2012-01-13 04:09:19 -0500 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2012-01-31 19:28:12 -0500 |
commit | 90100b1766c914c820baa78b5be6845fae1159b8 (patch) | |
tree | 8bfc406c44d8238aff6be33773bccf2083d3f66e /fs | |
parent | 8b147f74738d9ab7e76085e5535e0fe8dc8b29f4 (diff) |
SUNRPC: parametrize rpc_pton() by network context
Parametrize rpc_pton() 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 'fs')
-rw-r--r-- | fs/nfs/dns_resolve.c | 4 | ||||
-rw-r--r-- | fs/nfs/nfs4filelayoutdev.c | 2 | ||||
-rw-r--r-- | fs/nfs/nfs4namespace.c | 2 | ||||
-rw-r--r-- | fs/nfs/super.c | 4 | ||||
-rw-r--r-- | fs/nfsd/nfsctl.c | 2 |
5 files changed, 7 insertions, 7 deletions
diff --git a/fs/nfs/dns_resolve.c b/fs/nfs/dns_resolve.c index 200eb67c95d9..7edc62a8a64f 100644 --- a/fs/nfs/dns_resolve.c +++ b/fs/nfs/dns_resolve.c | |||
@@ -20,7 +20,7 @@ ssize_t nfs_dns_resolve_name(struct net *net, char *name, size_t namelen, | |||
20 | 20 | ||
21 | ip_len = dns_query(NULL, name, namelen, NULL, &ip_addr, NULL); | 21 | ip_len = dns_query(NULL, name, namelen, NULL, &ip_addr, NULL); |
22 | if (ip_len > 0) | 22 | if (ip_len > 0) |
23 | ret = rpc_pton(ip_addr, ip_len, sa, salen); | 23 | ret = rpc_pton(&init_net, ip_addr, ip_len, sa, salen); |
24 | else | 24 | else |
25 | ret = -ESRCH; | 25 | ret = -ESRCH; |
26 | kfree(ip_addr); | 26 | kfree(ip_addr); |
@@ -224,7 +224,7 @@ static int nfs_dns_parse(struct cache_detail *cd, char *buf, int buflen) | |||
224 | len = qword_get(&buf, buf1, sizeof(buf1)); | 224 | len = qword_get(&buf, buf1, sizeof(buf1)); |
225 | if (len <= 0) | 225 | if (len <= 0) |
226 | goto out; | 226 | goto out; |
227 | key.addrlen = rpc_pton(buf1, len, | 227 | key.addrlen = rpc_pton(&init_net, buf1, len, |
228 | (struct sockaddr *)&key.addr, | 228 | (struct sockaddr *)&key.addr, |
229 | sizeof(key.addr)); | 229 | sizeof(key.addr)); |
230 | 230 | ||
diff --git a/fs/nfs/nfs4filelayoutdev.c b/fs/nfs/nfs4filelayoutdev.c index 8ae91908f5aa..0d8b9523a3cb 100644 --- a/fs/nfs/nfs4filelayoutdev.c +++ b/fs/nfs/nfs4filelayoutdev.c | |||
@@ -457,7 +457,7 @@ decode_ds_addr(struct xdr_stream *streamp, gfp_t gfp_flags) | |||
457 | 457 | ||
458 | INIT_LIST_HEAD(&da->da_node); | 458 | INIT_LIST_HEAD(&da->da_node); |
459 | 459 | ||
460 | if (!rpc_pton(buf, portstr-buf, (struct sockaddr *)&da->da_addr, | 460 | if (!rpc_pton(&init_net, buf, portstr-buf, (struct sockaddr *)&da->da_addr, |
461 | sizeof(da->da_addr))) { | 461 | sizeof(da->da_addr))) { |
462 | dprintk("%s: error parsing address %s\n", __func__, buf); | 462 | dprintk("%s: error parsing address %s\n", __func__, buf); |
463 | goto out_free_da; | 463 | goto out_free_da; |
diff --git a/fs/nfs/nfs4namespace.c b/fs/nfs/nfs4namespace.c index 919a36935924..48a9acdbaeb6 100644 --- a/fs/nfs/nfs4namespace.c +++ b/fs/nfs/nfs4namespace.c | |||
@@ -98,7 +98,7 @@ static size_t nfs_parse_server_name(char *string, size_t len, | |||
98 | { | 98 | { |
99 | ssize_t ret; | 99 | ssize_t ret; |
100 | 100 | ||
101 | ret = rpc_pton(string, len, sa, salen); | 101 | ret = rpc_pton(&init_net, string, len, sa, salen); |
102 | if (ret == 0) { | 102 | if (ret == 0) { |
103 | ret = nfs_dns_resolve_name(server->client->cl_xprt->xprt_net, | 103 | ret = nfs_dns_resolve_name(server->client->cl_xprt->xprt_net, |
104 | string, len, sa, salen); | 104 | string, len, sa, salen); |
diff --git a/fs/nfs/super.c b/fs/nfs/super.c index e45feb0fee59..b79f2a11c29e 100644 --- a/fs/nfs/super.c +++ b/fs/nfs/super.c | |||
@@ -1408,7 +1408,7 @@ static int nfs_parse_mount_options(char *raw, | |||
1408 | if (string == NULL) | 1408 | if (string == NULL) |
1409 | goto out_nomem; | 1409 | goto out_nomem; |
1410 | mnt->nfs_server.addrlen = | 1410 | mnt->nfs_server.addrlen = |
1411 | rpc_pton(string, strlen(string), | 1411 | rpc_pton(&init_net, string, strlen(string), |
1412 | (struct sockaddr *) | 1412 | (struct sockaddr *) |
1413 | &mnt->nfs_server.address, | 1413 | &mnt->nfs_server.address, |
1414 | sizeof(mnt->nfs_server.address)); | 1414 | sizeof(mnt->nfs_server.address)); |
@@ -1430,7 +1430,7 @@ static int nfs_parse_mount_options(char *raw, | |||
1430 | if (string == NULL) | 1430 | if (string == NULL) |
1431 | goto out_nomem; | 1431 | goto out_nomem; |
1432 | mnt->mount_server.addrlen = | 1432 | mnt->mount_server.addrlen = |
1433 | rpc_pton(string, strlen(string), | 1433 | rpc_pton(&init_net, string, strlen(string), |
1434 | (struct sockaddr *) | 1434 | (struct sockaddr *) |
1435 | &mnt->mount_server.address, | 1435 | &mnt->mount_server.address, |
1436 | sizeof(mnt->mount_server.address)); | 1436 | sizeof(mnt->mount_server.address)); |
diff --git a/fs/nfsd/nfsctl.c b/fs/nfsd/nfsctl.c index 748eda93ce59..330352d379b6 100644 --- a/fs/nfsd/nfsctl.c +++ b/fs/nfsd/nfsctl.c | |||
@@ -223,7 +223,7 @@ static ssize_t write_unlock_ip(struct file *file, char *buf, size_t size) | |||
223 | if (qword_get(&buf, fo_path, size) < 0) | 223 | if (qword_get(&buf, fo_path, size) < 0) |
224 | return -EINVAL; | 224 | return -EINVAL; |
225 | 225 | ||
226 | if (rpc_pton(fo_path, size, sap, salen) == 0) | 226 | if (rpc_pton(&init_net, fo_path, size, sap, salen) == 0) |
227 | return -EINVAL; | 227 | return -EINVAL; |
228 | 228 | ||
229 | return nlmsvc_unlock_all_by_ip(sap); | 229 | return nlmsvc_unlock_all_by_ip(sap); |