[PATCH] RPC,NFS: new rpc_pipefs patch
Currently rpc_mkdir/rpc_rmdir and rpc_mkpipe/mk_unlink have an API that's a little unfortunate. They take a path relative to the rpc_pipefs root and thus need to perform a full lookup. If you look at debugfs or usbfs they always store the dentry for directories they created and thus can pass in a dentry + single pathname component pair into their equivalents of the above functions. And in fact rpc_pipefs actually stores a dentry for all but one component so this change not only simplifies the core rpc_pipe code but also the callers. Unfortuntately this code path is only used by the NFS4 idmapper and AUTH_GSSAPI for which I don't have a test enviroment. Could someone give it a spin? It's the last bit needed before we can rework the lookup_hash API Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
This commit is contained in:
committed by
Trond Myklebust
parent
470056c288
commit
278c995c8a
@@ -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;
|
||||
@@ -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;
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user