Lines Matching refs:pIoStorage
69 PVDIOSTORAGE pIoStorage = (PVDIOSTORAGE)RTAioMgrFileGetUser(hAioMgrFile);
70 pIoStorage->pfnComplete(pvUser, rcReq);
104 PVDIOSTORAGE pIoStorage = (PVDIOSTORAGE)RTMemAllocZ(sizeof(VDIOSTORAGE));
106 if (pIoStorage)
108 pIoStorage->pIoBackend = pIoBackend;
109 pIoStorage->pfnComplete = pfnComplete;
112 pIoStorage->fMemory = true;
113 rc = VDMemDiskCreate(&pIoStorage->u.pMemDisk, 0 /* Growing */);
122 VDMemDiskDestroy(pIoStorage->u.pMemDisk);
128 pIoStorage->fMemory = false;
137 rc = RTFileOpen(&pIoStorage->u.File.hFile, pszName,
142 rc = RTAioMgrFileCreate(pIoBackend->hAioMgr, pIoStorage->u.File.hFile,
143 vdIoBackendFileIoComplete, pIoStorage,
144 &pIoStorage->u.File.hAioMgrFile);
146 RTFileClose(pIoStorage->u.File.hFile);
157 RTMemFree(pIoStorage);
159 *ppIoStorage = pIoStorage;
167 void VDIoBackendStorageDestroy(PVDIOSTORAGE pIoStorage)
169 if (pIoStorage->fMemory)
171 VDMemDiskDestroy(pIoStorage->u.pMemDisk);
172 ASMAtomicDecU32(&pIoStorage->pIoBackend->cRefsIoMem);
176 RTAioMgrFileRelease(pIoStorage->u.File.hAioMgrFile);
177 RTFileClose(pIoStorage->u.File.hFile);
178 ASMAtomicDecU32(&pIoStorage->pIoBackend->cRefsFile);
180 RTMemFree(pIoStorage);
183 int VDIoBackendTransfer(PVDIOSTORAGE pIoStorage, VDIOTXDIR enmTxDir, uint64_t off,
188 if (pIoStorage->fMemory)
192 rc = VDIoBackendMemTransfer(pIoStorage->pIoBackend->pIoMem, pIoStorage->u.pMemDisk,
193 enmTxDir, off, cbTransfer, pSgBuf, pIoStorage->pfnComplete,
201 rc = VDMemDiskRead(pIoStorage->u.pMemDisk, off, cbTransfer, pSgBuf);
204 rc = VDMemDiskWrite(pIoStorage->u.pMemDisk, off, cbTransfer, pSgBuf);
220 rc = RTAioMgrFileRead(pIoStorage->u.File.hAioMgrFile, off, pSgBuf, cbTransfer, pvUser);
223 rc = RTAioMgrFileWrite(pIoStorage->u.File.hAioMgrFile, off, pSgBuf, cbTransfer, pvUser);
226 rc = RTAioMgrFileFlush(pIoStorage->u.File.hAioMgrFile, pvUser);
239 rc = RTFileSgReadAt(pIoStorage->u.File.hFile, off, pSgBuf, cbTransfer, NULL);
242 rc = RTFileSgWriteAt(pIoStorage->u.File.hFile, off, pSgBuf, cbTransfer, NULL);
245 rc = RTFileFlush(pIoStorage->u.File.hFile);
256 int VDIoBackendStorageSetSize(PVDIOSTORAGE pIoStorage, uint64_t cbSize)
260 if (pIoStorage->fMemory)
262 rc = VDMemDiskSetSize(pIoStorage->u.pMemDisk, cbSize);
265 rc = RTFileSetSize(pIoStorage->u.File.hFile, cbSize);
270 int VDIoBackendStorageGetSize(PVDIOSTORAGE pIoStorage, uint64_t *pcbSize)
274 if (pIoStorage->fMemory)
276 rc = VDMemDiskGetSize(pIoStorage->u.pMemDisk, pcbSize);
279 rc = RTFileGetSize(pIoStorage->u.File.hFile, pcbSize);
284 DECLHIDDEN(int) VDIoBackendDumpToFile(PVDIOSTORAGE pIoStorage, const char *pszPath)
288 if (pIoStorage->fMemory)
289 rc = VDMemDiskWriteToFile(pIoStorage->u.pMemDisk, pszPath);