Skip to content

Commit

Permalink
vfs: do_last(): inline lookup_slow()
Browse files Browse the repository at this point in the history
Copy lookup_slow() into do_last().

Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
  • Loading branch information
Miklos Szeredi authored and Al Viro committed Jul 14, 2012
1 parent 6d7b5aa commit 37d7fff
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions fs/namei.c
Original file line number Diff line number Diff line change
Expand Up @@ -2254,9 +2254,22 @@ static struct file *do_last(struct nameidata *nd, struct path *path,
if (error < 0)
goto exit;

error = lookup_slow(nd, &nd->last, path);
if (error < 0)
BUG_ON(nd->inode != dir->d_inode);

mutex_lock(&dir->d_inode->i_mutex);
dentry = __lookup_hash(&nd->last, dir, nd);
mutex_unlock(&dir->d_inode->i_mutex);
error = PTR_ERR(dentry);
if (IS_ERR(dentry))
goto exit;
path->mnt = nd->path.mnt;
path->dentry = dentry;
error = follow_managed(path, nd->flags);
if (unlikely(error < 0))
goto exit_dput;

if (error)
nd->flags |= LOOKUP_JUMPED;

inode = path->dentry->d_inode;
}
Expand Down

0 comments on commit 37d7fff

Please sign in to comment.