From owner-p4-projects@FreeBSD.ORG Wed Dec 10 12:34:54 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id BB4EC16A4D0; Wed, 10 Dec 2003 12:34:54 -0800 (PST) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7D64516A4CE for ; Wed, 10 Dec 2003 12:34:54 -0800 (PST) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 51E1D43D1D for ; Wed, 10 Dec 2003 12:34:53 -0800 (PST) (envelope-from sam@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.9/8.12.9) with ESMTP id hBAKYrXJ030031 for ; Wed, 10 Dec 2003 12:34:53 -0800 (PST) (envelope-from sam@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.9/8.12.9/Submit) id hBAKYqDO030028 for perforce@freebsd.org; Wed, 10 Dec 2003 12:34:52 -0800 (PST) (envelope-from sam@freebsd.org) Message-Id: <200312102034.hBAKYqDO030028@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to sam@freebsd.org using -f From: Sam Leffler To: Perforce Change Reviews Subject: PERFORCE change 43753 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Date: Wed, 10 Dec 2003 20:34:55 -0000 X-Original-Date: Wed, 10 Dec 2003 12:34:52 -0800 (PST) X-List-Received-Date: Wed, 10 Dec 2003 20:34:55 -0000 http://perforce.freebsd.org/chv.cgi?CH=43753 Change 43753 by sam@sam_ebb on 2003/12/10 12:34:18 strip spl's to indicate this code is properly locked Affected files ... .. //depot/projects/netperf+sockets/sys/kern/uipc_socket.c#5 edit Differences ... ==== //depot/projects/netperf+sockets/sys/kern/uipc_socket.c#5 (text+ko) ==== @@ -531,7 +531,7 @@ struct mbuf **mp; struct mbuf *m; long space, len, resid; - int clen = 0, error, s, dontroute, mlen; + int clen = 0, error, dontroute, mlen; int atomic = sosendallatonce(so) || top; #ifdef ZERO_COPY_SOCKETS int cow_send; @@ -563,20 +563,18 @@ td->td_proc->p_stats->p_ru.ru_msgsnd++; if (control) clen = control->m_len; -#define snderr(errno) { error = (errno); splx(s); goto release; } +#define snderr(errno) { error = (errno); goto release; } SOCKBUF_LOCK(&so->so_snd); error = sblock(&so->so_snd, SBLOCKWAIT(flags)); if (error) goto out; do { - s = splnet(); if (so->so_state & SS_CANTSENDMORE) snderr(EPIPE); if (so->so_error) { error = so->so_error; so->so_error = 0; - splx(s); goto release; } if ((so->so_state & SS_ISCONNECTED) == 0) { @@ -606,12 +604,10 @@ if (so->so_state & SS_NBIO) snderr(EWOULDBLOCK); error = sbwait(&so->so_snd); - splx(s); if (error) goto release; continue; } - splx(s); mp = ⊤ space -= clen; do { @@ -705,13 +701,12 @@ } while (space > 0 && atomic); if (dontroute) so->so_options |= SO_DONTROUTE; - s = splnet(); /* XXX */ /* * XXX all the SS_CANTSENDMORE checks previously * done could be out of date. We could have recieved * a reset packet in an interrupt or maybe we slept * while doing page faults in uiomove() etc. We could - * probably recheck again inside the splnet() protection + * probably recheck again inside the locking protection * here, but there are probably other places that this * also happens. We must rethink this. */ @@ -729,7 +724,6 @@ /* If there is more to send set PRUS_MORETOCOME */ (resid > 0 && space > 0) ? PRUS_MORETOCOME : 0, top, addr, control, td); - splx(s); if (dontroute) so->so_options &= ~SO_DONTROUTE; clen = 0; @@ -778,7 +772,7 @@ int *flagsp; { struct mbuf *m, **mp; - int flags, len, error, s, offset; + int flags, len, error, offset; struct protosw *pr = so->so_proto; struct mbuf *nextrecord; int moff, type = 0; @@ -840,7 +834,6 @@ error = sblock(&so->so_rcv, SBLOCKWAIT(flags)); if (error) goto out; - s = splnet(); restart: m = so->so_rcv.sb_mb; @@ -895,7 +888,6 @@ SBLASTRECORDCHK(&so->so_rcv); SBLASTMBUFCHK(&so->so_rcv); error = sbwait(&so->so_rcv); - splx(s); if (error) goto out; goto restart; @@ -1000,7 +992,6 @@ if (mp == 0) { SBLASTRECORDCHK(&so->so_rcv); SBLASTMBUFCHK(&so->so_rcv); - splx(s); SOCKBUF_UNLOCK(&so->so_rcv); #ifdef ZERO_COPY_SOCKETS if (so_zero_copy_receive) { @@ -1026,7 +1017,6 @@ #endif /* ZERO_COPY_SOCKETS */ error = uiomove(mtod(m, char *) + moff, (int)len, uio); SOCKBUF_LOCK(&so->so_rcv); - s = splnet(); if (error) goto release; } else @@ -1143,7 +1133,6 @@ if (orig_resid == uio->uio_resid && orig_resid && (flags & MSG_EOR) == 0 && (so->so_state & SS_CANTRCVMORE) == 0) { sbunlock(&so->so_rcv); - splx(s); goto restart; } @@ -1151,7 +1140,6 @@ *flagsp |= flags; release: sbunlock(&so->so_rcv); - splx(s); out: SOCKBUF_UNLOCK(&so->so_rcv); return (error);