Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 79635
b: refs/heads/master
c: 6e4cffd
h: refs/heads/master
i:
  79633: ab87137
  79631: 870f702
v: v3
  • Loading branch information
Chuck Lever authored and Trond Myklebust committed Jan 30, 2008
1 parent 116e79f commit b397b51
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 3b0d3f93d01bb013c3dcf9555d2d111c91ac6a1e
refs/heads/master: 6e4cffd7b2cf86022dcf9cceeb63f16ff852caa1
8 changes: 6 additions & 2 deletions trunk/fs/nfs/client.c
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ struct rpc_program nfsacl_program = {
struct nfs_client_initdata {
const char *hostname;
const struct sockaddr_in *addr;
size_t addrlen;
const struct nfs_rpc_ops *rpc_ops;
};

Expand Down Expand Up @@ -125,7 +126,8 @@ static struct nfs_client *nfs_alloc_client(const struct nfs_client_initdata *cl_
atomic_set(&clp->cl_count, 1);
clp->cl_cons_state = NFS_CS_INITING;

memcpy(&clp->cl_addr, cl_init->addr, sizeof(clp->cl_addr));
memcpy(&clp->cl_addr, cl_init->addr, cl_init->addrlen);
clp->cl_addrlen = cl_init->addrlen;

if (cl_init->hostname) {
clp->cl_hostname = kstrdup(cl_init->hostname, GFP_KERNEL);
Expand Down Expand Up @@ -425,7 +427,7 @@ static int nfs_create_rpc_client(struct nfs_client *clp, int proto,
struct rpc_create_args args = {
.protocol = proto,
.address = (struct sockaddr *)&clp->cl_addr,
.addrsize = sizeof(clp->cl_addr),
.addrsize = clp->cl_addrlen,
.timeout = &timeparms,
.servername = clp->cl_hostname,
.program = &nfs_program,
Expand Down Expand Up @@ -585,6 +587,7 @@ static int nfs_init_server(struct nfs_server *server,
struct nfs_client_initdata cl_init = {
.hostname = data->nfs_server.hostname,
.addr = &data->nfs_server.address,
.addrlen = sizeof(data->nfs_server.address),
.rpc_ops = &nfs_v2_clientops,
};
struct nfs_client *clp;
Expand Down Expand Up @@ -938,6 +941,7 @@ static int nfs4_set_client(struct nfs_server *server,
struct nfs_client_initdata cl_init = {
.hostname = hostname,
.addr = addr,
.addrlen = sizeof(*addr),
.rpc_ops = &nfs_v4_clientops,
};
struct nfs_client *clp;
Expand Down
3 changes: 2 additions & 1 deletion trunk/include/linux/nfs_fs_sb.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ struct nfs_client {
#define NFS_CS_CALLBACK 1 /* - callback started */
#define NFS_CS_IDMAP 2 /* - idmap started */
#define NFS_CS_RENEWD 3 /* - renewd started */
struct sockaddr_in cl_addr; /* server identifier */
struct sockaddr_storage cl_addr; /* server identifier */
size_t cl_addrlen;
char * cl_hostname; /* hostname of server */
struct list_head cl_share_link; /* link in global client list */
struct list_head cl_superblocks; /* List of nfs_server structs */
Expand Down

0 comments on commit b397b51

Please sign in to comment.