Skip to content

Commit c99687a

Browse files
author
Al Viro
committed
fold path_to_nameidata() into its only remaining caller
Signed-off-by: Al Viro <[email protected]>
1 parent 84f0cd9 commit c99687a

File tree

1 file changed

+6
-13
lines changed

1 file changed

+6
-13
lines changed

fs/namei.c

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -860,18 +860,6 @@ static int set_root(struct nameidata *nd)
860860
return 0;
861861
}
862862

863-
static inline void path_to_nameidata(const struct path *path,
864-
struct nameidata *nd)
865-
{
866-
if (!(nd->flags & LOOKUP_RCU)) {
867-
dput(nd->path.dentry);
868-
if (nd->path.mnt != path->mnt)
869-
mntput(nd->path.mnt);
870-
}
871-
nd->path.mnt = path->mnt;
872-
nd->path.dentry = path->dentry;
873-
}
874-
875863
static int nd_jump_root(struct nameidata *nd)
876864
{
877865
if (unlikely(nd->flags & LOOKUP_BENEATH))
@@ -1705,7 +1693,12 @@ static const char *step_into(struct nameidata *nd, int flags,
17051693
((flags & WALK_TRAILING) && !(nd->flags & LOOKUP_FOLLOW)) ||
17061694
(flags & WALK_NOFOLLOW)) {
17071695
/* not a symlink or should not follow */
1708-
path_to_nameidata(&path, nd);
1696+
if (!(nd->flags & LOOKUP_RCU)) {
1697+
dput(nd->path.dentry);
1698+
if (nd->path.mnt != path.mnt)
1699+
mntput(nd->path.mnt);
1700+
}
1701+
nd->path = path;
17091702
nd->inode = inode;
17101703
nd->seq = seq;
17111704
return NULL;

0 commit comments

Comments
 (0)