Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 9961
b: refs/heads/master
c: 278c995
h: refs/heads/master
i:
  9959: 65d647c
v: v3
  • Loading branch information
Christoph Hellwig authored and Trond Myklebust committed Sep 23, 2005
1 parent 7e806fa commit 2327dae
Show file tree
Hide file tree
Showing 7 changed files with 143 additions and 210 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: 470056c288334eb0b37be26c9ff8aee37ed1cc7a
refs/heads/master: 278c995c8a153bb2a9bc427e931cfb9c8034c9d7
10 changes: 3 additions & 7 deletions trunk/fs/nfs/idmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ struct idmap_hashtable {
};

struct idmap {
char idmap_path[48];
struct dentry *idmap_dentry;
wait_queue_head_t idmap_wq;
struct idmap_msg idmap_im;
Expand Down Expand Up @@ -102,11 +101,8 @@ nfs_idmap_new(struct nfs4_client *clp)

memset(idmap, 0, sizeof(*idmap));

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);
idmap->idmap_dentry = rpc_mkpipe(clp->cl_rpcclient->cl_dentry,
"idmap", idmap, &idmap_upcall_ops, 0);
if (IS_ERR(idmap->idmap_dentry)) {
kfree(idmap);
return;
Expand All @@ -128,7 +124,7 @@ nfs_idmap_delete(struct nfs4_client *clp)

if (!idmap)
return;
rpc_unlink(idmap->idmap_path);
rpc_unlink(idmap->idmap_dentry);
clp->cl_idmap = NULL;
kfree(idmap);
}
Expand Down
2 changes: 1 addition & 1 deletion trunk/include/linux/sunrpc/clnt.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ struct rpc_clnt {

int cl_nodelen; /* nodename length */
char cl_nodename[UNX_MAXNODENAME];
char cl_pathname[30];/* Path in rpc_pipe_fs */
struct dentry * __cl_parent_dentry;
struct dentry * cl_dentry; /* inode */
struct rpc_clnt * cl_parent; /* Points to parent of clones */
struct rpc_rtt cl_rtt_default;
Expand Down
9 changes: 5 additions & 4 deletions trunk/include/linux/sunrpc/rpc_pipe_fs.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,11 @@ RPC_I(struct inode *inode)

extern int rpc_queue_upcall(struct inode *, struct rpc_pipe_msg *);

extern struct dentry *rpc_mkdir(char *, struct rpc_clnt *);
extern int rpc_rmdir(char *);
extern struct dentry *rpc_mkpipe(char *, void *, struct rpc_pipe_ops *, int flags);
extern int rpc_unlink(char *);
extern struct dentry *rpc_mkdir(struct dentry *, char *, struct rpc_clnt *);
extern void rpc_rmdir(struct dentry *);
extern struct dentry *rpc_mkpipe(struct dentry *, char *, void *,
struct rpc_pipe_ops *, int flags);
extern void rpc_unlink(struct dentry *);

#endif
#endif
9 changes: 3 additions & 6 deletions trunk/net/sunrpc/auth_gss/auth_gss.c
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ struct gss_auth {
struct list_head upcalls;
struct rpc_clnt *client;
struct dentry *dentry;
char path[48];
spinlock_t lock;
};

Expand Down Expand Up @@ -690,10 +689,8 @@ gss_create(struct rpc_clnt *clnt, rpc_authflavor_t flavor)
if (err)
goto err_put_mech;

snprintf(gss_auth->path, sizeof(gss_auth->path), "%s/%s",
clnt->cl_pathname,
gss_auth->mech->gm_name);
gss_auth->dentry = rpc_mkpipe(gss_auth->path, clnt, &gss_upcall_ops, RPC_PIPE_WAIT_FOR_OPEN);
gss_auth->dentry = rpc_mkpipe(clnt->cl_dentry, gss_auth->mech->gm_name,
clnt, &gss_upcall_ops, RPC_PIPE_WAIT_FOR_OPEN);
if (IS_ERR(gss_auth->dentry)) {
err = PTR_ERR(gss_auth->dentry);
goto err_put_mech;
Expand All @@ -718,7 +715,7 @@ gss_destroy(struct rpc_auth *auth)
auth, auth->au_flavor);

gss_auth = container_of(auth, struct gss_auth, rpc_auth);
rpc_unlink(gss_auth->path);
rpc_unlink(gss_auth->dentry);
gss_mech_put(gss_auth->mech);

rpcauth_free_credcache(auth);
Expand Down
53 changes: 36 additions & 17 deletions trunk/net/sunrpc/clnt.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,26 +67,42 @@ static u32 * call_verify(struct rpc_task *task);
static int
rpc_setup_pipedir(struct rpc_clnt *clnt, char *dir_name)
{
static uint32_t clntid;
static unsigned int clntid;
char name[128];
int error;

if (dir_name == NULL)
return 0;
for (;;) {
snprintf(clnt->cl_pathname, sizeof(clnt->cl_pathname),
"%s/clnt%x", dir_name,
(unsigned int)clntid++);
clnt->cl_pathname[sizeof(clnt->cl_pathname) - 1] = '\0';
clnt->cl_dentry = rpc_mkdir(clnt->cl_pathname, clnt);
if (!IS_ERR(clnt->cl_dentry))
return 0;

retry_parent:
clnt->__cl_parent_dentry = rpc_mkdir(NULL, dir_name, NULL);
if (IS_ERR(clnt->__cl_parent_dentry)) {
error = PTR_ERR(clnt->__cl_parent_dentry);
if (error == -EEXIST)
goto retry_parent; /* XXX(hch): WTF? */

printk(KERN_INFO "RPC: Couldn't create pipefs entry %s, error %d\n",
dir_name, error);
return error;
}


retry_child:
snprintf(name, sizeof(name), "clnt%x", clntid++);
name[sizeof(name) - 1] = '\0';

clnt->cl_dentry = rpc_mkdir(clnt->__cl_parent_dentry, name, clnt);
if (IS_ERR(clnt->cl_dentry)) {
error = PTR_ERR(clnt->cl_dentry);
if (error != -EEXIST) {
printk(KERN_INFO "RPC: Couldn't create pipefs entry %s, error %d\n",
clnt->cl_pathname, error);
return error;
}
if (error == -EEXIST)
goto retry_child;
printk(KERN_INFO "RPC: Couldn't create pipefs entry %s, error %d\n",
name, error);
rpc_rmdir(clnt->__cl_parent_dentry);
return error;
}

return 0;
}

/*
Expand Down Expand Up @@ -174,7 +190,8 @@ rpc_new_client(struct rpc_xprt *xprt, char *servname,
return clnt;

out_no_auth:
rpc_rmdir(clnt->cl_pathname);
rpc_rmdir(clnt->cl_dentry);
rpc_rmdir(clnt->__cl_parent_dentry);
out_no_path:
if (clnt->cl_server != clnt->cl_inline_name)
kfree(clnt->cl_server);
Expand Down Expand Up @@ -302,8 +319,10 @@ rpc_destroy_client(struct rpc_clnt *clnt)
rpc_destroy_client(clnt->cl_parent);
goto out_free;
}
if (clnt->cl_pathname[0])
rpc_rmdir(clnt->cl_pathname);
if (clnt->cl_dentry)
rpc_rmdir(clnt->cl_dentry);
if (clnt->__cl_parent_dentry)
rpc_rmdir(clnt->__cl_parent_dentry);
if (clnt->cl_xprt) {
xprt_destroy(clnt->cl_xprt);
clnt->cl_xprt = NULL;
Expand Down
Loading

0 comments on commit 2327dae

Please sign in to comment.