Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 9 Dec 2003 15:09:35 -0800 (PST)
From:      Sam Leffler <sam@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 43698 for review
Message-ID:  <200312092309.hB9N9Zu6034366@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=43698

Change 43698 by sam@sam_ebb on 2003/12/09 15:08:41

	o remove Giant assertions
	o lock snd sockbuf to satisfy assertions

Affected files ...

.. //depot/projects/netperf+sockets/sys/rpc/rpcclnt.c#2 edit

Differences ...

==== //depot/projects/netperf+sockets/sys/rpc/rpcclnt.c#2 (text+ko) ====

@@ -362,8 +362,6 @@
 		RPC_RETURN(EFAULT);
 	}
 
-	GIANT_REQUIRED;		/* XXX until socket locking done */
-
 	/* create the socket */
 	rpc->rc_so = NULL;
 
@@ -620,8 +618,6 @@
 {
 	struct socket  *so;
 
-	GIANT_REQUIRED;		/* XXX until socket locking done */
-
 	if (rpc->rc_so) {
 		so = rpc->rc_so;
 		rpc->rc_so = NULL;
@@ -671,8 +667,6 @@
 #endif
 	int error, soflags, flags;
 
-	GIANT_REQUIRED;		/* XXX until socket locking done */
-
 	if (rep) {
 		if (rep->r_flags & R_SOFTTERM) {
 			m_freem(top);
@@ -756,8 +750,6 @@
 #endif
 	int error, sotype, rcvflg;
 
-	GIANT_REQUIRED;		/* XXX until socket locking done */
-
 	/*
 	 * Set up arguments for soreceive()
 	 */
@@ -1430,6 +1422,7 @@
 		 * Set r_rtt to -1 in case we fail to send it now.
 		 */
 		rep->r_rtt = -1;
+		SOCKBUF_LOCK(&so->so_snd);
 		if (sbspace(&so->so_snd) >= rep->r_mreq->m_pkthdr.len &&
 		    ((rpc->rc_flag & RPCCLNT_DUMBTIMR) ||
 		     (rep->r_flags & R_SENT) ||
@@ -1464,6 +1457,7 @@
 				rep->r_rtt = 0;
 			}
 		}
+		SOCKBUF_UNLOCK(&so->so_snd);
 	}
 	splx(s);
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200312092309.hB9N9Zu6034366>