VirtualBox

Changeset 37596 in vbox for trunk/src/VBox/VMM


Ignore:
Timestamp:
Jun 22, 2011 7:30:06 PM (14 years ago)
Author:
vboxsync
Message:

*: RTFILE becomes a pointer, RTFileOpen++ expands it's flags paramter from uint32_t to uint64_t.

Location:
trunk/src/VBox/VMM
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMR3/PDMAsyncCompletionFile.cpp

    r37045 r37596  
    10121012         * contain dirty buffers.
    10131013         */
    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);
    10171017        if (RT_SUCCESS(rc))
    10181018        {
    10191019            uint64_t cbSize;
    10201020
    1021             rc = pdmacFileEpNativeGetSize(File, &cbSize);
     1021            rc = pdmacFileEpNativeGetSize(hFile, &cbSize);
    10221022            Assert(RT_FAILURE(rc) || cbSize != 0);
    10231023
     
    10341034#endif
    10351035            }
    1036             RTFileClose(File);
     1036            RTFileClose(hFile);
    10371037        }
    10381038    }
    10391039
    10401040    /* Open with final flags. */
    1041     rc = RTFileOpen(&pEpFile->File, pszUri, fFileFlags);
     1041    rc = RTFileOpen(&pEpFile->hFile, pszUri, fFileFlags);
    10421042    if ((rc == VERR_INVALID_FUNCTION) || (rc == VERR_INVALID_PARAMETER))
    10431043    {
     
    10641064
    10651065        /* Open again. */
    1066         rc = RTFileOpen(&pEpFile->File, pszUri, fFileFlags);
     1066        rc = RTFileOpen(&pEpFile->hFile, pszUri, fFileFlags);
    10671067
    10681068        if (RT_FAILURE(rc))
     
    10771077        pEpFile->fFlags = fFileFlags;
    10781078
    1079         rc = pdmacFileEpNativeGetSize(pEpFile->File, (uint64_t *)&pEpFile->cbFile);
     1079        rc = pdmacFileEpNativeGetSize(pEpFile->hFile, (uint64_t *)&pEpFile->cbFile);
    10801080        Assert(RT_FAILURE(rc) || pEpFile->cbFile != 0);
    10811081
     
    11471147
    11481148        if (RT_FAILURE(rc))
    1149             RTFileClose(pEpFile->File);
     1149            RTFileClose(pEpFile->hFile);
    11501150    }
    11511151
     
    12071207    RTAvlrFileOffsetDestroy(pEpFile->AioMgr.pTreeRangesLocked, pdmacFileEpRangesLockedDestroy, NULL);
    12081208
    1209     RTFileClose(pEpFile->File);
     1209    RTFileClose(pEpFile->hFile);
    12101210
    12111211#ifdef VBOX_WITH_STATISTICS
     
    13011301
    13021302    ASMAtomicWriteU64(&pEpFile->cbFile, cbSize);
    1303     return RTFileSetSize(pEpFile->File, cbSize);
     1303    return RTFileSetSize(pEpFile->hFile, cbSize);
    13041304}
    13051305
  • trunk/src/VBox/VMM/VMMR3/PDMAsyncCompletionFileFailsafe.cpp

    r36001 r37596  
    7878            case PDMACTASKFILETRANSFER_FLUSH:
    7979            {
    80                 rc = RTFileFlush(pEndpoint->File);
     80                rc = RTFileFlush(pEndpoint->hFile);
    8181                break;
    8282            }
     
    8686                if (pCurr->enmTransferType == PDMACTASKFILETRANSFER_READ)
    8787                {
    88                     rc = RTFileReadAt(pEndpoint->File, pCurr->Off,
     88                    rc = RTFileReadAt(pEndpoint->hFile, pCurr->Off,
    8989                                      pCurr->DataSeg.pvSeg,
    9090                                      pCurr->DataSeg.cbSeg,
     
    9696                    {
    9797                        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);
    9999                    }
    100100
    101                     rc = RTFileWriteAt(pEndpoint->File, pCurr->Off,
     101                    rc = RTFileWriteAt(pEndpoint->hFile, pCurr->Off,
    102102                                       pCurr->DataSeg.pvSeg,
    103103                                       pCurr->DataSeg.cbSeg,
  • trunk/src/VBox/VMM/VMMR3/PDMAsyncCompletionFileNormal.cpp

    r37045 r37596  
    205205
    206206        /* 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);
    209209        AssertRC(rc);
    210210        return false;
     
    341341    while (pCurr)
    342342    {
    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);
    345345        AssertRC(rc);
    346346
     
    390390    while (pCurr)
    391391    {
    392         rc = RTFileAioCtxAssociateWithFile(pAioMgr->hAioCtx, pCurr->File);
     392        rc = RTFileAioCtxAssociateWithFile(pAioMgr->hAioCtx, pCurr->hFile);
    393393        AssertRC(rc);
    394394
     
    790790            {
    791791                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,
    796796                                          pTask->Off, pTask->DataSeg.pvSeg,
    797797                                          pTask->DataSeg.cbSeg, pTask);
    798798        }
    799799        else
    800             rc = RTFileAioReqPrepareRead(hReq, pEndpoint->File,
     800            rc = RTFileAioReqPrepareRead(hReq, pEndpoint->hFile,
    801801                                         pTask->Off, pTask->DataSeg.pvSeg,
    802802                                         pTask->DataSeg.cbSeg, pTask);
     
    925925                {
    926926                    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,
    931931                                              offStart, pvBuf, cbToTransfer, pTask);
    932932            }
    933933            else
    934                 rc = RTFileAioReqPrepareRead(hReq, pEndpoint->File,
     934                rc = RTFileAioReqPrepareRead(hReq, pEndpoint->hFile,
    935935                                             offStart, pvBuf, cbToTransfer, pTask);
    936936            AssertRC(rc);
     
    10041004                    LogFlow(("Flush request %#p\n", hReq));
    10051005
    1006                     rc = RTFileAioReqPrepareFlush(hReq, pEndpoint->File, pCurr);
     1006                    rc = RTFileAioReqPrepareFlush(hReq, pEndpoint->hFile, pCurr);
    10071007                    if (RT_FAILURE(rc))
    10081008                    {
     
    11891189
    11901190            /* Assign the completion point to this file. */
    1191             rc = RTFileAioCtxAssociateWithFile(pAioMgr->hAioCtx, pEndpointNew->File);
     1191            rc = RTFileAioCtxAssociateWithFile(pAioMgr->hAioCtx, pEndpointNew->hFile);
    11921192            fNotifyWaiter = true;
    11931193            pAioMgr->cEndpoints++;
     
    12891289        {
    12901290            /* 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);
    12931293            AssertRC(rc);
    12941294
     
    14721472                if (pTask->fPrefetch || pTask->enmTransferType == PDMACTASKFILETRANSFER_READ)
    14731473                {
    1474                     rc = RTFileAioReqPrepareRead(hReq, pEndpoint->File, offStart,
     1474                    rc = RTFileAioReqPrepareRead(hReq, pEndpoint->hFile, offStart,
    14751475                                                 pbBuf, cbToTransfer, pTask);
    14761476                }
     
    14791479                    AssertMsg(pTask->enmTransferType == PDMACTASKFILETRANSFER_WRITE,
    14801480                                  ("Invalid transfer type\n"));
    1481                     rc = RTFileAioReqPrepareWrite(hReq, pEndpoint->File, offStart,
     1481                    rc = RTFileAioReqPrepareWrite(hReq, pEndpoint->hFile, offStart,
    14821482                                                  pbBuf, cbToTransfer, pTask);
    14831483                }
     
    15071507                {
    15081508                    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,
    15131513                                              offStart, pTask->pvBounceBuffer, cbToTransfer, pTask);
    15141514                AssertRC(rc);
  • trunk/src/VBox/VMM/include/PDMAsyncCompletionFileInternal.h

    r36799 r37596  
    327327    unsigned                               fFlags;
    328328    /** File handle. */
    329     RTFILE                                 File;
     329    RTFILE                                 hFile;
    330330    /**
    331331     * Real size of the file. Only updated if
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette