aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChuck Lever <chuck.lever@oracle.com>2007-12-10 14:58:59 -0500
committerTrond Myklebust <Trond.Myklebust@netapp.com>2008-01-30 02:05:56 -0500
commitdcecae0ff44dceea7adb6bef5c8eb660fe87a93c (patch)
treebd17c6708b58eb1f00be2057ed662a53eeb192cd
parentd7422c472bbaa419876b91e8823c6219c4a144cb (diff)
NFS: Change nfs4_set_client() to accept struct sockaddr *
Adjust the arguments and callers of nfs4_set_client() to pass a "struct sockaddr *" instead of a "struct sockaddr_in *" to support non-IPv4 addresses in the NFS client. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Cc: Aurelien Charbon <aurelien.charbon@ext.bull.net> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
-rw-r--r--fs/nfs/client.c25
1 files changed, 15 insertions, 10 deletions
diff --git a/fs/nfs/client.c b/fs/nfs/client.c
index e43072bdbb0c..11380601fc78 100644
--- a/fs/nfs/client.c
+++ b/fs/nfs/client.c
@@ -927,15 +927,17 @@ error:
927 * Set up an NFS4 client 927 * Set up an NFS4 client
928 */ 928 */
929static int nfs4_set_client(struct nfs_server *server, 929static int nfs4_set_client(struct nfs_server *server,
930 const char *hostname, const struct sockaddr_in *addr, 930 const char *hostname,
931 const struct sockaddr *addr,
932 const size_t addrlen,
931 const char *ip_addr, 933 const char *ip_addr,
932 rpc_authflavor_t authflavour, 934 rpc_authflavor_t authflavour,
933 int proto, int timeo, int retrans) 935 int proto, int timeo, int retrans)
934{ 936{
935 struct nfs_client_initdata cl_init = { 937 struct nfs_client_initdata cl_init = {
936 .hostname = hostname, 938 .hostname = hostname,
937 .addr = (const struct sockaddr *)addr, 939 .addr = addr,
938 .addrlen = sizeof(*addr), 940 .addrlen = addrlen,
939 .rpc_ops = &nfs_v4_clientops, 941 .rpc_ops = &nfs_v4_clientops,
940 }; 942 };
941 struct nfs_client *clp; 943 struct nfs_client *clp;
@@ -1015,7 +1017,8 @@ struct nfs_server *nfs4_create_server(const struct nfs_parsed_mount_data *data,
1015 /* Get a client record */ 1017 /* Get a client record */
1016 error = nfs4_set_client(server, 1018 error = nfs4_set_client(server,
1017 data->nfs_server.hostname, 1019 data->nfs_server.hostname,
1018 &data->nfs_server.address, 1020 (struct sockaddr *)&data->nfs_server.address,
1021 sizeof(data->nfs_server.address),
1019 data->client_address, 1022 data->client_address,
1020 data->auth_flavors[0], 1023 data->auth_flavors[0],
1021 data->nfs_server.protocol, 1024 data->nfs_server.protocol,
@@ -1090,12 +1093,14 @@ struct nfs_server *nfs4_create_referral_server(struct nfs_clone_mount *data,
1090 1093
1091 /* Get a client representation. 1094 /* Get a client representation.
1092 * Note: NFSv4 always uses TCP, */ 1095 * Note: NFSv4 always uses TCP, */
1093 error = nfs4_set_client(server, data->hostname, data->addr, 1096 error = nfs4_set_client(server, data->hostname,
1094 parent_client->cl_ipaddr, 1097 (struct sockaddr *)data->addr,
1095 data->authflavor, 1098 sizeof(*data->addr),
1096 parent_server->client->cl_xprt->prot, 1099 parent_client->cl_ipaddr,
1097 parent_client->retrans_timeo, 1100 data->authflavor,
1098 parent_client->retrans_count); 1101 parent_server->client->cl_xprt->prot,
1102 parent_client->retrans_timeo,
1103 parent_client->retrans_count);
1099 if (error < 0) 1104 if (error < 0)
1100 goto error; 1105 goto error;
1101 1106