git: 0a8e5aaa97da - main - socket: Add macros to assert that the caller holds a socket I/O lock
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Mon, 12 Aug 2024 23:05:29 UTC
The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=0a8e5aaa97dad579b5489b11a4729da354c0bd74 commit 0a8e5aaa97dad579b5489b11a4729da354c0bd74 Author: Mark Johnston <markj@FreeBSD.org> AuthorDate: 2024-07-22 23:01:53 +0000 Commit: Mark Johnston <markj@FreeBSD.org> CommitDate: 2024-08-12 22:53:26 +0000 socket: Add macros to assert that the caller holds a socket I/O lock Remove some unused macros while here. No functional change intended. MFC after: 1 week Sponsored by: Klara, Inc. Sponsored by: Stormshield --- sys/sys/socketvar.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sys/sys/socketvar.h b/sys/sys/socketvar.h index 15d770721361..2d050707606d 100644 --- a/sys/sys/socketvar.h +++ b/sys/sys/socketvar.h @@ -310,12 +310,14 @@ soeventmtx(struct socket *so, const sb_which which) soiolock((so), &(so)->so_snd_sx, (flags)) #define SOCK_IO_SEND_UNLOCK(so) \ soiounlock(&(so)->so_snd_sx) -#define SOCK_IO_SEND_OWNED(so) sx_xlocked(&(so)->so_snd_sx) +#define SOCK_IO_SEND_ASSERT_LOCKED(so) \ + sx_assert(&(so)->so_snd_sx, SA_LOCKED) #define SOCK_IO_RECV_LOCK(so, flags) \ soiolock((so), &(so)->so_rcv_sx, (flags)) #define SOCK_IO_RECV_UNLOCK(so) \ soiounlock(&(so)->so_rcv_sx) -#define SOCK_IO_RECV_OWNED(so) sx_xlocked(&(so)->so_rcv_sx) +#define SOCK_IO_RECV_ASSERT_LOCKED(so) \ + sx_assert(&(so)->so_rcv_sx, SA_LOCKED) /* do we have to send all at once on a socket? */ #define sosendallatonce(so) \