Lines Matching defs:pEpFile

318             PPDMASYNCCOMPLETIONENDPOINTFILE pEpFile = (PPDMASYNCCOMPLETIONENDPOINTFILE)pTaskFile->Core.pEndpoint;
322 rc = ASMAtomicXchgS32(&pEpFile->rcReqRead, VINF_SUCCESS);
324 rc = ASMAtomicXchgS32(&pEpFile->rcReqWrite, VINF_SUCCESS);
335 PPDMASYNCCOMPLETIONENDPOINTFILE pEpFile = (PPDMASYNCCOMPLETIONENDPOINTFILE)pTaskFile->Core.pEndpoint;
336 PPDMASYNCCOMPLETIONEPCLASSFILE pEpClassFile = (PPDMASYNCCOMPLETIONEPCLASSFILE)pEpFile->Core.pEpClass;
339 if ( ASMAtomicReadU32(&pEpFile->msDelay) > 0
340 && ASMAtomicReadU32(&pEpFile->cReqsDelay) > 0)
342 uint64_t tsDelay = pEpFile->msDelay;
344 if (pEpFile->msJitter)
345 tsDelay = (RTRandU32() % 100) > 50 ? pEpFile->msDelay + (RTRandU32() % pEpFile->msJitter)
346 : pEpFile->msDelay - (RTRandU32() % pEpFile->msJitter);
347 ASMAtomicDecU32(&pEpFile->cReqsDelay);
356 pHead = ASMAtomicReadPtrT(&pEpFile->pDelayedHead, PPDMASYNCCOMPLETIONTASKFILE);
358 } while (!ASMAtomicCmpXchgPtr(&pEpFile->pDelayedHead, pTaskFile, pHead));
390 PPDMASYNCCOMPLETIONENDPOINTFILE pEpFile = (PPDMASYNCCOMPLETIONENDPOINTFILE)pEndpoint;
398 PPDMACTASKFILE pIoTask = pdmacFileTaskAlloc(pEpFile);
401 pIoTask->pEndpoint = pEpFile;
410 pdmacFileEpAddTask(pEpFile, pIoTask);
629 PPDMASYNCCOMPLETIONENDPOINTFILE pEpFile = (PPDMASYNCCOMPLETIONENDPOINTFILE)pEpClassFile->Core.pEndpointsHead;
630 while (pEpFile)
632 if (!RTStrCmp(pArgs[1].u.pszString, RTPathFilename(pEpFile->Core.pszUri)))
634 pEpFile = (PPDMASYNCCOMPLETIONENDPOINTFILE)pEpFile->Core.pNext;
637 if (pEpFile)
643 ASMAtomicXchgS32(&pEpFile->rcReqWrite, rcToInject);
645 ASMAtomicXchgS32(&pEpFile->rcReqRead, rcToInject);
653 if (!pEpFile)
705 PPDMASYNCCOMPLETIONENDPOINTFILE pEpFile = (PPDMASYNCCOMPLETIONENDPOINTFILE)pEpClassFile->Core.pEndpointsHead;
706 while (pEpFile)
708 if (!RTStrCmp(pArgs[1].u.pszString, RTPathFilename(pEpFile->Core.pszUri)))
710 pEpFile = (PPDMASYNCCOMPLETIONENDPOINTFILE)pEpFile->Core.pNext;
713 if (pEpFile)
715 ASMAtomicWriteSize(&pEpFile->enmTypeDelay, enmDelayType);
716 ASMAtomicWriteU32(&pEpFile->msDelay, msDelay);
717 ASMAtomicWriteU32(&pEpFile->msJitter, msJitter);
718 ASMAtomicWriteU32(&pEpFile->cReqsDelay, cReqsDelay);
726 if (!pEpFile)
740 PPDMASYNCCOMPLETIONENDPOINTFILE pEpFile = (PPDMASYNCCOMPLETIONENDPOINTFILE)pEpClassFile->Core.pEndpointsHead;
742 while (pEpFile)
745 if (pEpFile->pDelayedHead != NULL)
747 PPDMASYNCCOMPLETIONTASKFILE pTaskFile = ASMAtomicXchgPtrT(&pEpFile->pDelayedHead, NULL, PPDMASYNCCOMPLETIONTASKFILE);
769 pHead = ASMAtomicReadPtrT(&pEpFile->pDelayedHead, PPDMASYNCCOMPLETIONTASKFILE);
771 } while (!ASMAtomicCmpXchgPtr(&pEpFile->pDelayedHead, pTmp, pHead));
776 pEpFile = (PPDMASYNCCOMPLETIONENDPOINTFILE)pEpFile->Core.pNext;
891 PPDMASYNCCOMPLETIONENDPOINTFILE pEpFile = (PPDMASYNCCOMPLETIONENDPOINTFILE)pEndpoint;
967 rc = RTFileOpen(&pEpFile->hFile, pszUri, fFileFlags);
993 rc = RTFileOpen(&pEpFile->hFile, pszUri, fFileFlags);
1004 pEpFile->fFlags = fFileFlags;
1006 rc = RTFileGetSize(pEpFile->hFile, (uint64_t *)&pEpFile->cbFile);
1012 (void **)&pEpFile->pTasksFreeHead);
1017 pEpFile->pTasksFreeTail = pEpFile->pTasksFreeHead;
1018 pEpFile->cTasksCached = 0;
1019 pEpFile->enmBackendType = enmEpBackend;
1025 pEpFile->fAsyncFlushSupported = true;
1027 pEpFile->fAsyncFlushSupported = false;
1053 pEpFile->AioMgr.pTreeRangesLocked = (PAVLRFOFFTREE)RTMemAllocZ(sizeof(AVLRFOFFTREE));
1054 if (!pEpFile->AioMgr.pTreeRangesLocked)
1058 pEpFile->enmState = PDMASYNCCOMPLETIONENDPOINTFILESTATE_ACTIVE;
1061 rc = pdmacFileAioMgrAddEndpoint(pAioMgr, pEpFile);
1064 RTMemFree(pEpFile->AioMgr.pTreeRangesLocked);
1065 MMR3HeapFree(pEpFile->pTasksFreeHead);
1093 RTFileClose(pEpFile->hFile);
1099 STAMR3RegisterF(pEpClassFile->Core.pVM, &pEpFile->StatRead,
1102 "/PDM/AsyncCompletion/File/%s/Read", RTPathFilename(pEpFile->Core.pszUri));
1104 STAMR3RegisterF(pEpClassFile->Core.pVM, &pEpFile->StatWrite,
1107 "/PDM/AsyncCompletion/File/%s/Write", RTPathFilename(pEpFile->Core.pszUri));
1112 LogRel(("AIOMgr: Endpoint for file '%s' (flags %08x) created successfully\n", pszUri, pEpFile->fFlags));
1126 PPDMASYNCCOMPLETIONENDPOINTFILE pEpFile = (PPDMASYNCCOMPLETIONENDPOINTFILE)pEndpoint;
1130 int rc = pdmacFileAioMgrCloseEndpoint(pEpFile->pAioMgr, pEpFile);
1137 if (pEpFile->pAioMgr->enmMgrType == PDMACEPFILEMGRTYPE_SIMPLE)
1138 pdmacFileAioMgrDestroy(pEpClassFile, pEpFile->pAioMgr);
1141 PPDMACTASKFILE pTask = pEpFile->pTasksFreeHead;
1151 RTAvlrFileOffsetDestroy(pEpFile->AioMgr.pTreeRangesLocked, pdmacFileEpRangesLockedDestroy, NULL);
1153 RTFileClose(pEpFile->hFile);
1157 STAMR3DeregisterF(pEpClassFile->Core.pVM->pUVM, "/PDM/AsyncCompletion/File/%s/*", RTPathFilename(pEpFile->Core.pszUri));
1168 PPDMASYNCCOMPLETIONENDPOINTFILE pEpFile = (PPDMASYNCCOMPLETIONENDPOINTFILE)pEndpoint;
1173 if (RT_UNLIKELY((uint64_t)off + cbRead > pEpFile->cbFile))
1176 STAM_PROFILE_ADV_START(&pEpFile->StatRead, Read);
1180 STAM_PROFILE_ADV_STOP(&pEpFile->StatRead, Read);
1190 PPDMASYNCCOMPLETIONENDPOINTFILE pEpFile = (PPDMASYNCCOMPLETIONENDPOINTFILE)pEndpoint;
1192 if (RT_UNLIKELY(pEpFile->fReadonly))
1195 STAM_PROFILE_ADV_START(&pEpFile->StatWrite, Write);
1202 STAM_PROFILE_ADV_STOP(&pEpFile->StatWrite, Write);
1210 PPDMASYNCCOMPLETIONENDPOINTFILE pEpFile = (PPDMASYNCCOMPLETIONENDPOINTFILE)pEndpoint;
1213 if (RT_UNLIKELY(pEpFile->fReadonly))
1218 PPDMACTASKFILE pIoTask = pdmacFileTaskAlloc(pEpFile);
1222 pIoTask->pEndpoint = pEpFile;
1226 pdmacFileEpAddTask(pEpFile, pIoTask);
1233 PPDMASYNCCOMPLETIONENDPOINTFILE pEpFile = (PPDMASYNCCOMPLETIONENDPOINTFILE)pEndpoint;
1235 *pcbSize = ASMAtomicReadU64(&pEpFile->cbFile);
1243 PPDMASYNCCOMPLETIONENDPOINTFILE pEpFile = (PPDMASYNCCOMPLETIONENDPOINTFILE)pEndpoint;
1245 rc = RTFileSetSize(pEpFile->hFile, cbSize);
1247 ASMAtomicWriteU64(&pEpFile->cbFile, cbSize);