Changeset 23975 in vbox
- Timestamp:
- Oct 22, 2009 12:54:52 PM (15 years ago)
- svn:sync-xref-src-repo-rev:
- 53806
- Location:
- trunk/src/VBox/VMM
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/PDMAsyncCompletionFileCache.cpp
r23744 r23975 490 490 pEntry->fFlags &= ~PDMACFILECACHE_ENTRY_IO_IN_PROGRESS; 491 491 492 /* Process waiting segment list. The data in entry might have changed inbetween. */ 493 PPDMACFILETASKSEG pCurr = pEntry->pWaitingHead; 494 495 AssertMsg((pCurr && pEntry->pWaitingTail) || (!pCurr && !pEntry->pWaitingTail), 496 ("The list tail was not updated correctly\n")); 497 pEntry->pWaitingTail = NULL; 498 pEntry->pWaitingHead = NULL; 499 492 500 if (pTask->enmTransferType == PDMACTASKFILETRANSFER_WRITE) 493 501 { 494 502 pEntry->fFlags &= ~PDMACFILECACHE_ENTRY_IS_DIRTY; 495 496 /* Process waiting segment list. The data in entry might have changed inbetween. */497 PPDMACFILETASKSEG pCurr = pEntry->pHead;498 503 499 504 while (pCurr) … … 520 525 AssertMsg(pTask->enmTransferType == PDMACTASKFILETRANSFER_READ, ("Invalid transfer type\n")); 521 526 AssertMsg(!(pEntry->fFlags & PDMACFILECACHE_ENTRY_IS_DIRTY),("Invalid flags set\n")); 522 523 /* Process waiting segment list. */524 PPDMACFILETASKSEG pCurr = pEntry->pHead;525 527 526 528 while (pCurr) … … 546 548 } 547 549 } 548 549 pEntry->pHead = NULL;550 550 551 551 if (pEntry->fFlags & PDMACFILECACHE_ENTRY_IS_DIRTY) … … 844 844 pEntryNew->pList = NULL; 845 845 pEntryNew->cbData = cbData; 846 pEntryNew->pHead = NULL; 846 pEntryNew->pWaitingHead = NULL; 847 pEntryNew->pWaitingTail = NULL; 847 848 pEntryNew->pbData = (uint8_t *)RTMemPageAlloc(cbData); 848 849 … … 854 855 855 856 return pEntryNew; 857 } 858 859 /** 860 * Adds a segment to the waiting list for a cache entry 861 * which is currently in progress. 862 * 863 * @returns nothing. 864 * @param pEntry The cache entry to add the segment to. 865 * @param pSeg The segment to add. 866 */ 867 static void pdmacFileEpCacheEntryAddWaitingSegment(PPDMACFILECACHEENTRY pEntry, PPDMACFILETASKSEG pSeg) 868 { 869 pSeg->pNext = NULL; 870 871 if (pEntry->pWaitingHead) 872 { 873 AssertPtr(pEntry->pWaitingTail); 874 875 pEntry->pWaitingTail->pNext = pSeg; 876 pEntry->pWaitingTail = pSeg; 877 } 878 else 879 { 880 Assert(!pEntry->pWaitingTail); 881 882 pEntry->pWaitingHead = pSeg; 883 pEntry->pWaitingTail = pSeg; 884 } 856 885 } 857 886 … … 971 1000 ADVANCE_SEGMENT_BUFFER(pSeg->cbTransfer); 972 1001 973 pSeg->pNext = pEntry->pHead; 974 pEntry->pHead = pSeg; 1002 pdmacFileEpCacheEntryAddWaitingSegment(pEntry, pSeg); 975 1003 976 1004 off += pSeg->cbTransfer; … … 1051 1079 ADVANCE_SEGMENT_BUFFER(pSeg->cbTransfer); 1052 1080 1053 pSeg->pNext = pEntry->pHead; 1054 pEntry->pHead = pSeg; 1081 pdmacFileEpCacheEntryAddWaitingSegment(pEntry, pSeg); 1055 1082 1056 1083 off += pSeg->cbTransfer; … … 1136 1163 ADVANCE_SEGMENT_BUFFER(pSeg->cbTransfer); 1137 1164 1138 pSeg->pNext = pEntryNew->pHead; 1139 pEntryNew->pHead = pSeg; 1165 pdmacFileEpCacheEntryAddWaitingSegment(pEntryNew, pSeg); 1140 1166 1141 1167 off += pSeg->cbTransfer; … … 1274 1300 ADVANCE_SEGMENT_BUFFER(pSeg->cbTransfer); 1275 1301 1276 pSeg->pNext = pEntry->pHead; 1277 pEntry->pHead = pSeg; 1302 pdmacFileEpCacheEntryAddWaitingSegment(pEntry, pSeg); 1278 1303 1279 1304 off += pSeg->cbTransfer; … … 1335 1360 ADVANCE_SEGMENT_BUFFER(pSeg->cbTransfer); 1336 1361 1337 pSeg->pNext = pEntry->pHead; 1338 pEntry->pHead = pSeg; 1362 pdmacFileEpCacheEntryAddWaitingSegment(pEntry, pSeg); 1339 1363 1340 1364 off += pSeg->cbTransfer; … … 1424 1448 ADVANCE_SEGMENT_BUFFER(pSeg->cbTransfer); 1425 1449 1426 pSeg->pNext = pEntry->pHead; 1427 pEntry->pHead = pSeg; 1450 pdmacFileEpCacheEntryAddWaitingSegment(pEntry, pSeg); 1428 1451 1429 1452 off += pSeg->cbTransfer; -
trunk/src/VBox/VMM/PDMAsyncCompletionFileInternal.h
r23956 r23975 229 229 /** Pointer to the memory containing the data. */ 230 230 uint8_t *pbData; 231 /** List of tasks waiting for this one to finish. */ 232 PPDMACFILETASKSEG pHead; 231 /** Head of list of tasks waiting for this one to finish. */ 232 PPDMACFILETASKSEG pWaitingHead; 233 /** Tail of list of tasks waiting for this one to finish. */ 234 PPDMACFILETASKSEG pWaitingTail; 233 235 } PDMACFILECACHEENTRY, *PPDMACFILECACHEENTRY; 234 236 /** I/O is still in progress for this entry. This entry is not evictable. */
Note:
See TracChangeset
for help on using the changeset viewer.