diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2020-01-12 13:54:30 -0500 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2020-03-13 21:08:17 -0400 |
commit | a9dc1494a78291bba3bfd427d90024659c942803 (patch) | |
tree | bf74db5d14c8803b05c9a05fe737d205973fce50 /fs/namei.c | |
parent | 161aff1d93abf0e5b5e9dbca88928998c155f677 (diff) | |
download | lwn-a9dc1494a78291bba3bfd427d90024659c942803.tar.gz lwn-a9dc1494a78291bba3bfd427d90024659c942803.zip |
expand the only remaining call of path_lookup_conditional()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/namei.c')
-rw-r--r-- | fs/namei.c | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/fs/namei.c b/fs/namei.c index 0fcd738b95b9..e3393511d426 100644 --- a/fs/namei.c +++ b/fs/namei.c @@ -858,13 +858,6 @@ static int set_root(struct nameidata *nd) return 0; } -static void path_put_conditional(struct path *path, struct nameidata *nd) -{ - dput(path->dentry); - if (path->mnt != nd->path.mnt) - mntput(path->mnt); -} - static inline void path_to_nameidata(const struct path *path, struct nameidata *nd) { @@ -1312,8 +1305,11 @@ static int follow_managed(struct path *path, struct nameidata *nd) ret = 1; if (ret > 0 && unlikely(d_flags_negative(flags))) ret = -ENOENT; - if (unlikely(ret < 0)) - path_put_conditional(path, nd); + if (unlikely(ret < 0)) { + dput(path->dentry); + if (path->mnt != nd->path.mnt) + mntput(path->mnt); + } return ret; } |