Loading fs/nfs/idmap.c +7 −3 Original line number Diff line number Diff line Loading @@ -66,6 +66,7 @@ struct idmap_hashtable { }; struct idmap { char idmap_path[48]; struct dentry *idmap_dentry; wait_queue_head_t idmap_wq; struct idmap_msg idmap_im; Loading Loading @@ -101,8 +102,11 @@ nfs_idmap_new(struct nfs4_client *clp) memset(idmap, 0, sizeof(*idmap)); idmap->idmap_dentry = rpc_mkpipe(clp->cl_rpcclient->cl_dentry, "idmap", idmap, &idmap_upcall_ops, 0); 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)) { kfree(idmap); return; Loading @@ -124,7 +128,7 @@ nfs_idmap_delete(struct nfs4_client *clp) if (!idmap) return; rpc_unlink(idmap->idmap_dentry); rpc_unlink(idmap->idmap_path); clp->cl_idmap = NULL; kfree(idmap); } Loading include/linux/sunrpc/clnt.h +1 −1 Original line number Diff line number Diff line Loading @@ -59,7 +59,7 @@ struct rpc_clnt { int cl_nodelen; /* nodename length */ char cl_nodename[UNX_MAXNODENAME]; struct dentry * __cl_parent_dentry; char cl_pathname[30];/* Path in rpc_pipe_fs */ struct dentry * cl_dentry; /* inode */ struct rpc_clnt * cl_parent; /* Points to parent of clones */ struct rpc_rtt cl_rtt_default; Loading include/linux/sunrpc/rpc_pipe_fs.h +4 −5 Original line number Diff line number Diff line Loading @@ -41,11 +41,10 @@ RPC_I(struct inode *inode) extern int rpc_queue_upcall(struct inode *, struct rpc_pipe_msg *); 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 *); 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 *); #endif #endif net/sunrpc/auth_gss/auth_gss.c +6 −3 Original line number Diff line number Diff line Loading @@ -87,6 +87,7 @@ struct gss_auth { struct list_head upcalls; struct rpc_clnt *client; struct dentry *dentry; char path[48]; spinlock_t lock; }; Loading Loading @@ -689,8 +690,10 @@ gss_create(struct rpc_clnt *clnt, rpc_authflavor_t flavor) if (err) goto err_put_mech; gss_auth->dentry = rpc_mkpipe(clnt->cl_dentry, gss_auth->mech->gm_name, clnt, &gss_upcall_ops, RPC_PIPE_WAIT_FOR_OPEN); 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); if (IS_ERR(gss_auth->dentry)) { err = PTR_ERR(gss_auth->dentry); goto err_put_mech; Loading @@ -715,7 +718,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->dentry); rpc_unlink(gss_auth->path); gss_mech_put(gss_auth->mech); rpcauth_free_credcache(auth); Loading net/sunrpc/clnt.c +17 −36 Original line number Diff line number Diff line Loading @@ -67,42 +67,26 @@ static u32 * call_verify(struct rpc_task *task); static int rpc_setup_pipedir(struct rpc_clnt *clnt, char *dir_name) { static unsigned int clntid; char name[128]; static uint32_t clntid; int error; if (dir_name == NULL) 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)) { 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; error = PTR_ERR(clnt->cl_dentry); if (error == -EEXIST) goto retry_child; if (error != -EEXIST) { printk(KERN_INFO "RPC: Couldn't create pipefs entry %s, error %d\n", name, error); rpc_rmdir(clnt->__cl_parent_dentry); clnt->cl_pathname, error); return error; } return 0; } } /* Loading Loading @@ -190,8 +174,7 @@ rpc_new_client(struct rpc_xprt *xprt, char *servname, return clnt; out_no_auth: rpc_rmdir(clnt->cl_dentry); rpc_rmdir(clnt->__cl_parent_dentry); rpc_rmdir(clnt->cl_pathname); out_no_path: if (clnt->cl_server != clnt->cl_inline_name) kfree(clnt->cl_server); Loading Loading @@ -319,10 +302,8 @@ rpc_destroy_client(struct rpc_clnt *clnt) rpc_destroy_client(clnt->cl_parent); goto out_free; } if (clnt->cl_dentry) rpc_rmdir(clnt->cl_dentry); if (clnt->__cl_parent_dentry) rpc_rmdir(clnt->__cl_parent_dentry); if (clnt->cl_pathname[0]) rpc_rmdir(clnt->cl_pathname); if (clnt->cl_xprt) { xprt_destroy(clnt->cl_xprt); clnt->cl_xprt = NULL; Loading Loading
fs/nfs/idmap.c +7 −3 Original line number Diff line number Diff line Loading @@ -66,6 +66,7 @@ struct idmap_hashtable { }; struct idmap { char idmap_path[48]; struct dentry *idmap_dentry; wait_queue_head_t idmap_wq; struct idmap_msg idmap_im; Loading Loading @@ -101,8 +102,11 @@ nfs_idmap_new(struct nfs4_client *clp) memset(idmap, 0, sizeof(*idmap)); idmap->idmap_dentry = rpc_mkpipe(clp->cl_rpcclient->cl_dentry, "idmap", idmap, &idmap_upcall_ops, 0); 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)) { kfree(idmap); return; Loading @@ -124,7 +128,7 @@ nfs_idmap_delete(struct nfs4_client *clp) if (!idmap) return; rpc_unlink(idmap->idmap_dentry); rpc_unlink(idmap->idmap_path); clp->cl_idmap = NULL; kfree(idmap); } Loading
include/linux/sunrpc/clnt.h +1 −1 Original line number Diff line number Diff line Loading @@ -59,7 +59,7 @@ struct rpc_clnt { int cl_nodelen; /* nodename length */ char cl_nodename[UNX_MAXNODENAME]; struct dentry * __cl_parent_dentry; char cl_pathname[30];/* Path in rpc_pipe_fs */ struct dentry * cl_dentry; /* inode */ struct rpc_clnt * cl_parent; /* Points to parent of clones */ struct rpc_rtt cl_rtt_default; Loading
include/linux/sunrpc/rpc_pipe_fs.h +4 −5 Original line number Diff line number Diff line Loading @@ -41,11 +41,10 @@ RPC_I(struct inode *inode) extern int rpc_queue_upcall(struct inode *, struct rpc_pipe_msg *); 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 *); 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 *); #endif #endif
net/sunrpc/auth_gss/auth_gss.c +6 −3 Original line number Diff line number Diff line Loading @@ -87,6 +87,7 @@ struct gss_auth { struct list_head upcalls; struct rpc_clnt *client; struct dentry *dentry; char path[48]; spinlock_t lock; }; Loading Loading @@ -689,8 +690,10 @@ gss_create(struct rpc_clnt *clnt, rpc_authflavor_t flavor) if (err) goto err_put_mech; gss_auth->dentry = rpc_mkpipe(clnt->cl_dentry, gss_auth->mech->gm_name, clnt, &gss_upcall_ops, RPC_PIPE_WAIT_FOR_OPEN); 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); if (IS_ERR(gss_auth->dentry)) { err = PTR_ERR(gss_auth->dentry); goto err_put_mech; Loading @@ -715,7 +718,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->dentry); rpc_unlink(gss_auth->path); gss_mech_put(gss_auth->mech); rpcauth_free_credcache(auth); Loading
net/sunrpc/clnt.c +17 −36 Original line number Diff line number Diff line Loading @@ -67,42 +67,26 @@ static u32 * call_verify(struct rpc_task *task); static int rpc_setup_pipedir(struct rpc_clnt *clnt, char *dir_name) { static unsigned int clntid; char name[128]; static uint32_t clntid; int error; if (dir_name == NULL) 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)) { 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; error = PTR_ERR(clnt->cl_dentry); if (error == -EEXIST) goto retry_child; if (error != -EEXIST) { printk(KERN_INFO "RPC: Couldn't create pipefs entry %s, error %d\n", name, error); rpc_rmdir(clnt->__cl_parent_dentry); clnt->cl_pathname, error); return error; } return 0; } } /* Loading Loading @@ -190,8 +174,7 @@ rpc_new_client(struct rpc_xprt *xprt, char *servname, return clnt; out_no_auth: rpc_rmdir(clnt->cl_dentry); rpc_rmdir(clnt->__cl_parent_dentry); rpc_rmdir(clnt->cl_pathname); out_no_path: if (clnt->cl_server != clnt->cl_inline_name) kfree(clnt->cl_server); Loading Loading @@ -319,10 +302,8 @@ rpc_destroy_client(struct rpc_clnt *clnt) rpc_destroy_client(clnt->cl_parent); goto out_free; } if (clnt->cl_dentry) rpc_rmdir(clnt->cl_dentry); if (clnt->__cl_parent_dentry) rpc_rmdir(clnt->__cl_parent_dentry); if (clnt->cl_pathname[0]) rpc_rmdir(clnt->cl_pathname); if (clnt->cl_xprt) { xprt_destroy(clnt->cl_xprt); clnt->cl_xprt = NULL; Loading