diff options
| author | Jan Blunck <jblunck@suse.de> | 2008-02-14 22:34:37 -0500 |
|---|---|---|
| committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2008-02-15 00:13:33 -0500 |
| commit | 09da5916baf6d3fb9ac16c125c801ae6ea151f97 (patch) | |
| tree | 9cb3d90969fec6c24cb6505f59c097529dc62197 | |
| parent | 1d957f9bf87da74f420424d16ece005202bbebd3 (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>
| -rw-r--r-- | fs/afs/mntpt.c | 3 | ||||
| -rw-r--r-- | fs/namei.c | 15 |
2 files changed, 6 insertions, 12 deletions
diff --git a/fs/afs/mntpt.c b/fs/afs/mntpt.c index e13cea220669..a3510b8ba3e7 100644 --- a/fs/afs/mntpt.c +++ b/fs/afs/mntpt.c | |||
| @@ -235,8 +235,7 @@ static void *afs_mntpt_follow_link(struct dentry *dentry, struct nameidata *nd) | |||
| 235 | err = do_add_mount(newmnt, nd, MNT_SHRINKABLE, &afs_vfsmounts); | 235 | err = do_add_mount(newmnt, nd, MNT_SHRINKABLE, &afs_vfsmounts); |
| 236 | switch (err) { | 236 | switch (err) { |
| 237 | case 0: | 237 | case 0: |
| 238 | dput(nd->path.dentry); | 238 | path_put(&nd->path); |
| 239 | mntput(nd->path.mnt); | ||
| 240 | nd->path.mnt = newmnt; | 239 | nd->path.mnt = newmnt; |
| 241 | nd->path.dentry = dget(newmnt->mnt_root); | 240 | nd->path.dentry = dget(newmnt->mnt_root); |
| 242 | schedule_delayed_work(&afs_mntpt_expiry_timer, | 241 | schedule_delayed_work(&afs_mntpt_expiry_timer, |
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 | } |
