#define QInit(q) ((q)->prev = (q)->next = (q))
#define QAdd(q,e) ((e)->next = (q)->next, (e)->prev = (q), \
(q)->next->prev = (e), (q)->next = (e))
-#define QRemove(e) ((e)->next->prev = (e)->prev, (e)->prev->next = (e)->next)
+#define QRemove(e) ((e)->next->prev = (e)->prev, (e)->prev->next = (e)->next, (e)->prev = NULL, (e)->next = NULL)
#define QNext(e) ((e)->next)
#define QPrev(e) ((e)->prev)
#define QEmpty(q) ((q)->prev == (q))
debugvc = avc;
if (avc->callsort.prev) {
QRemove(&(avc->callsort));
- avc->callsort.prev = avc->callsort.next = NULL;
} else; /* must have got dequeued in a race */
return;
/* What about locking xvcache or vrefcount++ or
* write locking tvc? */
QRemove(tq);
- tq->prev = tq->next = NULL;
tvc->states &= ~(CStatd | CMValid | CUnique);
if (!(tvc->states & CVInit) &&
(tvc->fid.Fid.Vnode & 1 ||
* What about locking xvcache or vrefcount++ or write locking tvc?
*/
QRemove(tq);
- tq->prev = tq->next = NULL;
tvc->states &= ~(CStatd | CMValid | CUnique);
if (!(tvc->states & CVInit) &&
(tvc->fid.Fid.Vnode & 1 || (vType(tvc) == VDIR)))
tvc->callback = 0;
tvc->dchint = NULL; /* invalidate hints */
tvc->states &= ~(CStatd);
- tvc->callsort.prev = tvc->callsort.next = NULL;
+ if (QPrev(&(tvc->callsort)))
+ QRemove(&(tvc->callsort));
if (!(tvc->states & CVInit) &&
((tvc->fid.Fid.Vnode & 1) || (vType(tvc) == VDIR)))
osi_dnlc_purgedp(tvc);
avc->states |= CVFlushed;
/* pull the entry out of the lruq and put it on the free list */
QRemove(&avc->vlruq);
- avc->vlruq.prev = avc->vlruq.next = (struct afs_q *)0;
/* keep track of # of files that we bulk stat'd, but never used
* before they got recycled.