Changeset 64832 in vbox for trunk/src/VBox
- Timestamp:
- Dec 12, 2016 11:53:14 AM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Storage/QED.cpp
r64766 r64832 207 207 uint32_t cL2Shift; 208 208 209 /** Pointer to the L2 table we are currently allocating 210 * (can be only one at a time). */ 211 PQEDL2CACHEENTRY pL2TblAlloc; 212 209 213 /** Memory occupied by the L2 table cache. */ 210 214 size_t cbL2Cache; … … 418 422 static PQEDL2CACHEENTRY qedL2TblCacheRetain(PQEDIMAGE pImage, uint64_t offL2Tbl) 419 423 { 424 if ( pImage->pL2TblAlloc 425 && pImage->pL2TblAlloc->offL2Tbl == offL2Tbl) 426 { 427 pImage->pL2TblAlloc->cRefs++; 428 return pImage->pL2TblAlloc; 429 } 430 420 431 PQEDL2CACHEENTRY pL2Entry; 421 432 RTListForEach(&pImage->ListSearch, pL2Entry, QEDL2CACHEENTRY, NodeSearch) … … 1328 1339 /* Revert the L1 table entry */ 1329 1340 pImage->paL1Table[pClusterAlloc->idxL1] = 0; 1341 pImage->pL2TblAlloc = NULL; 1330 1342 1331 1343 /* Assumption right now is that the L1 table is not modified on storage if the link fails. */ 1332 1344 rc = vdIfIoIntFileSetSize(pImage->pIfIo, pImage->pStorage, pClusterAlloc->cbImageOld); 1333 1345 qedL2TblCacheEntryRelease(pClusterAlloc->pL2Entry); /* Release L2 cache entry. */ 1346 Assert(!pClusterAlloc->pL2Entry->cRefs); 1334 1347 qedL2TblCacheEntryFree(pImage, pClusterAlloc->pL2Entry); /* Free it, it is not in the cache yet. */ 1335 1348 break; … … 1399 1412 uint64_t offData = qedClusterAllocate(pImage, 1); 1400 1413 1414 pImage->pL2TblAlloc = NULL; 1401 1415 qedL2TblCacheEntryInsert(pImage, pClusterAlloc->pL2Entry); 1402 1416 … … 1769 1783 pL2ClusterAlloc->cbToWrite = cbToWrite; 1770 1784 pL2ClusterAlloc->pL2Entry = pL2Entry; 1785 1786 pImage->pL2TblAlloc = pL2Entry; 1787 1788 LogFlowFunc(("Allocating new L2 table at cluster offset %llu\n", offL2Tbl)); 1771 1789 1772 1790 /* … … 1791 1809 else 1792 1810 { 1811 LogFlowFunc(("Fetching L2 table at cluster offset %llu\n", pImage->paL1Table[idxL1])); 1812 1793 1813 rc = qedL2TblCacheFetchAsync(pImage, pIoCtx, pImage->paL1Table[idxL1], 1794 1814 &pL2Entry);
Note:
See TracChangeset
for help on using the changeset viewer.