git: 9front

Download patch

ref: 3383474c843a884fe547c2ed905f244a65b31589
parent: 3688c264c5c72a6a4b64c045b62ffb096551272f
author: cinap_lenrek <cinap_lenrek@felloff.net>
date: Mon Nov 7 17:08:21 EST 2016

devloopback: simplify loopoput()

remove unneeded waserror() block, loopoput is alled from
loopbackbwrite only so we will always get called with a
*single* block, so the concatblock() is not needed.

--- a/sys/src/9/port/devloopback.c
+++ b/sys/src/9/port/devloopback.c
@@ -549,23 +549,13 @@
 }
 
 static long
-loopoput(Loop *lb, Link *link, Block *volatile bp)
+loopoput(Loop *lb, Link *link, Block *bp)
 {
-	long n;
+	long n = BLEN(bp);
 
-	n = BLEN(bp);
-
-	/* make it a single block with space for the loopback timing header */
-	if(waserror()){
-		freeb(bp);
-		nexterror();
-	}
 	bp = padblock(bp, Tmsize);
-	if(bp->next)
-		bp = concatblock(bp);
 	if(BLEN(bp) < lb->minmtu)
 		bp = adjustblock(bp, lb->minmtu);
-	poperror();
 	ptime(bp->rp, todget(nil));
 
 	link->packets++;
--