tmpfs: add fast path to tmpfs_access for common case lookup

VEXEC consists of vast majority of all calls and almost all targets have
at least 0111.
This commit is contained in:
Mateusz Guzik 2019-11-30 16:41:47 +00:00
parent 89c4c2e53b
commit 0f4b850e85
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=355227

View File

@ -331,6 +331,12 @@ tmpfs_access(struct vop_access_args *v)
node = VP_TO_TMPFS_NODE(vp);
/*
* Common case path lookup.
*/
if (__predict_true(accmode == VEXEC && (node->tn_mode & 0111) == 0111))
return (0);
switch (vp->v_type) {
case VDIR:
/* FALLTHROUGH */