Changeset 25271 in vbox
- Timestamp:
- Dec 9, 2009 2:55:54 PM (15 years ago)
- svn:sync-xref-src-repo-rev:
- 55808
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/PDMAsyncCompletionFileCache.cpp
r25147 r25271 992 992 993 993 RTSemRWRequestRead(pEndpointCache->SemRWEntries, RT_INDEFINITE_WAIT); 994 pEntry = (PPDMACFILECACHEENTRY)RTAvlrFileOffsetGetBestFit(pEndpointCache->pTree, off, true );994 pEntry = (PPDMACFILECACHEENTRY)RTAvlrFileOffsetGetBestFit(pEndpointCache->pTree, off, true /*fAbove*/); 995 995 if (pEntry) 996 996 pdmacFileEpCacheEntryRef(pEntry); … … 1025 1025 * @param pbBuffer Pointer to the buffer to use. 1026 1026 * NULL if a new buffer should be allocated. 1027 * The buffer needs to have the same size of the entry. 1027 * The buffer needs to have the same size of the entry. 1028 1028 */ 1029 1029 static PPDMACFILECACHEENTRY pdmacFileCacheEntryAlloc(PPDMACFILECACHEGLOBAL pCache, … … 1313 1313 /* Move the entry to Am and fetch it to the cache. */ 1314 1314 pdmacFileCacheEntryAddToList(&pCache->LruFrequentlyUsed, pEntry); 1315 RTCritSectLeave(&pCache->CritSect); 1315 RTCritSectLeave(&pCache->CritSect); 1316 1316 #else 1317 1317 RTCritSectEnter(&pCache->CritSect); … … 1369 1369 pEntryBestFit ? pEntryBestFit->cbData : 0)); 1370 1370 1371 if (pEntryBestFit && ((off + (RTFOFF)cbRead) > pEntryBestFit->Core.Key)) 1371 if ( pEntryBestFit 1372 && off + (RTFOFF)cbRead > pEntryBestFit->Core.Key) 1372 1373 { 1373 1374 cbToRead = pEntryBestFit->Core.Key - off; … … 1377 1378 else 1378 1379 { 1379 if (pEntryBestFit)1380 pdmacFileEpCacheEntryRelease(pEntryBestFit);1381 1382 1380 /* 1383 1381 * Align the size to a 4KB boundary. … … 1386 1384 * (For example reads with a size of 512 bytes. 1387 1385 */ 1388 cbToRead = cbRead; 1386 cbToRead = cbRead; 1389 1387 cbToReadAligned = RT_ALIGN_Z(cbRead, PAGE_SIZE); 1390 1388 … … 1392 1390 cbToReadAligned = RT_MIN(pEndpoint->cbFile - off, cbToReadAligned); 1393 1391 if (pEntryBestFit) 1394 cbToReadAligned = RT_MIN(cbToReadAligned, pEntryBestFit->Core.Key - off); 1392 { 1393 Assert(pEntryBestFit->Core.Key >= off); 1394 cbToReadAligned = RT_MIN(cbToReadAligned, (uint64_t)pEntryBestFit->Core.Key - off); 1395 pdmacFileEpCacheEntryRelease(pEntryBestFit); 1396 } 1395 1397 } 1396 1398 … … 1753 1755 /* Move the entry to Am and fetch it to the cache. */ 1754 1756 pdmacFileCacheEntryAddToList(&pCache->LruFrequentlyUsed, pEntry); 1755 RTCritSectLeave(&pCache->CritSect); 1757 RTCritSectLeave(&pCache->CritSect); 1756 1758 #else 1757 1759 RTCritSectEnter(&pCache->CritSect);
Note:
See TracChangeset
for help on using the changeset viewer.