OSDN Git Service

fold path_to_nameidata() into its only remaining caller
authorAl Viro <viro@zeniv.linux.org.uk>
Tue, 3 Mar 2020 15:56:17 +0000 (10:56 -0500)
committerAl Viro <viro@zeniv.linux.org.uk>
Thu, 2 Apr 2020 05:09:24 +0000 (01:09 -0400)
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
fs/namei.c

index aab4eee..0ce515e 100644 (file)
@@ -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;