summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2008-11-05 15:07:21 +0100
committerAl Viro <viro@zeniv.linux.org.uk>2009-01-01 00:07:41 +0100
commitb4091d5f6fde28ab762e1094a1a26d81f3badfa5 (patch)
tree776e0dfeefb7966f4151fe22cb2b9b7482566714
parentremove incorrect comment in inode_permission (diff)
downloadlinux-b4091d5f6fde28ab762e1094a1a26d81f3badfa5.tar.xz
linux-b4091d5f6fde28ab762e1094a1a26d81f3badfa5.zip
kill walk_init_root
walk_init_root is a tiny helper that is marked __always_inline, has just one caller and an unused argument. Just merge it into the caller. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
-rw-r--r--fs/namei.c21
1 files changed, 8 insertions, 13 deletions
diff --git a/fs/namei.c b/fs/namei.c
index 631cfdd45c68..d4d0b59ed2cc 100644
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -526,18 +526,6 @@ out_unlock:
return result;
}
-/* SMP-safe */
-static __always_inline void
-walk_init_root(const char *name, struct nameidata *nd)
-{
- struct fs_struct *fs = current->fs;
-
- read_lock(&fs->lock);
- nd->path = fs->root;
- path_get(&fs->root);
- read_unlock(&fs->lock);
-}
-
/*
* Wrapper to retry pathname resolution whenever the underlying
* file system returns an ESTALE.
@@ -575,9 +563,16 @@ static __always_inline int __vfs_follow_link(struct nameidata *nd, const char *l
goto fail;
if (*link == '/') {
+ struct fs_struct *fs = current->fs;
+
path_put(&nd->path);
- walk_init_root(link, nd);
+
+ read_lock(&fs->lock);
+ nd->path = fs->root;
+ path_get(&fs->root);
+ read_unlock(&fs->lock);
}
+
res = link_path_walk(link, nd);
if (nd->depth || res || nd->last_type!=LAST_NORM)
return res;