diff options
author | Vitaliy Makkoveev <mvs@cvs.openbsd.org> | 2022-12-11 21:19:09 +0000 |
---|---|---|
committer | Vitaliy Makkoveev <mvs@cvs.openbsd.org> | 2022-12-11 21:19:09 +0000 |
commit | 61e6bff432802649033fc9deb226e83255763605 (patch) | |
tree | 40b3de142b46eef76a916467a6531cf7454495f6 /sys/kern/uipc_socket2.c | |
parent | b99b167030a0a2fbeab051ba2208138a878c5107 (diff) |
This time, socket's buffer lock requires solock() to be held. As a part of
socket buffers standalone locking work, move socket state bits which
represent its buffers state to per buffer state. Introduce `sb_state' and
turn SS_CANTSENDMORE to SBS_CANTSENDMORE. This bit will be processed on
`so_snd' buffer only.
Move SS_CANTRCVMORE and SS_RCVATMARK bits with separate diff to make
review easier and exclude possible so_rcv/so_snd mistypes.
Also, don't adjust the remaining SS_* bits right now.
ok millert@
Diffstat (limited to 'sys/kern/uipc_socket2.c')
-rw-r--r-- | sys/kern/uipc_socket2.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/sys/kern/uipc_socket2.c b/sys/kern/uipc_socket2.c index d8b39e44c69..1ffce4625a4 100644 --- a/sys/kern/uipc_socket2.c +++ b/sys/kern/uipc_socket2.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uipc_socket2.c,v 1.129 2022/10/03 16:43:52 bluhm Exp $ */ +/* $OpenBSD: uipc_socket2.c,v 1.130 2022/12/11 21:19:08 mvs Exp $ */ /* $NetBSD: uipc_socket2.c,v 1.11 1996/02/04 02:17:55 christos Exp $ */ /* @@ -142,7 +142,8 @@ soisdisconnecting(struct socket *so) { soassertlocked(so); so->so_state &= ~SS_ISCONNECTING; - so->so_state |= (SS_ISDISCONNECTING|SS_CANTRCVMORE|SS_CANTSENDMORE); + so->so_state |= (SS_ISDISCONNECTING|SS_CANTRCVMORE); + so->so_snd.sb_state |= SBS_CANTSENDMORE; wakeup(&so->so_timeo); sowwakeup(so); sorwakeup(so); @@ -153,7 +154,8 @@ soisdisconnected(struct socket *so) { soassertlocked(so); so->so_state &= ~(SS_ISCONNECTING|SS_ISCONNECTED|SS_ISDISCONNECTING); - so->so_state |= (SS_CANTRCVMORE|SS_CANTSENDMORE|SS_ISDISCONNECTED); + so->so_state |= (SS_CANTRCVMORE|SS_ISDISCONNECTED); + so->so_snd.sb_state |= SBS_CANTSENDMORE; wakeup(&so->so_timeo); sowwakeup(so); sorwakeup(so); @@ -334,7 +336,7 @@ void socantsendmore(struct socket *so) { soassertlocked(so); - so->so_state |= SS_CANTSENDMORE; + so->so_snd.sb_state |= SBS_CANTSENDMORE; sowwakeup(so); } |