mirror of
https://github.com/followmsi/android_kernel_google_msm.git
synced 2024-11-06 23:17:41 +00:00
untangling do_lookup() - take __lookup_hash()-calling case out of line.
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
parent
a32555466c
commit
81e6f52089
1 changed files with 17 additions and 16 deletions
33
fs/namei.c
33
fs/namei.c
|
@ -1208,22 +1208,14 @@ unlazy:
|
||||||
dentry = __d_lookup(parent, name);
|
dentry = __d_lookup(parent, name);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dentry && unlikely(d_need_lookup(dentry))) {
|
if (unlikely(!dentry))
|
||||||
dput(dentry);
|
goto need_lookup;
|
||||||
dentry = NULL;
|
|
||||||
}
|
|
||||||
retry:
|
|
||||||
if (unlikely(!dentry)) {
|
|
||||||
struct inode *dir = parent->d_inode;
|
|
||||||
BUG_ON(nd->inode != dir);
|
|
||||||
|
|
||||||
mutex_lock(&dir->i_mutex);
|
if (unlikely(d_need_lookup(dentry))) {
|
||||||
dentry = __lookup_hash(name, parent, nd);
|
dput(dentry);
|
||||||
mutex_unlock(&dir->i_mutex);
|
goto need_lookup;
|
||||||
if (IS_ERR(dentry))
|
|
||||||
return PTR_ERR(dentry);
|
|
||||||
goto done;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (unlikely(dentry->d_flags & DCACHE_OP_REVALIDATE) && need_reval)
|
if (unlikely(dentry->d_flags & DCACHE_OP_REVALIDATE) && need_reval)
|
||||||
status = d_revalidate(dentry, nd);
|
status = d_revalidate(dentry, nd);
|
||||||
if (unlikely(status <= 0)) {
|
if (unlikely(status <= 0)) {
|
||||||
|
@ -1233,8 +1225,7 @@ retry:
|
||||||
}
|
}
|
||||||
if (!d_invalidate(dentry)) {
|
if (!d_invalidate(dentry)) {
|
||||||
dput(dentry);
|
dput(dentry);
|
||||||
dentry = NULL;
|
goto need_lookup;
|
||||||
goto retry;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
done:
|
done:
|
||||||
|
@ -1249,6 +1240,16 @@ done:
|
||||||
nd->flags |= LOOKUP_JUMPED;
|
nd->flags |= LOOKUP_JUMPED;
|
||||||
*inode = path->dentry->d_inode;
|
*inode = path->dentry->d_inode;
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
need_lookup:
|
||||||
|
BUG_ON(nd->inode != parent->d_inode);
|
||||||
|
|
||||||
|
mutex_lock(&parent->d_inode->i_mutex);
|
||||||
|
dentry = __lookup_hash(name, parent, nd);
|
||||||
|
mutex_unlock(&parent->d_inode->i_mutex);
|
||||||
|
if (IS_ERR(dentry))
|
||||||
|
return PTR_ERR(dentry);
|
||||||
|
goto done;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline int may_lookup(struct nameidata *nd)
|
static inline int may_lookup(struct nameidata *nd)
|
||||||
|
|
Loading…
Reference in a new issue