Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 34755
b: refs/heads/master
c: b716279
h: refs/heads/master
i:
  34753: 5eca33c
  34751: e3ae956
v: v3
  • Loading branch information
David Howells authored and Trond Myklebust committed Sep 23, 2006
1 parent a9ce9de commit 7e6303c
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 7 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: 7539bbab8062aadc1db95a22b377146843cfa88f
refs/heads/master: b7162792b5c0e0f6e91b8997f8e6bbc76ec5420a
12 changes: 8 additions & 4 deletions trunk/fs/nfs/idmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -108,24 +108,27 @@ static struct rpc_pipe_ops idmap_upcall_ops = {
.destroy_msg = idmap_pipe_destroy_msg,
};

void
int
nfs_idmap_new(struct nfs_client *clp)
{
struct idmap *idmap;
int error;

if (clp->cl_idmap != NULL)
return;
return 0;

if ((idmap = kzalloc(sizeof(*idmap), GFP_KERNEL)) == NULL)
return;
return -ENOMEM;

snprintf(idmap->idmap_path, sizeof(idmap->idmap_path),
"%s/idmap", clp->cl_rpcclient->cl_pathname);

idmap->idmap_dentry = rpc_mkpipe(idmap->idmap_path,
idmap, &idmap_upcall_ops, 0);
if (IS_ERR(idmap->idmap_dentry)) {
error = PTR_ERR(idmap->idmap_dentry);
kfree(idmap);
return;
return error;
}

mutex_init(&idmap->idmap_lock);
Expand All @@ -135,6 +138,7 @@ nfs_idmap_new(struct nfs_client *clp)
idmap->idmap_group_hash.h_type = IDMAP_TYPE_GROUP;

clp->cl_idmap = idmap;
return 0;
}

void
Expand Down
3 changes: 2 additions & 1 deletion trunk/fs/nfs/super.c
Original file line number Diff line number Diff line change
Expand Up @@ -1136,7 +1136,8 @@ static struct rpc_clnt *nfs4_create_client(struct nfs_server *server,
clnt->cl_softrtry = 1;
clp->cl_rpcclient = clnt;
memcpy(clp->cl_ipaddr, server->ip_addr, sizeof(clp->cl_ipaddr));
nfs_idmap_new(clp);
if (nfs_idmap_new(clp) < 0)
goto out_fail;
}
list_add_tail(&server->nfs4_siblings, &clp->cl_superblocks);
clnt = rpc_clone_client(clp->cl_rpcclient);
Expand Down
2 changes: 1 addition & 1 deletion trunk/include/linux/nfs_idmap.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ struct idmap_msg {
/* Forward declaration to make this header independent of others */
struct nfs_client;

void nfs_idmap_new(struct nfs_client *);
int nfs_idmap_new(struct nfs_client *);
void nfs_idmap_delete(struct nfs_client *);

int nfs_map_name_to_uid(struct nfs_client *, const char *, size_t, __u32 *);
Expand Down

0 comments on commit 7e6303c

Please sign in to comment.