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-15 00:57:41 +0000
commitb918ee2ce4850253ddd884e39dabecd6e96bf474 (patch)
tree51e93a80efef04053441bc128d547e6b33125909
parent9ff2fbdf2ded59e276fdbf7ef7d18c726386b6fb (diff)
downloadsrc-b918ee2ce4850253ddd884e39dabecd6e96bf474.tar.gz
src-b918ee2ce4850253ddd884e39dabecd6e96bf474.zip
tmpfs: remove IFF macro
Requested by: mjg Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D38576
-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 70ed066ef0f5..eda1c3b12c24 100644
--- a/sys/fs/tmpfs/tmpfs.h
+++ b/sys/fs/tmpfs/tmpfs.h
@@ -516,7 +516,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 cfd4787fb712..351ca825f203 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);