Lines Matching refs:pBlkMap

365     PVCIBLKMAP        pBlkMap;
452 PVCIBLKMAP pBlkMap = (PVCIBLKMAP)RTMemAllocZ(sizeof(VCIBLKMAP));
457 if (pBlkMap && pFree)
459 pBlkMap->cBlocks = cBlocks;
460 pBlkMap->cBlocksAllocMeta = 0;
461 pBlkMap->cBlocksAllocData = 0;
462 pBlkMap->cBlocksFree = cBlocks;
470 pBlkMap->pRangesHead = pFree;
471 pBlkMap->pRangesTail = pFree;
474 *ppBlkMap = pBlkMap;
479 if (pBlkMap)
480 RTMemFree(pBlkMap);
495 * @param pBlkMap The block bitmap to destroy.
497 static void vciBlkMapDestroy(PVCIBLKMAP pBlkMap)
499 LogFlowFunc(("pBlkMap=%#p\n", pBlkMap));
501 PVCIBLKRANGEDESC pRangeCur = pBlkMap->pRangesHead;
512 RTMemFree(pBlkMap);
557 PVCIBLKMAP pBlkMap = (PVCIBLKMAP)RTMemAllocZ(sizeof(VCIBLKMAP));
558 if (pBlkMap)
560 pBlkMap->cBlocks = BlkMap.cBlocks;
561 pBlkMap->cBlocksFree = BlkMap.cBlocksFree;
562 pBlkMap->cBlocksAllocMeta = BlkMap.cBlocksAllocMeta;
563 pBlkMap->cBlocksAllocData = BlkMap.cBlocksAllocData;
574 uint64_t cBlocksLeft = VCI_BYTE2BLOCK(pBlkMap->cBlocks / 8);
588 pBlkMap->pRangesHead = pRangeCur;
589 pBlkMap->pRangesTail = pRangeCur;
636 pBlkMap->pRangesTail = pRangeNew;
661 *ppBlkMap = pBlkMap;
666 RTMemFree(pBlkMap);
689 * @param pBlkMap The block bitmap to save.
694 static int vciBlkMapSave(PVCIBLKMAP pBlkMap, PVCICACHE pStorage, uint64_t offBlkMap, uint32_t cBlkMap)
699 LogFlowFunc(("pBlkMap=%#p pStorage=%#p offBlkMap=%llu cBlkMap=%u\n",
700 pBlkMap, pStorage, offBlkMap, cBlkMap));
703 if (VCI_BYTE2BLOCK(pBlkMap->cBlocks / 8) + VCI_BYTE2BLOCK(sizeof(VciBlkMap)) == cBlkMap)
710 BlkMap.cBlocks = RT_H2LE_U32(pBlkMap->cBlocks);
711 BlkMap.cBlocksFree = RT_H2LE_U32(pBlkMap->cBlocksFree);
712 BlkMap.cBlocksAllocMeta = RT_H2LE_U32(pBlkMap->cBlocksAllocMeta);
713 BlkMap.cBlocksAllocData = RT_H2LE_U32(pBlkMap->cBlocksAllocData);
721 PVCIBLKRANGEDESC pCur = pBlkMap->pRangesHead;
777 * @param pBlkMap The block bitmap to search on.
780 static PVCIBLKRANGEDESC vciBlkMapFindByBlock(PVCIBLKMAP pBlkMap, uint64_t offBlockAddr)
782 PVCIBLKRANGEDESC pBlk = pBlkMap->pRangesHead;
795 * @param pBlkMap The block bitmap to allocate the blocks from.
800 static int vciBlkMapAllocate(PVCIBLKMAP pBlkMap, uint32_t cBlocks, uint32_t fFlags,
807 LogFlowFunc(("pBlkMap=%#p cBlocks=%u poffBlockAddr=%#p\n",
808 pBlkMap, cBlocks, poffBlockAddr));
810 pCur = pBlkMap->pRangesHead;
852 pBlkMap->pRangesTail = pFree;
869 pBlkMap->cBlocksAllocMeta += cBlocks;
871 pBlkMap->cBlocksAllocData += cBlocks;
873 pBlkMap->cBlocksFree -= cBlocks;
884 * @param pBlkMap The block bitmap to allocate the blocks from.
889 static int vciBlkMapRealloc(PVCIBLKMAP pBlkMap, uint32_t cBlocksNew, uint64_t offBlockAddrOld,
894 LogFlowFunc(("pBlkMap=%#p cBlocksNew=%u offBlockAddrOld=%llu poffBlockAddr=%#p\n",
895 pBlkMap, cBlocksNew, offBlockAddrOld, poffBlockAddr));
907 * @param pBlkMap The block bitmap.
912 static void vciBlkMapFree(PVCIBLKMAP pBlkMap, uint64_t offBlockAddr, uint32_t cBlocks,
917 LogFlowFunc(("pBlkMap=%#p offBlockAddr=%llu cBlocks=%u\n",
918 pBlkMap, offBlockAddr, cBlocks));
922 pBlk = vciBlkMapFindByBlock(pBlkMap, offBlockAddr);
945 pBlkMap->pRangesTail = pBlkPrev;
963 pBlkMap->pRangesTail = pBlk;
976 pBlkMap->cBlocksAllocMeta -= cBlocks;
978 pBlkMap->cBlocksAllocData -= cBlocks;
980 pBlkMap->cBlocksFree += cBlocks;
1255 rc = vciBlkMapLoad(pCache, pCache->offBlksBitmap, Hdr.cBlkMap, &pCache->pBlkMap);
1323 rc = vciBlkMapCreate(cBlocks, &pCache->pBlkMap, &cBlkMap);
1335 rc = vciBlkMapAllocate(pCache->pBlkMap, VCI_BYTE2BLOCK(sizeof(VciHdr)), VCIBLKMAP_ALLOC_META, &offHdr);
1348 rc = vciBlkMapAllocate(pCache->pBlkMap, cBlkMap, VCIBLKMAP_ALLOC_META, &offBlkMap);
1359 rc = vciBlkMapAllocate(pCache->pBlkMap, VCI_BYTE2BLOCK(sizeof(VciTreeNode)), VCIBLKMAP_ALLOC_META, &offTreeRoot);
1405 rc = vciBlkMapSave(pCache->pBlkMap, pCache, offBlkMap, cBlkMap);