aboutsummaryrefslogtreecommitdiff
path: root/sys/net/if_var.h
diff options
context:
space:
mode:
Diffstat (limited to 'sys/net/if_var.h')
-rw-r--r--sys/net/if_var.h24
1 files changed, 4 insertions, 20 deletions
diff --git a/sys/net/if_var.h b/sys/net/if_var.h
index b0be4b9421a2..44334e67cc5c 100644
--- a/sys/net/if_var.h
+++ b/sys/net/if_var.h
@@ -569,27 +569,11 @@ struct ifmultiaddr {
extern struct rwlock ifnet_rwlock;
extern struct sx ifnet_sxlock;
-#define IFNET_WLOCK() do { \
- sx_xlock(&ifnet_sxlock); \
- rw_wlock(&ifnet_rwlock); \
-} while (0)
-
-#define IFNET_WUNLOCK() do { \
- rw_wunlock(&ifnet_rwlock); \
- sx_xunlock(&ifnet_sxlock); \
-} while (0)
-
-/*
- * To assert the ifnet lock, you must know not only whether it's for read or
- * write, but also whether it was acquired with sleep support or not.
- */
-#define IFNET_RLOCK_ASSERT() sx_assert(&ifnet_sxlock, SA_SLOCKED)
+#define IFNET_WLOCK() sx_xlock(&ifnet_sxlock)
+#define IFNET_WUNLOCK() sx_xunlock(&ifnet_sxlock)
+#define IFNET_RLOCK_ASSERT() sx_assert(&ifnet_sxlock, SA_SLOCKED)
#define IFNET_RLOCK_NOSLEEP_ASSERT() MPASS(in_epoch(net_epoch_preempt))
-#define IFNET_WLOCK_ASSERT() do { \
- sx_assert(&ifnet_sxlock, SA_XLOCKED); \
- rw_assert(&ifnet_rwlock, RA_WLOCKED); \
-} while (0)
-
+#define IFNET_WLOCK_ASSERT() sx_assert(&ifnet_sxlock, SA_XLOCKED)
#define IFNET_RLOCK() sx_slock(&ifnet_sxlock)
#define IFNET_RLOCK_NOSLEEP() struct epoch_tracker ifnet_rlock_et; epoch_enter_preempt(net_epoch_preempt, &ifnet_rlock_et)
#define IFNET_RUNLOCK() sx_sunlock(&ifnet_sxlock)