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
This commit is contained in:
Mark Johnston 2021-09-01 10:06:02 -04:00
parent 92bb74fd4f
commit be8ee77e9e

View file

@ -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); \