fs/namei.c: kill follow_mount()
The only remaining caller (path_pts()) should be using follow_down() anyway. And clean path_pts() a bit. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
parent
2aa3847085
commit
19f6028a01
22
fs/namei.c
22
fs/namei.c
@ -1413,22 +1413,6 @@ static inline int handle_mounts(struct nameidata *nd, struct dentry *dentry,
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* Skip to top of mountpoint pile in refwalk mode for follow_dotdot()
|
|
||||||
*/
|
|
||||||
static void follow_mount(struct path *path)
|
|
||||||
{
|
|
||||||
while (d_mountpoint(path->dentry)) {
|
|
||||||
struct vfsmount *mounted = lookup_mnt(path);
|
|
||||||
if (!mounted)
|
|
||||||
break;
|
|
||||||
dput(path->dentry);
|
|
||||||
mntput(path->mnt);
|
|
||||||
path->mnt = mounted;
|
|
||||||
path->dentry = dget(mounted->mnt_root);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This looks up the name in dcache and possibly revalidates the found dentry.
|
* This looks up the name in dcache and possibly revalidates the found dentry.
|
||||||
* NULL is returned if the dentry does not exist in the cache.
|
* NULL is returned if the dentry does not exist in the cache.
|
||||||
@ -2640,7 +2624,7 @@ int path_pts(struct path *path)
|
|||||||
*/
|
*/
|
||||||
struct dentry *parent = dget_parent(path->dentry);
|
struct dentry *parent = dget_parent(path->dentry);
|
||||||
struct dentry *child;
|
struct dentry *child;
|
||||||
struct qstr this;
|
struct qstr this = QSTR_INIT("pts", 3);
|
||||||
|
|
||||||
if (unlikely(!path_connected(path->mnt, parent))) {
|
if (unlikely(!path_connected(path->mnt, parent))) {
|
||||||
dput(parent);
|
dput(parent);
|
||||||
@ -2648,15 +2632,13 @@ int path_pts(struct path *path)
|
|||||||
}
|
}
|
||||||
dput(path->dentry);
|
dput(path->dentry);
|
||||||
path->dentry = parent;
|
path->dentry = parent;
|
||||||
this.name = "pts";
|
|
||||||
this.len = 3;
|
|
||||||
child = d_hash_and_lookup(parent, &this);
|
child = d_hash_and_lookup(parent, &this);
|
||||||
if (!child)
|
if (!child)
|
||||||
return -ENOENT;
|
return -ENOENT;
|
||||||
|
|
||||||
path->dentry = child;
|
path->dentry = child;
|
||||||
dput(parent);
|
dput(parent);
|
||||||
follow_mount(path);
|
follow_down(path);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user