diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2013-09-10 12:00:43 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2013-09-10 17:06:45 -0400 |
commit | 443ed254c32ae9abf2f984038f656f3283aff759 (patch) | |
tree | e773ecc9866cfebb4cdce559b347820499945345 | |
parent | 4aa32895c3f924c34b9275ca28be534a8a0c624b (diff) |
... and fold the renamed __vfs_follow_link() into its only caller
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
-rw-r--r-- | fs/namei.c | 38 |
1 files changed, 14 insertions, 24 deletions
diff --git a/fs/namei.c b/fs/namei.c index b0b2cf25075b..841c8d9286c0 100644 --- a/fs/namei.c +++ b/fs/namei.c | |||
@@ -660,29 +660,6 @@ static __always_inline void set_root_rcu(struct nameidata *nd) | |||
660 | } | 660 | } |
661 | } | 661 | } |
662 | 662 | ||
663 | static __always_inline int __follow_link(struct nameidata *nd, const char *link) | ||
664 | { | ||
665 | int ret; | ||
666 | |||
667 | if (IS_ERR(link)) | ||
668 | goto fail; | ||
669 | |||
670 | if (*link == '/') { | ||
671 | set_root(nd); | ||
672 | path_put(&nd->path); | ||
673 | nd->path = nd->root; | ||
674 | path_get(&nd->root); | ||
675 | nd->flags |= LOOKUP_JUMPED; | ||
676 | } | ||
677 | nd->inode = nd->path.dentry->d_inode; | ||
678 | |||
679 | ret = link_path_walk(link, nd); | ||
680 | return ret; | ||
681 | fail: | ||
682 | path_put(&nd->path); | ||
683 | return PTR_ERR(link); | ||
684 | } | ||
685 | |||
686 | static void path_put_conditional(struct path *path, struct nameidata *nd) | 663 | static void path_put_conditional(struct path *path, struct nameidata *nd) |
687 | { | 664 | { |
688 | dput(path->dentry); | 665 | dput(path->dentry); |
@@ -874,7 +851,20 @@ follow_link(struct path *link, struct nameidata *nd, void **p) | |||
874 | error = 0; | 851 | error = 0; |
875 | s = nd_get_link(nd); | 852 | s = nd_get_link(nd); |
876 | if (s) { | 853 | if (s) { |
877 | error = __follow_link(nd, s); | 854 | if (unlikely(IS_ERR(s))) { |
855 | path_put(&nd->path); | ||
856 | put_link(nd, link, *p); | ||
857 | return PTR_ERR(s); | ||
858 | } | ||
859 | if (*s == '/') { | ||
860 | set_root(nd); | ||
861 | path_put(&nd->path); | ||
862 | nd->path = nd->root; | ||
863 | path_get(&nd->root); | ||
864 | nd->flags |= LOOKUP_JUMPED; | ||
865 | } | ||
866 | nd->inode = nd->path.dentry->d_inode; | ||
867 | error = link_path_walk(s, nd); | ||
878 | if (unlikely(error)) | 868 | if (unlikely(error)) |
879 | put_link(nd, link, *p); | 869 | put_link(nd, link, *p); |
880 | } | 870 | } |