Mark Johnston 74a68313b5 socket: Add macros to lock socket buffers using socket references
Since commit c67f3b8b78e50c6df7c057d6cf108e4d6b4312d0 the sockbuf
mutexes belong to the containing socket.  Sockbufs contain a pointer to
a mutex, which by default is initialized to the corresponding mutexes in
the socket.  The SOCKBUF_LOCK() etc. macros operate on this pointer.
However, the pointer is clobbered by listen(2) so it's not safe to use
them unless one is sure that the socket is not a listening socket.

This change introduces a new set of macros which lock socket buffers
through the socket.  This is a bit cheaper since it removes the pointer
indirection, and allows one to safely lock socket buffers and then check
for a listening socket.

For MFC, these macros should be reimplemented in terms of the existing
socket buffer layout.

Reviewed by:	tuexen, gallatin, jhb
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D31900
2021-09-10 17:20:39 -04:00
..
2021-09-02 20:58:02 -04:00
2021-09-02 20:58:02 -04:00
2021-09-02 20:58:02 -04:00
2021-08-24 11:24:07 +00:00
2021-09-02 20:58:02 -04:00
2021-09-10 17:07:57 +02:00
2021-09-10 18:15:44 +02:00
2021-09-09 17:02:15 -07:00