Skip to content

Commit 19f6028

Browse files
author
Al Viro
committed
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 <[email protected]>
1 parent 2aa3847 commit 19f6028

File tree

1 file changed

+2
-20
lines changed

1 file changed

+2
-20
lines changed

fs/namei.c

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1413,22 +1413,6 @@ static inline int handle_mounts(struct nameidata *nd, struct dentry *dentry,
14131413
return ret;
14141414
}
14151415

1416-
/*
1417-
* Skip to top of mountpoint pile in refwalk mode for follow_dotdot()
1418-
*/
1419-
static void follow_mount(struct path *path)
1420-
{
1421-
while (d_mountpoint(path->dentry)) {
1422-
struct vfsmount *mounted = lookup_mnt(path);
1423-
if (!mounted)
1424-
break;
1425-
dput(path->dentry);
1426-
mntput(path->mnt);
1427-
path->mnt = mounted;
1428-
path->dentry = dget(mounted->mnt_root);
1429-
}
1430-
}
1431-
14321416
/*
14331417
* This looks up the name in dcache and possibly revalidates the found dentry.
14341418
* NULL is returned if the dentry does not exist in the cache.
@@ -2640,23 +2624,21 @@ int path_pts(struct path *path)
26402624
*/
26412625
struct dentry *parent = dget_parent(path->dentry);
26422626
struct dentry *child;
2643-
struct qstr this;
2627+
struct qstr this = QSTR_INIT("pts", 3);
26442628

26452629
if (unlikely(!path_connected(path->mnt, parent))) {
26462630
dput(parent);
26472631
return -ENOENT;
26482632
}
26492633
dput(path->dentry);
26502634
path->dentry = parent;
2651-
this.name = "pts";
2652-
this.len = 3;
26532635
child = d_hash_and_lookup(parent, &this);
26542636
if (!child)
26552637
return -ENOENT;
26562638

26572639
path->dentry = child;
26582640
dput(parent);
2659-
follow_mount(path);
2641+
follow_down(path);
26602642
return 0;
26612643
}
26622644
#endif

0 commit comments

Comments
 (0)