aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorChuck Lever <chuck.lever@oracle.com>2007-12-10 14:58:15 -0500
committerTrond Myklebust <Trond.Myklebust@netapp.com>2008-01-30 02:05:54 -0500
commit6e4cffd7b2cf86022dcf9cceeb63f16ff852caa1 (patch)
tree9f92711937e876f2e2e143c612fcbfb7c1b7d03a /fs
parent3b0d3f93d01bb013c3dcf9555d2d111c91ac6a1e (diff)
NFS: Expand server address storage in nfs_client struct
Prepare for managing larger addresses in the NFS client by widening the nfs_client struct's cl_addr field. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Cc: Aurelien Charbon <aurelien.charbon@ext.bull.net> (Modified to work with the new parameters for nfs_alloc_client) Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/nfs/client.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/fs/nfs/client.c b/fs/nfs/client.c
index 876162cddf1e..44fe7fd7bfbf 100644
--- a/fs/nfs/client.c
+++ b/fs/nfs/client.c
@@ -98,6 +98,7 @@ struct rpc_program nfsacl_program = {
98struct nfs_client_initdata { 98struct nfs_client_initdata {
99 const char *hostname; 99 const char *hostname;
100 const struct sockaddr_in *addr; 100 const struct sockaddr_in *addr;
101 size_t addrlen;
101 const struct nfs_rpc_ops *rpc_ops; 102 const struct nfs_rpc_ops *rpc_ops;
102}; 103};
103 104
@@ -125,7 +126,8 @@ static struct nfs_client *nfs_alloc_client(const struct nfs_client_initdata *cl_
125 atomic_set(&clp->cl_count, 1); 126 atomic_set(&clp->cl_count, 1);
126 clp->cl_cons_state = NFS_CS_INITING; 127 clp->cl_cons_state = NFS_CS_INITING;
127 128
128 memcpy(&clp->cl_addr, cl_init->addr, sizeof(clp->cl_addr)); 129 memcpy(&clp->cl_addr, cl_init->addr, cl_init->addrlen);
130 clp->cl_addrlen = cl_init->addrlen;
129 131
130 if (cl_init->hostname) { 132 if (cl_init->hostname) {
131 clp->cl_hostname = kstrdup(cl_init->hostname, GFP_KERNEL); 133 clp->cl_hostname = kstrdup(cl_init->hostname, GFP_KERNEL);
@@ -425,7 +427,7 @@ static int nfs_create_rpc_client(struct nfs_client *clp, int proto,
425 struct rpc_create_args args = { 427 struct rpc_create_args args = {
426 .protocol = proto, 428 .protocol = proto,
427 .address = (struct sockaddr *)&clp->cl_addr, 429 .address = (struct sockaddr *)&clp->cl_addr,
428 .addrsize = sizeof(clp->cl_addr), 430 .addrsize = clp->cl_addrlen,
429 .timeout = &timeparms, 431 .timeout = &timeparms,
430 .servername = clp->cl_hostname, 432 .servername = clp->cl_hostname,
431 .program = &nfs_program, 433 .program = &nfs_program,
@@ -585,6 +587,7 @@ static int nfs_init_server(struct nfs_server *server,
585 struct nfs_client_initdata cl_init = { 587 struct nfs_client_initdata cl_init = {
586 .hostname = data->nfs_server.hostname, 588 .hostname = data->nfs_server.hostname,
587 .addr = &data->nfs_server.address, 589 .addr = &data->nfs_server.address,
590 .addrlen = sizeof(data->nfs_server.address),
588 .rpc_ops = &nfs_v2_clientops, 591 .rpc_ops = &nfs_v2_clientops,
589 }; 592 };
590 struct nfs_client *clp; 593 struct nfs_client *clp;
@@ -938,6 +941,7 @@ static int nfs4_set_client(struct nfs_server *server,
938 struct nfs_client_initdata cl_init = { 941 struct nfs_client_initdata cl_init = {
939 .hostname = hostname, 942 .hostname = hostname,
940 .addr = addr, 943 .addr = addr,
944 .addrlen = sizeof(*addr),
941 .rpc_ops = &nfs_v4_clientops, 945 .rpc_ops = &nfs_v4_clientops,
942 }; 946 };
943 struct nfs_client *clp; 947 struct nfs_client *clp;