lkml.org 
[lkml]   [2020]   [Mar]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[RFC][PATCH v4 55/69] fs/namei.c: kill follow_mount()
Date
From: Al Viro <viro@zeniv.linux.org.uk>

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>
---
fs/namei.c | 22 ++--------------------
1 file changed, 2 insertions(+), 20 deletions(-)

diff --git a/fs/namei.c b/fs/namei.c
index a9622e629e76..fc946d6f02d6 100644
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -1414,22 +1414,6 @@ static bool choose_mountpoint(struct mount *m, const struct path *root,
}

/*
- * 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.
* NULL is returned if the dentry does not exist in the cache.
*/
@@ -2639,7 +2623,7 @@ int path_pts(struct path *path)
*/
struct dentry *parent = dget_parent(path->dentry);
struct dentry *child;
- struct qstr this;
+ struct qstr this = QSTR_INIT("pts", 3);

if (unlikely(!path_connected(path->mnt, parent))) {
dput(parent);
@@ -2647,15 +2631,13 @@ int path_pts(struct path *path)
}
dput(path->dentry);
path->dentry = parent;
- this.name = "pts";
- this.len = 3;
child = d_hash_and_lookup(parent, &this);
if (!child)
return -ENOENT;

path->dentry = child;
dput(parent);
- follow_mount(path);
+ follow_down(path);
return 0;
}
#endif
--
2.11.0
\
 
 \ /
  Last update: 2020-03-14 00:55    [W:0.384 / U:0.848 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site