Changeset 37596 in vbox for trunk/src/VBox/VMM
- Timestamp:
- Jun 22, 2011 7:30:06 PM (14 years ago)
- Location:
- trunk/src/VBox/VMM
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMR3/PDMAsyncCompletionFile.cpp
r37045 r37596 1012 1012 * contain dirty buffers. 1013 1013 */ 1014 RTFILE File = NIL_RTFILE;1015 1016 rc = RTFileOpen(& File, pszUri, RTFILE_O_READ | RTFILE_O_OPEN | RTFILE_O_DENY_NONE);1014 RTFILE hFile = NIL_RTFILE; 1015 1016 rc = RTFileOpen(&hFile, pszUri, RTFILE_O_READ | RTFILE_O_OPEN | RTFILE_O_DENY_NONE); 1017 1017 if (RT_SUCCESS(rc)) 1018 1018 { 1019 1019 uint64_t cbSize; 1020 1020 1021 rc = pdmacFileEpNativeGetSize( File, &cbSize);1021 rc = pdmacFileEpNativeGetSize(hFile, &cbSize); 1022 1022 Assert(RT_FAILURE(rc) || cbSize != 0); 1023 1023 … … 1034 1034 #endif 1035 1035 } 1036 RTFileClose( File);1036 RTFileClose(hFile); 1037 1037 } 1038 1038 } 1039 1039 1040 1040 /* Open with final flags. */ 1041 rc = RTFileOpen(&pEpFile-> File, pszUri, fFileFlags);1041 rc = RTFileOpen(&pEpFile->hFile, pszUri, fFileFlags); 1042 1042 if ((rc == VERR_INVALID_FUNCTION) || (rc == VERR_INVALID_PARAMETER)) 1043 1043 { … … 1064 1064 1065 1065 /* Open again. */ 1066 rc = RTFileOpen(&pEpFile-> File, pszUri, fFileFlags);1066 rc = RTFileOpen(&pEpFile->hFile, pszUri, fFileFlags); 1067 1067 1068 1068 if (RT_FAILURE(rc)) … … 1077 1077 pEpFile->fFlags = fFileFlags; 1078 1078 1079 rc = pdmacFileEpNativeGetSize(pEpFile-> File, (uint64_t *)&pEpFile->cbFile);1079 rc = pdmacFileEpNativeGetSize(pEpFile->hFile, (uint64_t *)&pEpFile->cbFile); 1080 1080 Assert(RT_FAILURE(rc) || pEpFile->cbFile != 0); 1081 1081 … … 1147 1147 1148 1148 if (RT_FAILURE(rc)) 1149 RTFileClose(pEpFile-> File);1149 RTFileClose(pEpFile->hFile); 1150 1150 } 1151 1151 … … 1207 1207 RTAvlrFileOffsetDestroy(pEpFile->AioMgr.pTreeRangesLocked, pdmacFileEpRangesLockedDestroy, NULL); 1208 1208 1209 RTFileClose(pEpFile-> File);1209 RTFileClose(pEpFile->hFile); 1210 1210 1211 1211 #ifdef VBOX_WITH_STATISTICS … … 1301 1301 1302 1302 ASMAtomicWriteU64(&pEpFile->cbFile, cbSize); 1303 return RTFileSetSize(pEpFile-> File, cbSize);1303 return RTFileSetSize(pEpFile->hFile, cbSize); 1304 1304 } 1305 1305 -
trunk/src/VBox/VMM/VMMR3/PDMAsyncCompletionFileFailsafe.cpp
r36001 r37596 78 78 case PDMACTASKFILETRANSFER_FLUSH: 79 79 { 80 rc = RTFileFlush(pEndpoint-> File);80 rc = RTFileFlush(pEndpoint->hFile); 81 81 break; 82 82 } … … 86 86 if (pCurr->enmTransferType == PDMACTASKFILETRANSFER_READ) 87 87 { 88 rc = RTFileReadAt(pEndpoint-> File, pCurr->Off,88 rc = RTFileReadAt(pEndpoint->hFile, pCurr->Off, 89 89 pCurr->DataSeg.pvSeg, 90 90 pCurr->DataSeg.cbSeg, … … 96 96 { 97 97 ASMAtomicWriteU64(&pEndpoint->cbFile, pCurr->Off + pCurr->DataSeg.cbSeg); 98 RTFileSetSize(pEndpoint-> File, pCurr->Off + pCurr->DataSeg.cbSeg);98 RTFileSetSize(pEndpoint->hFile, pCurr->Off + pCurr->DataSeg.cbSeg); 99 99 } 100 100 101 rc = RTFileWriteAt(pEndpoint-> File, pCurr->Off,101 rc = RTFileWriteAt(pEndpoint->hFile, pCurr->Off, 102 102 pCurr->DataSeg.pvSeg, 103 103 pCurr->DataSeg.cbSeg, -
trunk/src/VBox/VMM/VMMR3/PDMAsyncCompletionFileNormal.cpp
r37045 r37596 205 205 206 206 /* Reopen the file so that the new endpoint can re-associate with the file */ 207 RTFileClose(pEndpointRemove-> File);208 int rc = RTFileOpen(&pEndpointRemove-> File, pEndpointRemove->Core.pszUri, pEndpointRemove->fFlags);207 RTFileClose(pEndpointRemove->hFile); 208 int rc = RTFileOpen(&pEndpointRemove->hFile, pEndpointRemove->Core.pszUri, pEndpointRemove->fFlags); 209 209 AssertRC(rc); 210 210 return false; … … 341 341 while (pCurr) 342 342 { 343 RTFileClose(pCurr-> File);344 rc = RTFileOpen(&pCurr-> File, pCurr->Core.pszUri, pCurr->fFlags);343 RTFileClose(pCurr->hFile); 344 rc = RTFileOpen(&pCurr->hFile, pCurr->Core.pszUri, pCurr->fFlags); 345 345 AssertRC(rc); 346 346 … … 390 390 while (pCurr) 391 391 { 392 rc = RTFileAioCtxAssociateWithFile(pAioMgr->hAioCtx, pCurr-> File);392 rc = RTFileAioCtxAssociateWithFile(pAioMgr->hAioCtx, pCurr->hFile); 393 393 AssertRC(rc); 394 394 … … 790 790 { 791 791 ASMAtomicWriteU64(&pEndpoint->cbFile, pTask->Off + pTask->DataSeg.cbSeg); 792 RTFileSetSize(pEndpoint-> File, pTask->Off + pTask->DataSeg.cbSeg);793 } 794 795 rc = RTFileAioReqPrepareWrite(hReq, pEndpoint-> File,792 RTFileSetSize(pEndpoint->hFile, pTask->Off + pTask->DataSeg.cbSeg); 793 } 794 795 rc = RTFileAioReqPrepareWrite(hReq, pEndpoint->hFile, 796 796 pTask->Off, pTask->DataSeg.pvSeg, 797 797 pTask->DataSeg.cbSeg, pTask); 798 798 } 799 799 else 800 rc = RTFileAioReqPrepareRead(hReq, pEndpoint-> File,800 rc = RTFileAioReqPrepareRead(hReq, pEndpoint->hFile, 801 801 pTask->Off, pTask->DataSeg.pvSeg, 802 802 pTask->DataSeg.cbSeg, pTask); … … 925 925 { 926 926 ASMAtomicWriteU64(&pEndpoint->cbFile, pTask->Off + pTask->DataSeg.cbSeg); 927 RTFileSetSize(pEndpoint-> File, pTask->Off + pTask->DataSeg.cbSeg);928 } 929 930 rc = RTFileAioReqPrepareWrite(hReq, pEndpoint-> File,927 RTFileSetSize(pEndpoint->hFile, pTask->Off + pTask->DataSeg.cbSeg); 928 } 929 930 rc = RTFileAioReqPrepareWrite(hReq, pEndpoint->hFile, 931 931 offStart, pvBuf, cbToTransfer, pTask); 932 932 } 933 933 else 934 rc = RTFileAioReqPrepareRead(hReq, pEndpoint-> File,934 rc = RTFileAioReqPrepareRead(hReq, pEndpoint->hFile, 935 935 offStart, pvBuf, cbToTransfer, pTask); 936 936 AssertRC(rc); … … 1004 1004 LogFlow(("Flush request %#p\n", hReq)); 1005 1005 1006 rc = RTFileAioReqPrepareFlush(hReq, pEndpoint-> File, pCurr);1006 rc = RTFileAioReqPrepareFlush(hReq, pEndpoint->hFile, pCurr); 1007 1007 if (RT_FAILURE(rc)) 1008 1008 { … … 1189 1189 1190 1190 /* Assign the completion point to this file. */ 1191 rc = RTFileAioCtxAssociateWithFile(pAioMgr->hAioCtx, pEndpointNew-> File);1191 rc = RTFileAioCtxAssociateWithFile(pAioMgr->hAioCtx, pEndpointNew->hFile); 1192 1192 fNotifyWaiter = true; 1193 1193 pAioMgr->cEndpoints++; … … 1289 1289 { 1290 1290 /* Reopen the file so that the new endpoint can re-associate with the file */ 1291 RTFileClose(pEndpoint-> File);1292 rc = RTFileOpen(&pEndpoint-> File, pEndpoint->Core.pszUri, pEndpoint->fFlags);1291 RTFileClose(pEndpoint->hFile); 1292 rc = RTFileOpen(&pEndpoint->hFile, pEndpoint->Core.pszUri, pEndpoint->fFlags); 1293 1293 AssertRC(rc); 1294 1294 … … 1472 1472 if (pTask->fPrefetch || pTask->enmTransferType == PDMACTASKFILETRANSFER_READ) 1473 1473 { 1474 rc = RTFileAioReqPrepareRead(hReq, pEndpoint-> File, offStart,1474 rc = RTFileAioReqPrepareRead(hReq, pEndpoint->hFile, offStart, 1475 1475 pbBuf, cbToTransfer, pTask); 1476 1476 } … … 1479 1479 AssertMsg(pTask->enmTransferType == PDMACTASKFILETRANSFER_WRITE, 1480 1480 ("Invalid transfer type\n")); 1481 rc = RTFileAioReqPrepareWrite(hReq, pEndpoint-> File, offStart,1481 rc = RTFileAioReqPrepareWrite(hReq, pEndpoint->hFile, offStart, 1482 1482 pbBuf, cbToTransfer, pTask); 1483 1483 } … … 1507 1507 { 1508 1508 ASMAtomicWriteU64(&pEndpoint->cbFile, pTask->Off + pTask->DataSeg.cbSeg); 1509 RTFileSetSize(pEndpoint-> File, pTask->Off + pTask->DataSeg.cbSeg);1510 } 1511 1512 rc = RTFileAioReqPrepareWrite(hReq, pEndpoint-> File,1509 RTFileSetSize(pEndpoint->hFile, pTask->Off + pTask->DataSeg.cbSeg); 1510 } 1511 1512 rc = RTFileAioReqPrepareWrite(hReq, pEndpoint->hFile, 1513 1513 offStart, pTask->pvBounceBuffer, cbToTransfer, pTask); 1514 1514 AssertRC(rc); -
trunk/src/VBox/VMM/include/PDMAsyncCompletionFileInternal.h
r36799 r37596 327 327 unsigned fFlags; 328 328 /** File handle. */ 329 RTFILE File;329 RTFILE hFile; 330 330 /** 331 331 * Real size of the file. Only updated if
Note:
See TracChangeset
for help on using the changeset viewer.