svn commit: r355255 - head/sys/fs/tmpfs
Mateusz Guzik
mjg at FreeBSD.org
Sun Dec 1 00:34:49 UTC 2019
Author: mjg
Date: Sun Dec 1 00:34:49 2019
New Revision: 355255
URL: https://svnweb.freebsd.org/changeset/base/355255
Log:
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
Modified:
head/sys/fs/tmpfs/tmpfs_vnops.c
Modified: head/sys/fs/tmpfs/tmpfs_vnops.c
==============================================================================
--- head/sys/fs/tmpfs/tmpfs_vnops.c Sun Dec 1 00:22:04 2019 (r355254)
+++ head/sys/fs/tmpfs/tmpfs_vnops.c Sun Dec 1 00:34:49 2019 (r355255)
@@ -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) {
More information about the svn-src-all
mailing list