git: be8ee77e9edc - main - sctp: Add macros to assert on inp info lock state
Mark Johnston
markj at FreeBSD.org
Wed Sep 1 14:07:17 UTC 2021
The branch main has been updated by markj:
URL: https://cgit.FreeBSD.org/src/commit/?id=be8ee77e9edcb0bc8f94cb8695fc7fb49cc0a282
commit be8ee77e9edcb0bc8f94cb8695fc7fb49cc0a282
Author: Mark Johnston <markj at FreeBSD.org>
AuthorDate: 2021-09-01 14:06:02 +0000
Commit: Mark Johnston <markj at FreeBSD.org>
CommitDate: 2021-09-01 14:06:18 +0000
sctp: Add macros to assert on inp info lock state
Reviewed by: tuexen
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D31756
---
sys/netinet/sctp_lock_bsd.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/sys/netinet/sctp_lock_bsd.h b/sys/netinet/sctp_lock_bsd.h
index 4d78664e3ba5..e7cf8b3221b9 100644
--- a/sys/netinet/sctp_lock_bsd.h
+++ b/sys/netinet/sctp_lock_bsd.h
@@ -107,6 +107,18 @@ __FBSDID("$FreeBSD$");
rw_wunlock(&SCTP_BASE_INFO(ipi_ep_mtx)); \
} while (0)
+#define SCTP_INP_INFO_LOCK_ASSERT() do { \
+ rw_assert(&SCTP_BASE_INFO(ipi_ep_mtx), RA_LOCKED); \
+} while (0)
+
+#define SCTP_INP_INFO_RLOCK_ASSERT() do { \
+ rw_assert(&SCTP_BASE_INFO(ipi_ep_mtx), RA_RLOCKED); \
+} while (0)
+
+#define SCTP_INP_INFO_WLOCK_ASSERT() do { \
+ rw_assert(&SCTP_BASE_INFO(ipi_ep_mtx), RA_WLOCKED); \
+} while (0)
+
#define SCTP_MCORE_QLOCK_INIT(cpstr) do { \
mtx_init(&(cpstr)->que_mtx, "sctp-mcore_queue","queue_lock", \
MTX_DEF | MTX_DUPOK); \
More information about the dev-commits-src-main
mailing list