Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 8 Sep 2021 12:41:47 GMT
From:      Mark Johnston <markj@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: 2d0d1d6e07bc - stable/13 - sctp: Add macros to assert on inp info lock state
Message-ID:  <202109081241.188CflHI065199@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/13 has been updated by markj:

URL: https://cgit.FreeBSD.org/src/commit/?id=2d0d1d6e07bcaf7f25a4d2944170e1ec26c15d78

commit 2d0d1d6e07bcaf7f25a4d2944170e1ec26c15d78
Author:     Mark Johnston <markj@FreeBSD.org>
AuthorDate: 2021-09-01 14:06:02 +0000
Commit:     Mark Johnston <markj@FreeBSD.org>
CommitDate: 2021-09-08 12:40:29 +0000

    sctp: Add macros to assert on inp info lock state
    
    Reviewed by:    tuexen
    Sponsored by:   The FreeBSD Foundation
    
    (cherry picked from commit be8ee77e9edcb0bc8f94cb8695fc7fb49cc0a282)
---
 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);					\



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202109081241.188CflHI065199>