aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAl Viro2020-03-03 10:56:17 -0500
committerAl Viro2020-04-02 01:09:24 -0400
commitc99687a03a78775f77d57fe9b07af4c8ec3dd03c (patch)
tree2065f508a83905962d33eab77cae990ece56db0d
parent84f0cd9e83daa9a9c3e640f6d108e7e86edf0d86 (diff)
fold path_to_nameidata() into its only remaining caller
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
-rw-r--r--fs/namei.c19
1 files changed, 6 insertions, 13 deletions
diff --git a/fs/namei.c b/fs/namei.c
index aab4eee6d56a..0ce515e03e11 100644
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -860,18 +860,6 @@ static int set_root(struct nameidata *nd)
return 0;
}
-static inline void path_to_nameidata(const struct path *path,
- struct nameidata *nd)
-{
- if (!(nd->flags & LOOKUP_RCU)) {
- dput(nd->path.dentry);
- if (nd->path.mnt != path->mnt)
- mntput(nd->path.mnt);
- }
- nd->path.mnt = path->mnt;
- nd->path.dentry = path->dentry;
-}
-
static int nd_jump_root(struct nameidata *nd)
{
if (unlikely(nd->flags & LOOKUP_BENEATH))
@@ -1705,7 +1693,12 @@ static const char *step_into(struct nameidata *nd, int flags,
((flags & WALK_TRAILING) && !(nd->flags & LOOKUP_FOLLOW)) ||
(flags & WALK_NOFOLLOW)) {
/* not a symlink or should not follow */
- path_to_nameidata(&path, nd);
+ if (!(nd->flags & LOOKUP_RCU)) {
+ dput(nd->path.dentry);
+ if (nd->path.mnt != path.mnt)
+ mntput(nd->path.mnt);
+ }
+ nd->path = path;
nd->inode = inode;
nd->seq = seq;
return NULL;