summaryrefslogtreecommitdiffstats
path: root/sys/netipx/spx_usrreq.c
diff options
context:
space:
mode:
authorrwatson <rwatson@FreeBSD.org>2004-06-14 18:16:22 +0000
committerrwatson <rwatson@FreeBSD.org>2004-06-14 18:16:22 +0000
commitf2c0db1521299639d6b16b7d477a777fbd81ada6 (patch)
tree38ab74987dd7d2d27fad4ea4e4772c7d36baf7d4 /sys/netipx/spx_usrreq.c
parent1598e7b4234febacb1b16af62169c90a2e93cc6b (diff)
downloadFreeBSD-src-f2c0db1521299639d6b16b7d477a777fbd81ada6.zip
FreeBSD-src-f2c0db1521299639d6b16b7d477a777fbd81ada6.tar.gz
The socket field so_state is used to hold a variety of socket related
flags relating to several aspects of socket functionality. This change breaks out several bits relating to send and receive operation into a new per-socket buffer field, sb_state, in order to facilitate locking. This is required because, in order to provide more granular locking of sockets, different state fields have different locking properties. The following fields are moved to sb_state: SS_CANTRCVMORE (so_state) SS_CANTSENDMORE (so_state) SS_RCVATMARK (so_state) Rename respectively to: SBS_CANTRCVMORE (so_rcv.sb_state) SBS_CANTSENDMORE (so_snd.sb_state) SBS_RCVATMARK (so_rcv.sb_state) This facilitates locking by isolating fields to be located with other identically locked fields, and permits greater granularity in socket locking by avoiding storing fields with different locking semantics in the same short (avoiding locking conflicts). In the future, we may wish to coallesce sb_state and sb_flags; for the time being I leave them separate and there is no additional memory overhead due to the packing/alignment of shorts in the socket buffer structure.
Diffstat (limited to 'sys/netipx/spx_usrreq.c')
-rw-r--r--sys/netipx/spx_usrreq.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/netipx/spx_usrreq.c b/sys/netipx/spx_usrreq.c
index ea47aba..eb34fb7 100644
--- a/sys/netipx/spx_usrreq.c
+++ b/sys/netipx/spx_usrreq.c
@@ -567,7 +567,7 @@ present:
if (so->so_rcv.sb_cc)
so->so_oobmark = so->so_rcv.sb_cc;
else
- so->so_state |= SS_RCVATMARK;
+ so->so_rcv.sb_state |= SBS_RCVATMARK;
}
q = q->si_prev;
remque(q->si_next);
@@ -597,7 +597,7 @@ present:
MCHTYPE(m, MT_OOBDATA);
spx_newchecks[1]++;
so->so_oobmark = 0;
- so->so_state &= ~SS_RCVATMARK;
+ so->so_rcv.sb_state &= ~SBS_RCVATMARK;
}
if (packetp == 0) {
m->m_data += SPINC;
@@ -1537,7 +1537,7 @@ spx_rcvoob(so, m, flags)
cb = ipxtospxpcb(ipxp);
if ((cb->s_oobflags & SF_IOOB) || so->so_oobmark ||
- (so->so_state & SS_RCVATMARK)) {
+ (so->so_rcv.sb_state & SBS_RCVATMARK)) {
m->m_len = 1;
*mtod(m, caddr_t) = cb->s_iobc;
return (0);
OpenPOWER on IntegriCloud