Skip to content

Commit

Permalink
kill walk_init_root
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Christoph Hellwig authored and Al Viro committed Dec 31, 2008
1 parent 66f2218 commit b4091d5
Showing 1 changed file with 8 additions and 13 deletions.
21 changes: 8 additions & 13 deletions fs/namei.c
Original file line number Diff line number Diff line change
Expand Up @@ -526,18 +526,6 @@ static struct dentry * real_lookup(struct dentry * parent, struct qstr * name, s
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.
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit b4091d5

Please sign in to comment.