aboutsummaryrefslogtreecommitdiffstats
path: root/net/sunrpc/rpc_pipe.c
diff options
context:
space:
mode:
authorTrond Myklebust <Trond.Myklebust@netapp.com>2006-07-31 17:17:18 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2006-08-24 15:50:32 -0400
commitdff02cc1a34fcb60904a2c57cb351857cc11219e (patch)
treee15957078e7f03f8b2b758cee0f7362d42f83c80 /net/sunrpc/rpc_pipe.c
parent5d67476fff2df6ff12f60b540fd0e74cf2a668f9 (diff)
NFS: clean up rpc_rmdir
Make it take a dentry argument instead of a path Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com> (cherry picked from 648d4116eb2509f010f7f34704a650150309b3e7 commit)
Diffstat (limited to 'net/sunrpc/rpc_pipe.c')
-rw-r--r--net/sunrpc/rpc_pipe.c18
1 files changed, 5 insertions, 13 deletions
diff --git a/net/sunrpc/rpc_pipe.c b/net/sunrpc/rpc_pipe.c
index 9144f2767b66..9c355e1ae61a 100644
--- a/net/sunrpc/rpc_pipe.c
+++ b/net/sunrpc/rpc_pipe.c
@@ -684,28 +684,20 @@ err_dput:
684} 684}
685 685
686int 686int
687rpc_rmdir(char *path) 687rpc_rmdir(struct dentry *dentry)
688{ 688{
689 struct nameidata nd; 689 struct dentry *parent;
690 struct dentry *dentry;
691 struct inode *dir; 690 struct inode *dir;
692 int error; 691 int error;
693 692
694 if ((error = rpc_lookup_parent(path, &nd)) != 0) 693 parent = dget_parent(dentry);
695 return error; 694 dir = parent->d_inode;
696 dir = nd.dentry->d_inode;
697 mutex_lock_nested(&dir->i_mutex, I_MUTEX_PARENT); 695 mutex_lock_nested(&dir->i_mutex, I_MUTEX_PARENT);
698 dentry = lookup_one_len(nd.last.name, nd.dentry, nd.last.len);
699 if (IS_ERR(dentry)) {
700 error = PTR_ERR(dentry);
701 goto out_release;
702 }
703 rpc_depopulate(dentry); 696 rpc_depopulate(dentry);
704 error = __rpc_rmdir(dir, dentry); 697 error = __rpc_rmdir(dir, dentry);
705 dput(dentry); 698 dput(dentry);
706out_release:
707 mutex_unlock(&dir->i_mutex); 699 mutex_unlock(&dir->i_mutex);
708 rpc_release_path(&nd); 700 dput(parent);
709 return error; 701 return error;
710} 702}
711 703