提交 b4091d5f 编写于 作者: C Christoph Hellwig 提交者: Al Viro

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: NChristoph Hellwig <hch@lst.de>
Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
上级 66f22187
...@@ -526,18 +526,6 @@ static struct dentry * real_lookup(struct dentry * parent, struct qstr * name, s ...@@ -526,18 +526,6 @@ static struct dentry * real_lookup(struct dentry * parent, struct qstr * name, s
return result; 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 * Wrapper to retry pathname resolution whenever the underlying
* file system returns an ESTALE. * file system returns an ESTALE.
...@@ -575,9 +563,16 @@ static __always_inline int __vfs_follow_link(struct nameidata *nd, const char *l ...@@ -575,9 +563,16 @@ static __always_inline int __vfs_follow_link(struct nameidata *nd, const char *l
goto fail; goto fail;
if (*link == '/') { if (*link == '/') {
struct fs_struct *fs = current->fs;
path_put(&nd->path); 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); res = link_path_walk(link, nd);
if (nd->depth || res || nd->last_type!=LAST_NORM) if (nd->depth || res || nd->last_type!=LAST_NORM)
return res; return res;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册