]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
windows-buf-queue-handling-20060809
authorJeffrey Altman <jaltman@secure-endpoints.com>
Thu, 10 Aug 2006 00:48:24 +0000 (00:48 +0000)
committerJeffrey Altman <jaltman@secure-endpoints.com>
Thu, 10 Aug 2006 00:48:24 +0000 (00:48 +0000)
don't free objects that are still on the queue.  remove them first.

src/WINNT/afsd/cm_dcache.c

index 426742fb8571f4db8882ddfbc5ebffa2a4352b98..5e003196654d207456dae1acce81e49a436fab4c 100644 (file)
@@ -1058,8 +1058,9 @@ long cm_SetupFetchBIOD(cm_scache_t *scp, osi_hyper_t *offsetp,
         /* add the buffer to the list */
         qdp = osi_QDAlloc();
         osi_SetQData(qdp, tbp);
-        osi_QAdd((osi_queue_t **)&heldBufListp, &qdp->q);
-        if (!heldBufListEndp) heldBufListEndp = qdp;
+        osi_QAddH((osi_queue_t **)&heldBufListp, 
+                 (osi_queue_t **)&heldBufListEndp, 
+                 &qdp->q);
         /* leave tbp held (from buf_Get) */
 
         if (!reserving) 
@@ -1127,9 +1128,9 @@ long cm_SetupFetchBIOD(cm_scache_t *scp, osi_hyper_t *offsetp,
         /* add the buffer to the list */
         qdp = osi_QDAlloc();
         osi_SetQData(qdp, tbp);
-        osi_QAdd((osi_queue_t **)&biop->bufListp, &qdp->q);
-        if (!biop->bufListEndp) 
-            biop->bufListEndp = qdp;
+        osi_QAddH((osi_queue_t **)&biop->bufListp, 
+                 (osi_queue_t **)&biop->bufListEndp, 
+                 &qdp->q);
         buf_Hold(tbp);
 
         /* from now on, a failure just stops our collection process, but
@@ -1146,6 +1147,9 @@ long cm_SetupFetchBIOD(cm_scache_t *scp, osi_hyper_t *offsetp,
     for (qdp = heldBufListp; qdp; qdp = tqdp) {
         tqdp = (osi_queueData_t *) osi_QNext(&qdp->q);
         tbp = osi_GetQData(qdp);
+       osi_QRemoveHT((osi_queue_t **) &heldBufListp,
+                     (osi_queue_t **) &heldBufListEndp,
+                     &qdp->q);
         osi_QDFree(qdp);
         buf_Release(tbp);
     }
@@ -1198,6 +1202,9 @@ void cm_ReleaseBIOD(cm_bulkIO_t *biop, int isStore)
                 
         /* extract buffer and free queue data */
         bufp = osi_GetQData(qdp);
+       osi_QRemoveHT((osi_queue_t **) &biop->bufListp,
+                     (osi_queue_t **) &biop->bufListEndp,
+                     &qdp->q);
         osi_QDFree(qdp);
 
         /* now, mark I/O as done, unlock the buffer and release it */