diff options
author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2006-07-31 17:11:48 -0400 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2006-08-24 15:50:07 -0400 |
commit | 5d67476fff2df6ff12f60b540fd0e74cf2a668f9 (patch) | |
tree | d1428c5562ce6b24919da18c44746d363e9864e1 | |
parent | a634904a7de0d3a0bc606f608007a34e8c05bfee (diff) |
SUNRPC: make rpc_unlink() take a dentry argument instead of a path
Signe-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
(cherry picked from 88bf6d811b01a4be7fd507d18bf5f1c527989089 commit)
-rw-r--r-- | fs/nfs/idmap.c | 3 | ||||
-rw-r--r-- | include/linux/sunrpc/rpc_pipe_fs.h | 2 | ||||
-rw-r--r-- | net/sunrpc/auth_gss/auth_gss.c | 2 | ||||
-rw-r--r-- | net/sunrpc/rpc_pipe.c | 20 |
4 files changed, 9 insertions, 18 deletions
diff --git a/fs/nfs/idmap.c b/fs/nfs/idmap.c index b81e7ed3c902..df0be1214358 100644 --- a/fs/nfs/idmap.c +++ b/fs/nfs/idmap.c | |||
@@ -130,9 +130,8 @@ nfs_idmap_delete(struct nfs4_client *clp) | |||
130 | 130 | ||
131 | if (!idmap) | 131 | if (!idmap) |
132 | return; | 132 | return; |
133 | rpc_unlink(idmap->idmap_dentry); | ||
133 | dput(idmap->idmap_dentry); | 134 | dput(idmap->idmap_dentry); |
134 | idmap->idmap_dentry = NULL; | ||
135 | rpc_unlink(idmap->idmap_path); | ||
136 | clp->cl_idmap = NULL; | 135 | clp->cl_idmap = NULL; |
137 | kfree(idmap); | 136 | kfree(idmap); |
138 | } | 137 | } |
diff --git a/include/linux/sunrpc/rpc_pipe_fs.h b/include/linux/sunrpc/rpc_pipe_fs.h index 2c2189cb30aa..04d2767d5ef7 100644 --- a/include/linux/sunrpc/rpc_pipe_fs.h +++ b/include/linux/sunrpc/rpc_pipe_fs.h | |||
@@ -44,7 +44,7 @@ extern int rpc_queue_upcall(struct inode *, struct rpc_pipe_msg *); | |||
44 | extern struct dentry *rpc_mkdir(char *, struct rpc_clnt *); | 44 | extern struct dentry *rpc_mkdir(char *, struct rpc_clnt *); |
45 | extern int rpc_rmdir(char *); | 45 | extern int rpc_rmdir(char *); |
46 | extern struct dentry *rpc_mkpipe(char *, void *, struct rpc_pipe_ops *, int flags); | 46 | extern struct dentry *rpc_mkpipe(char *, void *, struct rpc_pipe_ops *, int flags); |
47 | extern int rpc_unlink(char *); | 47 | extern int rpc_unlink(struct dentry *); |
48 | extern struct vfsmount *rpc_get_mount(void); | 48 | extern struct vfsmount *rpc_get_mount(void); |
49 | extern void rpc_put_mount(void); | 49 | extern void rpc_put_mount(void); |
50 | 50 | ||
diff --git a/net/sunrpc/auth_gss/auth_gss.c b/net/sunrpc/auth_gss/auth_gss.c index 4a9aa9393b97..beaa7b848246 100644 --- a/net/sunrpc/auth_gss/auth_gss.c +++ b/net/sunrpc/auth_gss/auth_gss.c | |||
@@ -718,7 +718,7 @@ gss_destroy(struct rpc_auth *auth) | |||
718 | auth, auth->au_flavor); | 718 | auth, auth->au_flavor); |
719 | 719 | ||
720 | gss_auth = container_of(auth, struct gss_auth, rpc_auth); | 720 | gss_auth = container_of(auth, struct gss_auth, rpc_auth); |
721 | rpc_unlink(gss_auth->path); | 721 | rpc_unlink(gss_auth->dentry); |
722 | dput(gss_auth->dentry); | 722 | dput(gss_auth->dentry); |
723 | gss_auth->dentry = NULL; | 723 | gss_auth->dentry = NULL; |
724 | gss_mech_put(gss_auth->mech); | 724 | gss_mech_put(gss_auth->mech); |
diff --git a/net/sunrpc/rpc_pipe.c b/net/sunrpc/rpc_pipe.c index a3bd2db2e024..9144f2767b66 100644 --- a/net/sunrpc/rpc_pipe.c +++ b/net/sunrpc/rpc_pipe.c | |||
@@ -746,22 +746,15 @@ err_dput: | |||
746 | } | 746 | } |
747 | 747 | ||
748 | int | 748 | int |
749 | rpc_unlink(char *path) | 749 | rpc_unlink(struct dentry *dentry) |
750 | { | 750 | { |
751 | struct nameidata nd; | 751 | struct dentry *parent; |
752 | struct dentry *dentry; | ||
753 | struct inode *dir; | 752 | struct inode *dir; |
754 | int error; | 753 | int error = 0; |
755 | 754 | ||
756 | if ((error = rpc_lookup_parent(path, &nd)) != 0) | 755 | parent = dget_parent(dentry); |
757 | return error; | 756 | dir = parent->d_inode; |
758 | dir = nd.dentry->d_inode; | ||
759 | mutex_lock_nested(&dir->i_mutex, I_MUTEX_PARENT); | 757 | mutex_lock_nested(&dir->i_mutex, I_MUTEX_PARENT); |
760 | dentry = lookup_one_len(nd.last.name, nd.dentry, nd.last.len); | ||
761 | if (IS_ERR(dentry)) { | ||
762 | error = PTR_ERR(dentry); | ||
763 | goto out_release; | ||
764 | } | ||
765 | d_drop(dentry); | 758 | d_drop(dentry); |
766 | if (dentry->d_inode) { | 759 | if (dentry->d_inode) { |
767 | rpc_close_pipes(dentry->d_inode); | 760 | rpc_close_pipes(dentry->d_inode); |
@@ -769,9 +762,8 @@ rpc_unlink(char *path) | |||
769 | } | 762 | } |
770 | dput(dentry); | 763 | dput(dentry); |
771 | inode_dir_notify(dir, DN_DELETE); | 764 | inode_dir_notify(dir, DN_DELETE); |
772 | out_release: | ||
773 | mutex_unlock(&dir->i_mutex); | 765 | mutex_unlock(&dir->i_mutex); |
774 | rpc_release_path(&nd); | 766 | dput(parent); |
775 | return error; | 767 | return error; |
776 | } | 768 | } |
777 | 769 | ||