Subject: Re: Last remaining insque / remque uses
To: Tom Spindler <dogcow@babymeat.com>
From: Iain Hibbert <plunky@rya-online.net>
List: tech-net
Date: 10/26/2007 18:33:17
On Tue, 23 Oct 2007, Tom Spindler wrote:

> Given that many of these pieces of sh^W^W^Wlovely source files
> don't actually bother using 'struct queue', and far more often
> monkey around with the affected structures themselves - it might
> be better to just embed local copies of the routines into the
> affected sources. (As the defs are all of five lines of code each,
> I don't think it'd be a horrible burden.)

Having looked at it in a bit more depth, I think that if no testers can be
found for ISO/EON/TPIP then just hardcoding it is the cheapest option and
is least likley to break anything not already broken, eg:

--- /usr/src/sys/netiso/iso_pcb.c	2007-07-20 22:24:52.000000000 +0100
+++ iso_pcb.c	2007-10-26 12:30:30.000000000 +0100
@@ -118,7 +118,13 @@
 		return ENOBUFS;
 	isop->isop_head = head;
 	isop->isop_socket = so;
-	insque(isop, head);
+
+	/* insert at head of pcb list */
+	isop->isop_next = head->isop_next;
+	isop->isop_prev = head;
+	head->isop_next = isop;
+	isop->isop_next->isop_prev = isop;
+
 	if (so)
 		so->so_pcb = isop;
 	return 0;
@@ -545,7 +551,11 @@
 		printf("iso_pcbdetach 4 \n");
 	}
 #endif
-	remque(isop);
+
+	/* extract from pcb list */
+	isop->isop_prev->isop_next = isop->isop_next;
+	isop->isop_next->isop_prev = isop->isop_prev;
+
 #ifdef ARGO_DEBUG
 	if (argo_debug[D_ISO]) {
 		printf("iso_pcbdetach 5 \n");

?

iain