Commit 24643087 authored by Al Viro's avatar Al Viro

in do_lookup() split RCU and non-RCU cases of need_revalidate

and use unlikely() instead of gotos, for fsck sake...
Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
parent 844a3917
...@@ -1259,9 +1259,15 @@ static int do_lookup(struct nameidata *nd, struct qstr *name, ...@@ -1259,9 +1259,15 @@ static int do_lookup(struct nameidata *nd, struct qstr *name,
return -ECHILD; return -ECHILD;
nd->seq = seq; nd->seq = seq;
if (dentry->d_flags & DCACHE_OP_REVALIDATE) if (unlikely(dentry->d_flags & DCACHE_OP_REVALIDATE)) {
goto need_revalidate; dentry = do_revalidate(dentry, nd);
done2: if (!dentry)
goto need_lookup;
if (IS_ERR(dentry))
goto fail;
if (!(nd->flags & LOOKUP_RCU))
goto done;
}
path->mnt = mnt; path->mnt = mnt;
path->dentry = dentry; path->dentry = dentry;
if (likely(__follow_mount_rcu(nd, path, inode, false))) if (likely(__follow_mount_rcu(nd, path, inode, false)))
...@@ -1274,8 +1280,13 @@ static int do_lookup(struct nameidata *nd, struct qstr *name, ...@@ -1274,8 +1280,13 @@ static int do_lookup(struct nameidata *nd, struct qstr *name,
if (!dentry) if (!dentry)
goto need_lookup; goto need_lookup;
found: found:
if (dentry->d_flags & DCACHE_OP_REVALIDATE) if (unlikely(dentry->d_flags & DCACHE_OP_REVALIDATE)) {
goto need_revalidate; dentry = do_revalidate(dentry, nd);
if (!dentry)
goto need_lookup;
if (IS_ERR(dentry))
goto fail;
}
done: done:
path->mnt = mnt; path->mnt = mnt;
path->dentry = dentry; path->dentry = dentry;
...@@ -1317,16 +1328,6 @@ static int do_lookup(struct nameidata *nd, struct qstr *name, ...@@ -1317,16 +1328,6 @@ static int do_lookup(struct nameidata *nd, struct qstr *name,
mutex_unlock(&dir->i_mutex); mutex_unlock(&dir->i_mutex);
goto found; goto found;
need_revalidate:
dentry = do_revalidate(dentry, nd);
if (!dentry)
goto need_lookup;
if (IS_ERR(dentry))
goto fail;
if (nd->flags & LOOKUP_RCU)
goto done2;
goto done;
fail: fail:
return PTR_ERR(dentry); return PTR_ERR(dentry);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment