Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

authored by

Jan Blunck and committed by
Linus Torvalds
09da5916 1d957f9b

+6 -12
+1 -2
fs/afs/mntpt.c
··· 235 235 err = do_add_mount(newmnt, nd, MNT_SHRINKABLE, &afs_vfsmounts); 236 236 switch (err) { 237 237 case 0: 238 - dput(nd->path.dentry); 239 - mntput(nd->path.mnt); 238 + path_put(&nd->path); 240 239 nd->path.mnt = newmnt; 241 240 nd->path.dentry = dget(newmnt->mnt_root); 242 241 schedule_delayed_work(&afs_mntpt_expiry_timer,
+5 -10
fs/namei.c
··· 625 625 if (dentry->d_inode->i_op->put_link) 626 626 dentry->d_inode->i_op->put_link(dentry, nd, cookie); 627 627 } 628 - dput(dentry); 629 - mntput(path->mnt); 628 + path_put(path); 630 629 631 630 return error; 632 631 } ··· 1032 1033 result = __link_path_walk(name, nd); 1033 1034 } 1034 1035 1035 - dput(save.path.dentry); 1036 - mntput(save.path.mnt); 1036 + path_put(&save.path); 1037 1037 1038 1038 return result; 1039 1039 } ··· 1054 1056 1055 1057 if (!nd->path.dentry->d_inode || 1056 1058 S_ISDIR(nd->path.dentry->d_inode->i_mode)) { 1057 - struct dentry *old_dentry = nd->path.dentry; 1058 - struct vfsmount *old_mnt = nd->path.mnt; 1059 + struct path old_path = nd->path; 1059 1060 struct qstr last = nd->last; 1060 1061 int last_type = nd->last_type; 1061 1062 struct fs_struct *fs = current->fs; ··· 1070 1073 read_unlock(&fs->lock); 1071 1074 if (path_walk(name, nd) == 0) { 1072 1075 if (nd->path.dentry->d_inode) { 1073 - dput(old_dentry); 1074 - mntput(old_mnt); 1076 + path_put(&old_path); 1075 1077 return 1; 1076 1078 } 1077 1079 path_put(&nd->path); 1078 1080 } 1079 - nd->path.dentry = old_dentry; 1080 - nd->path.mnt = old_mnt; 1081 + nd->path = old_path; 1081 1082 nd->last = last; 1082 1083 nd->last_type = last_type; 1083 1084 }