diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2014-11-20 14:23:33 -0500 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2014-12-11 16:27:57 -0500 |
commit | d465887f9d6b692214b0edffddf150eb702d35d9 (patch) | |
tree | 13456c9662e2cb9d2505b25a48e2f1ae19e6b717 /fs/namei.c | |
parent | 980f3ea2f650b0416c7768af09f4dcbd464d6e43 (diff) | |
download | linux-stable-d465887f9d6b692214b0edffddf150eb702d35d9.tar.gz linux-stable-d465887f9d6b692214b0edffddf150eb702d35d9.tar.bz2 linux-stable-d465887f9d6b692214b0edffddf150eb702d35d9.zip |
fs/namei.c: fold link_path_walk() call into path_init()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/namei.c')
-rw-r--r-- | fs/namei.c | 27 |
1 files changed, 6 insertions, 21 deletions
diff --git a/fs/namei.c b/fs/namei.c index 285001f7b84e..7241e267f769 100644 --- a/fs/namei.c +++ b/fs/namei.c @@ -1873,7 +1873,7 @@ static int path_init(int dfd, const char *name, unsigned int flags, } else { path_get(&nd->path); } - return 0; + goto done; } nd->root.mnt = NULL; @@ -1934,13 +1934,16 @@ static int path_init(int dfd, const char *name, unsigned int flags, nd->inode = nd->path.dentry->d_inode; if (!(flags & LOOKUP_RCU)) - return 0; + goto done; if (likely(!read_seqcount_retry(&nd->path.dentry->d_seq, nd->seq))) - return 0; + goto done; if (!(nd->flags & LOOKUP_ROOT)) nd->root.mnt = NULL; rcu_read_unlock(); return -ECHILD; +done: + current->total_link_count = 0; + return link_path_walk(name, nd); } static void path_cleanup(struct nameidata *nd) @@ -1984,13 +1987,6 @@ static int path_lookupat(int dfd, const char *name, * be able to complete). */ err = path_init(dfd, name, flags, nd); - - if (unlikely(err)) - goto out; - - current->total_link_count = 0; - err = link_path_walk(name, nd); - if (!err && !(flags & LOOKUP_PARENT)) { err = lookup_last(nd, &path); while (err > 0) { @@ -2018,7 +2014,6 @@ static int path_lookupat(int dfd, const char *name, } } -out: path_cleanup(nd); return err; } @@ -2333,11 +2328,6 @@ path_mountpoint(int dfd, const char *name, struct path *path, unsigned int flags if (unlikely(err)) goto out; - current->total_link_count = 0; - err = link_path_walk(name, &nd); - if (err) - goto out; - err = mountpoint_last(&nd, path); while (err > 0) { void *cookie; @@ -3224,11 +3214,6 @@ static struct file *path_openat(int dfd, struct filename *pathname, if (unlikely(error)) goto out; - current->total_link_count = 0; - error = link_path_walk(pathname->name, nd); - if (unlikely(error)) - goto out; - error = do_last(nd, &path, file, op, &opened, pathname); while (unlikely(error > 0)) { /* trailing symlink */ struct path link = path; |