From ba08feecbf3f735005336f6b0224e59472a61e52 Mon Sep 17 00:00:00 2001 From: Mateusz Guzik Date: Sun, 1 Dec 2019 00:34:49 +0000 Subject: [PATCH] tmpfs: use proper macros for permission values in tmpfs_access While here group them in one var to prevent overy long lines. Perhaps a general macro of the same sort should be introduced. Requested by: kib --- sys/fs/tmpfs/tmpfs_vnops.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/fs/tmpfs/tmpfs_vnops.c b/sys/fs/tmpfs/tmpfs_vnops.c index 3ee90251f2fc..b1dbdf02bab2 100644 --- a/sys/fs/tmpfs/tmpfs_vnops.c +++ b/sys/fs/tmpfs/tmpfs_vnops.c @@ -323,7 +323,7 @@ tmpfs_access(struct vop_access_args *v) struct vnode *vp = v->a_vp; accmode_t accmode = v->a_accmode; struct ucred *cred = v->a_cred; - + mode_t all_x = S_IXUSR | S_IXGRP | S_IXOTH; int error; struct tmpfs_node *node; @@ -334,7 +334,7 @@ tmpfs_access(struct vop_access_args *v) /* * Common case path lookup. */ - if (__predict_true(accmode == VEXEC && (node->tn_mode & 0111) == 0111)) + if (__predict_true(accmode == VEXEC && (node->tn_mode & all_x) == all_x)) return (0); switch (vp->v_type) {