Lines Matching defs:pDiscardAsync

1103     PVDIBLOCKDISCARDASYNC pDiscardAsync = (PVDIBLOCKDISCARDASYNC)pvUser;
1105 switch (pDiscardAsync->enmState)
1110 uint64_t u64Offset = (uint64_t)pDiscardAsync->idxLastBlock * pImage->cbTotalBlockData + pImage->offStartData;
1112 pDiscardAsync->pvBlock, pImage->cbTotalBlockData, pIoCtx,
1113 &pMetaXfer, vdiDiscardBlockAsyncUpdate, pDiscardAsync);
1119 pDiscardAsync->enmState = VDIBLOCKDISCARDSTATE_WRITE_BLOCK;
1124 uint64_t u64Offset = (uint64_t)pDiscardAsync->ptrBlockDiscard * pImage->cbTotalBlockData + pImage->offStartData;
1126 pDiscardAsync->pvBlock, pImage->cbTotalBlockData, pIoCtx,
1127 vdiDiscardBlockAsyncUpdate, pDiscardAsync);
1129 pDiscardAsync->enmState = VDIBLOCKDISCARDSTATE_UPDATE_METADATA;
1138 pImage->paBlocksRev[pDiscardAsync->idxLastBlock] = VDI_IMAGE_BLOCK_FREE;
1139 pImage->paBlocks[pDiscardAsync->uBlock] = VDI_IMAGE_BLOCK_ZERO;
1141 if (pDiscardAsync->idxLastBlock != pDiscardAsync->ptrBlockDiscard)
1143 pImage->paBlocks[pDiscardAsync->uBlockLast] = pDiscardAsync->ptrBlockDiscard;
1144 pImage->paBlocksRev[pDiscardAsync->ptrBlockDiscard] = pDiscardAsync->uBlockLast;
1146 rc = vdiUpdateBlockInfoAsync(pImage, pDiscardAsync->uBlockLast, pIoCtx, false /* fUpdateHdr */);
1152 setImageBlocksAllocated(&pImage->Header, pDiscardAsync->idxLastBlock);
1153 rc = vdiUpdateBlockInfoAsync(pImage, pDiscardAsync->uBlock, pIoCtx, true /* fUpdateHdr */);
1165 RTMemFree(pDiscardAsync->pvBlock);
1166 RTMemFree(pDiscardAsync);
1170 AssertMsgFailed(("Invalid state %d\n", pDiscardAsync->enmState));
1193 PVDIBLOCKDISCARDASYNC pDiscardAsync = NULL;
1198 pDiscardAsync = (PVDIBLOCKDISCARDASYNC)RTMemAllocZ(sizeof(VDIBLOCKDISCARDASYNC));
1199 if (RT_UNLIKELY(!pDiscardAsync))
1203 pDiscardAsync->uBlock = uBlock;
1204 pDiscardAsync->pvBlock = pvBlock;
1205 pDiscardAsync->ptrBlockDiscard = pImage->paBlocks[uBlock];
1206 pDiscardAsync->idxLastBlock = getImageBlocksAllocated(&pImage->Header) - 1;
1207 pDiscardAsync->uBlockLast = pImage->paBlocksRev[pDiscardAsync->idxLastBlock];
1213 if (pDiscardAsync->idxLastBlock != pDiscardAsync->ptrBlockDiscard)
1216 pDiscardAsync->uBlockLast, pDiscardAsync->idxLastBlock,
1218 pDiscardAsync->enmState = VDIBLOCKDISCARDSTATE_READ_BLOCK;
1222 pDiscardAsync->enmState = VDIBLOCKDISCARDSTATE_UPDATE_METADATA; /* Start immediately to shrink the image. */
1227 rc = vdiDiscardBlockAsyncUpdate(pImage, pIoCtx, pDiscardAsync, VINF_SUCCESS);