diff options
author | rwatson <rwatson@FreeBSD.org> | 2004-06-01 02:42:56 +0000 |
---|---|---|
committer | rwatson <rwatson@FreeBSD.org> | 2004-06-01 02:42:56 +0000 |
commit | bddadcf71a191234c652f1a57c52259d99eac58d (patch) | |
tree | b3cf202f784daea532f82c3a671eb807b9874cb0 /sys/kern | |
parent | 7a915f30a709eb7c2e2d7f4f5f9ce5ad30818fa8 (diff) | |
download | FreeBSD-src-bddadcf71a191234c652f1a57c52259d99eac58d.zip FreeBSD-src-bddadcf71a191234c652f1a57c52259d99eac58d.tar.gz |
The SS_COMP and SS_INCOMP flags in the so_state field indicate whether
the socket is on an accept queue of a listen socket. This change
renames the flags to SQ_COMP and SQ_INCOMP, and moves them to a new
state field on the socket, so_qstate, as the locking for these flags
is substantially different for the locking on the remainder of the
flags in so_state.
Diffstat (limited to 'sys/kern')
-rw-r--r-- | sys/kern/uipc_sockbuf.c | 10 | ||||
-rw-r--r-- | sys/kern/uipc_socket.c | 8 | ||||
-rw-r--r-- | sys/kern/uipc_socket2.c | 10 | ||||
-rw-r--r-- | sys/kern/uipc_syscalls.c | 2 |
4 files changed, 15 insertions, 15 deletions
diff --git a/sys/kern/uipc_sockbuf.c b/sys/kern/uipc_sockbuf.c index a404d69..36a90ed 100644 --- a/sys/kern/uipc_sockbuf.c +++ b/sys/kern/uipc_sockbuf.c @@ -117,7 +117,7 @@ soisconnected(so) so->so_state &= ~(SS_ISCONNECTING|SS_ISDISCONNECTING|SS_ISCONFIRMING); so->so_state |= SS_ISCONNECTED; - if (head && (so->so_state & SS_INCOMP)) { + if (head && (so->so_qstate & SQ_INCOMP)) { if ((so->so_options & SO_ACCEPTFILTER) != 0) { so->so_upcall = head->so_accf->so_accept_filter->accf_callback; so->so_upcallarg = head->so_accf->so_accept_filter_arg; @@ -128,10 +128,10 @@ soisconnected(so) } TAILQ_REMOVE(&head->so_incomp, so, so_list); head->so_incqlen--; - so->so_state &= ~SS_INCOMP; + so->so_qstate &= ~SQ_INCOMP; TAILQ_INSERT_TAIL(&head->so_comp, so, so_list); head->so_qlen++; - so->so_state |= SS_COMP; + so->so_qstate |= SQ_COMP; sorwakeup(head); wakeup_one(&head->so_timeo); } else { @@ -209,7 +209,7 @@ sonewconn(head, connstatus) if (connstatus) { TAILQ_INSERT_TAIL(&head->so_comp, so, so_list); - so->so_state |= SS_COMP; + so->so_qstate |= SQ_COMP; head->so_qlen++; } else { if (head->so_incqlen > head->so_qlimit) { @@ -218,7 +218,7 @@ sonewconn(head, connstatus) (void) soabort(sp); } TAILQ_INSERT_TAIL(&head->so_incomp, so, so_list); - so->so_state |= SS_INCOMP; + so->so_qstate |= SQ_INCOMP; head->so_incqlen++; } if (connstatus) { diff --git a/sys/kern/uipc_socket.c b/sys/kern/uipc_socket.c index ece519b..706167e 100644 --- a/sys/kern/uipc_socket.c +++ b/sys/kern/uipc_socket.c @@ -288,10 +288,10 @@ sofree(so) return; if (so->so_head != NULL) { head = so->so_head; - if (so->so_state & SS_INCOMP) { + if (so->so_qstate & SQ_INCOMP) { TAILQ_REMOVE(&head->so_incomp, so, so_list); head->so_incqlen--; - } else if (so->so_state & SS_COMP) { + } else if (so->so_qstate & SQ_COMP) { /* * We must not decommission a socket that's * on the accept(2) queue. If we do, then @@ -302,7 +302,7 @@ sofree(so) } else { panic("sofree: not queued"); } - so->so_state &= ~SS_INCOMP; + so->so_qstate &= ~SQ_INCOMP; so->so_head = NULL; } so->so_snd.sb_flags |= SB_NOINTR; @@ -346,7 +346,7 @@ soclose(so) /* Dequeue from so_comp since sofree() won't do it */ TAILQ_REMOVE(&so->so_comp, sp, so_list); so->so_qlen--; - sp->so_state &= ~SS_COMP; + sp->so_qstate &= ~SQ_COMP; sp->so_head = NULL; (void) soabort(sp); } diff --git a/sys/kern/uipc_socket2.c b/sys/kern/uipc_socket2.c index a404d69..36a90ed 100644 --- a/sys/kern/uipc_socket2.c +++ b/sys/kern/uipc_socket2.c @@ -117,7 +117,7 @@ soisconnected(so) so->so_state &= ~(SS_ISCONNECTING|SS_ISDISCONNECTING|SS_ISCONFIRMING); so->so_state |= SS_ISCONNECTED; - if (head && (so->so_state & SS_INCOMP)) { + if (head && (so->so_qstate & SQ_INCOMP)) { if ((so->so_options & SO_ACCEPTFILTER) != 0) { so->so_upcall = head->so_accf->so_accept_filter->accf_callback; so->so_upcallarg = head->so_accf->so_accept_filter_arg; @@ -128,10 +128,10 @@ soisconnected(so) } TAILQ_REMOVE(&head->so_incomp, so, so_list); head->so_incqlen--; - so->so_state &= ~SS_INCOMP; + so->so_qstate &= ~SQ_INCOMP; TAILQ_INSERT_TAIL(&head->so_comp, so, so_list); head->so_qlen++; - so->so_state |= SS_COMP; + so->so_qstate |= SQ_COMP; sorwakeup(head); wakeup_one(&head->so_timeo); } else { @@ -209,7 +209,7 @@ sonewconn(head, connstatus) if (connstatus) { TAILQ_INSERT_TAIL(&head->so_comp, so, so_list); - so->so_state |= SS_COMP; + so->so_qstate |= SQ_COMP; head->so_qlen++; } else { if (head->so_incqlen > head->so_qlimit) { @@ -218,7 +218,7 @@ sonewconn(head, connstatus) (void) soabort(sp); } TAILQ_INSERT_TAIL(&head->so_incomp, so, so_list); - so->so_state |= SS_INCOMP; + so->so_qstate |= SQ_INCOMP; head->so_incqlen++; } if (connstatus) { diff --git a/sys/kern/uipc_syscalls.c b/sys/kern/uipc_syscalls.c index 978c30e..cc8c6ff 100644 --- a/sys/kern/uipc_syscalls.c +++ b/sys/kern/uipc_syscalls.c @@ -336,7 +336,7 @@ accept1(td, uap, compat) /* connection has been removed from the listen queue */ KNOTE(&head->so_rcv.sb_sel.si_note, 0); - so->so_state &= ~SS_COMP; + so->so_qstate &= ~SQ_COMP; so->so_head = NULL; pgid = fgetown(&head->so_sigio); if (pgid != 0) |