From 37d7fffc9cafe75ded8a840fa30ba625f99ed7ae Mon Sep 17 00:00:00 2001 From: Miklos Szeredi Date: Tue, 5 Jun 2012 15:10:12 +0200 Subject: vfs: do_last(): inline lookup_slow() Copy lookup_slow() into do_last(). Signed-off-by: Miklos Szeredi Signed-off-by: Al Viro --- fs/namei.c | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'fs/namei.c') diff --git a/fs/namei.c b/fs/namei.c index 6135a14d5a8..68742e3cb98 100644 --- a/fs/namei.c +++ b/fs/namei.c @@ -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; } -- cgit v1.2.3