summaryrefslogtreecommitdiffstats
path: root/fs/namei.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2017-01-08 22:35:31 -0500
committerAl Viro <viro@zeniv.linux.org.uk>2017-01-08 22:35:31 -0500
commitad1633a151df9869a222bd99ba04643dc2e0052b (patch)
treeb517b922d08b3389941e8d736bb207f6d28834b7 /fs/namei.c
parent7ce7d89f48834cefece7804d38fc5d85382edf77 (diff)
downloadlinux-ad1633a151df9869a222bd99ba04643dc2e0052b.tar.bz2
namei: fold unlazy_link() into its sole caller
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/namei.c')
-rw-r--r--fs/namei.c32
1 files changed, 11 insertions, 21 deletions
diff --git a/fs/namei.c b/fs/namei.c
index ad74877e1442..f08eca2b788b 100644
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -749,24 +749,6 @@ drop_root_mnt:
return -ECHILD;
}
-static int unlazy_link(struct nameidata *nd, struct path *link, unsigned seq)
-{
- if (unlikely(!legitimize_path(nd, link, seq))) {
- drop_links(nd);
- nd->depth = 0;
- nd->flags &= ~LOOKUP_RCU;
- nd->path.mnt = NULL;
- nd->path.dentry = NULL;
- if (!(nd->flags & LOOKUP_ROOT))
- nd->root.mnt = NULL;
- rcu_read_unlock();
- } else if (likely(unlazy_walk(nd, NULL, 0)) == 0) {
- return 0;
- }
- path_put(link);
- return -ECHILD;
-}
-
static inline int d_revalidate(struct dentry *dentry, unsigned int flags)
{
return dentry->d_op->d_revalidate(dentry, flags);
@@ -1706,9 +1688,17 @@ static int pick_link(struct nameidata *nd, struct path *link,
error = nd_alloc_stack(nd);
if (unlikely(error)) {
if (error == -ECHILD) {
- if (unlikely(unlazy_link(nd, link, seq)))
- return -ECHILD;
- error = nd_alloc_stack(nd);
+ if (unlikely(!legitimize_path(nd, link, seq))) {
+ drop_links(nd);
+ nd->depth = 0;
+ nd->flags &= ~LOOKUP_RCU;
+ nd->path.mnt = NULL;
+ nd->path.dentry = NULL;
+ if (!(nd->flags & LOOKUP_ROOT))
+ nd->root.mnt = NULL;
+ rcu_read_unlock();
+ } else if (likely(unlazy_walk(nd, NULL, 0)) == 0)
+ error = nd_alloc_stack(nd);
}
if (error) {
path_put(link);