Changeset 64829 in vbox for trunk/src/VBox
- Timestamp:
- Dec 12, 2016 8:08:31 AM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Storage/QCOW.cpp
r64766 r64829 248 248 uint32_t cL2Shift; 249 249 250 /** Pointer to the L2 table we are currently allocating 251 * (can be only one at a time). */ 252 PQCOWL2CACHEENTRY pL2TblAlloc; 253 250 254 } QCOWIMAGE, *PQCOWIMAGE; 251 255 … … 500 504 static PQCOWL2CACHEENTRY qcowL2TblCacheRetain(PQCOWIMAGE pImage, uint64_t offL2Tbl) 501 505 { 506 if ( pImage->pL2TblAlloc 507 && pImage->pL2TblAlloc->offL2Tbl == offL2Tbl) 508 { 509 pImage->pL2TblAlloc->cRefs++; 510 return pImage->pL2TblAlloc; 511 } 512 502 513 PQCOWL2CACHEENTRY pL2Entry; 503 514 RTListForEach(&pImage->ListSearch, pL2Entry, QCOWL2CACHEENTRY, NodeSearch) … … 1322 1333 /* Revert the L1 table entry */ 1323 1334 pImage->paL1Table[pClusterAlloc->idxL1] = 0; 1335 pImage->pL2TblAlloc = NULL; 1324 1336 1325 1337 /* Assumption right now is that the L1 table is not modified on storage if the link fails. */ 1326 1338 rc = vdIfIoIntFileSetSize(pImage->pIfIo, pImage->pStorage, pClusterAlloc->offNextClusterOld); 1327 1339 qcowL2TblCacheEntryRelease(pClusterAlloc->pL2Entry); /* Release L2 cache entry. */ 1340 Assert(!pClusterAlloc->pL2Entry->cRefs); 1328 1341 qcowL2TblCacheEntryFree(pImage, pClusterAlloc->pL2Entry); /* Free it, it is not in the cache yet. */ 1329 1342 break; … … 1394 1407 uint64_t offData = qcowClusterAllocate(pImage, 1); 1395 1408 1409 pImage->pL2TblAlloc = NULL; 1396 1410 qcowL2TblCacheEntryInsert(pImage, pClusterAlloc->pL2Entry); 1397 1411 … … 1763 1777 pL2ClusterAlloc->cbToWrite = cbToWrite; 1764 1778 pL2ClusterAlloc->pL2Entry = pL2Entry; 1779 1780 pImage->pL2TblAlloc = pL2Entry; 1781 1782 LogFlowFunc(("Allocating new L2 table at cluster offset %llu\n", offL2Tbl)); 1765 1783 1766 1784 /* … … 1785 1803 else 1786 1804 { 1805 LogFlowFunc(("Fetching L2 table at cluster offset %llu\n", pImage->paL1Table[idxL1])); 1806 1787 1807 rc = qcowL2TblCacheFetch(pImage, pIoCtx, pImage->paL1Table[idxL1], 1788 1808 &pL2Entry);
Note:
See TracChangeset
for help on using the changeset viewer.