aboutsummaryrefslogtreecommitdiffstats
path: root/fs/namei.c
diff options
context:
space:
mode:
authorJan Blunck <jblunck@suse.de>2008-02-14 22:34:37 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2008-02-15 00:13:33 -0500
commit09da5916baf6d3fb9ac16c125c801ae6ea151f97 (patch)
tree9cb3d90969fec6c24cb6505f59c097529dc62197 /fs/namei.c
parent1d957f9bf87da74f420424d16ece005202bbebd3 (diff)
Use path_put() in a few places instead of {mnt,d}put()
Use path_put() in a few places instead of {mnt,d}put() Signed-off-by: Jan Blunck <jblunck@suse.de> Signed-off-by: Andreas Gruenbacher <agruen@suse.de> Acked-by: Christoph Hellwig <hch@lst.de> Cc: Al Viro <viro@zeniv.linux.org.uk> Acked-by: David Howells <dhowells@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/namei.c')
-rw-r--r--fs/namei.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/fs/namei.c b/fs/namei.c
index b0df7ea733d7..024993535b6f 100644
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -625,8 +625,7 @@ static __always_inline int __do_follow_link(struct path *path, struct nameidata
625 if (dentry->d_inode->i_op->put_link) 625 if (dentry->d_inode->i_op->put_link)
626 dentry->d_inode->i_op->put_link(dentry, nd, cookie); 626 dentry->d_inode->i_op->put_link(dentry, nd, cookie);
627 } 627 }
628 dput(dentry); 628 path_put(path);
629 mntput(path->mnt);
630 629
631 return error; 630 return error;
632} 631}
@@ -1033,8 +1032,7 @@ static int link_path_walk(const char *name, struct nameidata *nd)
1033 result = __link_path_walk(name, nd); 1032 result = __link_path_walk(name, nd);
1034 } 1033 }
1035 1034
1036 dput(save.path.dentry); 1035 path_put(&save.path);
1037 mntput(save.path.mnt);
1038 1036
1039 return result; 1037 return result;
1040} 1038}
@@ -1056,8 +1054,7 @@ static int __emul_lookup_dentry(const char *name, struct nameidata *nd)
1056 1054
1057 if (!nd->path.dentry->d_inode || 1055 if (!nd->path.dentry->d_inode ||
1058 S_ISDIR(nd->path.dentry->d_inode->i_mode)) { 1056 S_ISDIR(nd->path.dentry->d_inode->i_mode)) {
1059 struct dentry *old_dentry = nd->path.dentry; 1057 struct path old_path = nd->path;
1060 struct vfsmount *old_mnt = nd->path.mnt;
1061 struct qstr last = nd->last; 1058 struct qstr last = nd->last;
1062 int last_type = nd->last_type; 1059 int last_type = nd->last_type;
1063 struct fs_struct *fs = current->fs; 1060 struct fs_struct *fs = current->fs;
@@ -1073,14 +1070,12 @@ static int __emul_lookup_dentry(const char *name, struct nameidata *nd)
1073 read_unlock(&fs->lock); 1070 read_unlock(&fs->lock);
1074 if (path_walk(name, nd) == 0) { 1071 if (path_walk(name, nd) == 0) {
1075 if (nd->path.dentry->d_inode) { 1072 if (nd->path.dentry->d_inode) {
1076 dput(old_dentry); 1073 path_put(&old_path);
1077 mntput(old_mnt);
1078 return 1; 1074 return 1;
1079 } 1075 }
1080 path_put(&nd->path); 1076 path_put(&nd->path);
1081 } 1077 }
1082 nd->path.dentry = old_dentry; 1078 nd->path = old_path;
1083 nd->path.mnt = old_mnt;
1084 nd->last = last; 1079 nd->last = last;
1085 nd->last_type = last_type; 1080 nd->last_type = last_type;
1086 } 1081 }