- Timestamp:
- May 14, 2010 12:03:58 PM (15 years ago)
- Location:
- trunk/src/VBox/VMM
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/PDMAsyncCompletionFileInternal.h
r29323 r29466 669 669 /** Flag whether this is a prefetch request. */ 670 670 bool fPrefetch; 671 /** Already prepared native I/O request. 672 * Used if the request is prepared already but 673 * was not queued because the host has not enough 674 * resources. */ 675 RTFILEAIOREQ hReq; 671 676 /** Completion function to call on completion. */ 672 677 PFNPDMACTASKCOMPLETED pfnCompleted; -
trunk/src/VBox/VMM/PDMAsyncCompletionFileNormal.cpp
r29450 r29466 596 596 if (rc == VERR_FILE_AIO_INSUFFICIENT_RESSOURCES) 597 597 { 598 PPDMACTASKFILE pTasksWaiting; 599 600 pdmacFileAioMgrNormalRequestFree(pAioMgr, pahReqs[i]); 601 602 if (pTask->cbBounceBuffer) 603 RTMemPageFree(pTask->pvBounceBuffer, pTask->cbBounceBuffer); 604 605 pTask->fPrefetch = false; 606 pTask->cbBounceBuffer = 0; 607 608 /* Free the lock and process pending tasks if neccessary */ 609 pTasksWaiting = pdmacFileAioMgrNormalRangeLockFree(pAioMgr, pEndpoint, pTask->pRangeLock); 610 598 pTask->hReq = pahReqs[i]; 611 599 pdmacFileAioMgrEpAddTask(pEndpoint, pTask); 612 if (pTasksWaiting)613 pdmacFileAioMgrEpAddTaskList(pEndpoint, pTasksWaiting);614 600 } 615 601 else … … 627 613 int rc2 = RTFileAioCtxSubmit(pAioMgr->hAioCtx, ahReqsResubmit, cReqsResubmit); 628 614 AssertRC(rc2); 615 pEndpoint->AioMgr.cRequestsActive += cReqsResubmit; 616 pAioMgr->cRequestsActive += cReqsResubmit; 629 617 cReqsResubmit = 0; 630 618 } … … 636 624 int rc2 = RTFileAioCtxSubmit(pAioMgr->hAioCtx, ahReqsResubmit, cReqsResubmit); 637 625 AssertRC(rc2); 626 pEndpoint->AioMgr.cRequestsActive += cReqsResubmit; 627 pAioMgr->cRequestsActive += cReqsResubmit; 638 628 cReqsResubmit = 0; 639 629 } … … 1064 1054 RTFILEAIOREQ hReq = NIL_RTFILEAIOREQ; 1065 1055 1066 if (pEndpoint->enmBackendType == PDMACFILEEPBACKEND_BUFFERED) 1067 rc = pdmacFileAioMgrNormalTaskPrepareBuffered(pAioMgr, pEndpoint, pCurr, &hReq); 1068 else if (pEndpoint->enmBackendType == PDMACFILEEPBACKEND_NON_BUFFERED) 1069 rc = pdmacFileAioMgrNormalTaskPrepareNonBuffered(pAioMgr, pEndpoint, pCurr, &hReq); 1056 if (pCurr->hReq == NIL_RTFILEAIOREQ) 1057 { 1058 if (pEndpoint->enmBackendType == PDMACFILEEPBACKEND_BUFFERED) 1059 rc = pdmacFileAioMgrNormalTaskPrepareBuffered(pAioMgr, pEndpoint, pCurr, &hReq); 1060 else if (pEndpoint->enmBackendType == PDMACFILEEPBACKEND_NON_BUFFERED) 1061 rc = pdmacFileAioMgrNormalTaskPrepareNonBuffered(pAioMgr, pEndpoint, pCurr, &hReq); 1062 else 1063 AssertMsgFailed(("Invalid backend type %d\n", pEndpoint->enmBackendType)); 1064 1065 AssertRC(rc); 1066 } 1070 1067 else 1071 AssertMsgFailed(("Invalid backend type %d\n", pEndpoint->enmBackendType)); 1072 1073 AssertRC(rc); 1068 { 1069 LogFlow(("Task %#p has I/O request %#p already\n", pCurr, pCurr->hReq)); 1070 hReq = pCurr->hReq; 1071 } 1074 1072 1075 1073 LogFlow(("Read/Write request %#p\n", hReq)); … … 1078 1076 { 1079 1077 apReqs[cRequests] = hReq; 1080 pEndpoint->AioMgr.cReqsProcessed++;1081 1078 cRequests++; 1082 1079 } … … 1345 1342 PPDMACTASKFILE pTasksWaiting; 1346 1343 1344 LogFlowFunc(("pAioMgr=%#p hReq=%#p\n", pAioMgr, hReq)); 1345 1347 1346 pEndpoint = pTask->pEndpoint; 1347 1348 pTask->hReq = NIL_RTFILEAIOREQ; 1349 1350 pAioMgr->cRequestsActive--; 1351 pEndpoint->AioMgr.cRequestsActive--; 1352 pEndpoint->AioMgr.cReqsProcessed++; 1348 1353 1349 1354 /* … … 1358 1363 pdmacFileAioMgrNormalRequestFree(pAioMgr, hReq); 1359 1364 1360 pAioMgr->cRequestsActive--;1361 pEndpoint->AioMgr.cRequestsActive--;1362 pEndpoint->AioMgr.cReqsProcessed++;1363 1364 1365 if (pTask->enmTransferType == PDMACTASKFILETRANSFER_FLUSH) 1365 1366 { … … 1435 1436 pEndpoint->pFlushReq = NULL; 1436 1437 pdmacFileAioMgrNormalRequestFree(pAioMgr, hReq); 1437 1438 pAioMgr->cRequestsActive--;1439 pEndpoint->AioMgr.cRequestsActive--;1440 pEndpoint->AioMgr.cReqsProcessed++;1441 1438 1442 1439 /* Call completion callback */ … … 1494 1491 1495 1492 AssertRC(rc); 1496 rc = RTFileAioCtxSubmit(pAioMgr->hAioCtx, &hReq, 1); 1497 AssertRC(rc); 1498 } 1499 else if (pTask->fPrefetch) 1500 { 1493 rc = pdmacFileAioMgrNormalReqsEnqueue(pAioMgr, pEndpoint, &hReq, 1); 1494 AssertMsg(RT_SUCCESS(rc) || (rc == VERR_FILE_AIO_INSUFFICIENT_RESSOURCES), 1495 ("Unexpected return code rc=%Rrc\n", rc)); 1496 } 1497 else if (pTask->fPrefetch) 1498 { 1501 1499 Assert(pTask->enmTransferType == PDMACTASKFILETRANSFER_WRITE); 1502 1500 Assert(pTask->cbBounceBuffer); … … 1521 1519 offStart, pTask->pvBounceBuffer, cbToTransfer, pTask); 1522 1520 AssertRC(rc); 1523 rc = RTFileAioCtxSubmit(pAioMgr->hAioCtx, &hReq, 1); 1524 AssertRC(rc); 1521 rc = pdmacFileAioMgrNormalReqsEnqueue(pAioMgr, pEndpoint, &hReq, 1); 1522 AssertMsg(RT_SUCCESS(rc) || (rc == VERR_FILE_AIO_INSUFFICIENT_RESSOURCES), 1523 ("Unexpected return code rc=%Rrc\n", rc)); 1525 1524 } 1526 1525 else … … 1537 1536 1538 1537 pdmacFileAioMgrNormalRequestFree(pAioMgr, hReq); 1539 1540 pAioMgr->cRequestsActive--;1541 pEndpoint->AioMgr.cRequestsActive--;1542 pEndpoint->AioMgr.cReqsProcessed++;1543 1538 1544 1539 /* Free the lock and process pending tasks if neccessary */
Note:
See TracChangeset
for help on using the changeset viewer.