aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKonstantin Belousov <kib@FreeBSD.org>2023-02-13 23:47:44 +0000
committerKonstantin Belousov <kib@FreeBSD.org>2023-02-19 05:16:25 +0000
commite6bc80a3dedce1a45357880963695dc74bdc63cf (patch)
tree22260088f30bf67e4fa286fa48baefb39c1353e6
parentd152426ddf35cf7fd69e95c024f6a00c582ef809 (diff)
downloadsrc-e6bc80a3dedce1a45357880963695dc74bdc63cf.tar.gz
src-e6bc80a3dedce1a45357880963695dc74bdc63cf.zip
tmpfs: remove IFF macro
(cherry picked from commit b918ee2ce4850253ddd884e39dabecd6e96bf474)
-rw-r--r--sys/fs/tmpfs/tmpfs.h1
-rw-r--r--sys/fs/tmpfs/tmpfs_subr.c4
2 files changed, 2 insertions, 3 deletions
diff --git a/sys/fs/tmpfs/tmpfs.h b/sys/fs/tmpfs/tmpfs.h
index 30c80ad70d48..e7928d4bf9dd 100644
--- a/sys/fs/tmpfs/tmpfs.h
+++ b/sys/fs/tmpfs/tmpfs.h
@@ -490,7 +490,6 @@ tmpfs_update(struct vnode *vp)
* Convenience macros to simplify some logical expressions.
*/
#define IMPLIES(a, b) (!(a) || (b))
-#define IFF(a, b) (IMPLIES(a, b) && IMPLIES(b, a))
/*
* Checks that the directory entry pointed by 'de' matches the name 'name'
diff --git a/sys/fs/tmpfs/tmpfs_subr.c b/sys/fs/tmpfs/tmpfs_subr.c
index 351530a56698..bc9e1f08391b 100644
--- a/sys/fs/tmpfs/tmpfs_subr.c
+++ b/sys/fs/tmpfs/tmpfs_subr.c
@@ -547,8 +547,8 @@ tmpfs_alloc_node(struct mount *mp, struct tmpfs_mount *tmp, enum vtype type,
* allocated, this must be the request to do it. */
MPASS(IMPLIES(tmp->tm_root == NULL, parent == NULL && type == VDIR));
- MPASS(IFF(type == VLNK, target != NULL));
- MPASS(IFF(type == VBLK || type == VCHR, rdev != VNOVAL));
+ MPASS((type == VLNK) ^ (target == NULL));
+ MPASS((type == VBLK || type == VCHR) ^ (rdev == VNOVAL));
if (tmp->tm_nodes_inuse >= tmp->tm_nodes_max)
return (ENOSPC);