VirtualBox

Changeset 51073 in vbox


Ignore:
Timestamp:
Apr 15, 2014 10:19:33 AM (11 years ago)
Author:
vboxsync
Message:

VD: Fixes for filter support

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Storage/VD.cpp

    r50991 r51073  
    206206    /** Pointer to the filter backend interface. */
    207207    PCVDFILTERBACKEND  pBackend;
     208    /** Pointer to list of VD interfaces, per-filter. */
     209    PVDINTERFACE        pVDIfsFilter;
     210    /** I/O related things. */
     211    VDIO                VDIo;
    208212} VDFILTER;
    209213/** Pointer to a VD filter instance. */
     
    992996    {
    993997        PVDFILTER pFilterCurr = pDisk->pFilterHead;
     998
     999        /* Reset buffer before starting. */
     1000        RTSgBufReset(&pIoCtx->Req.Io.SgBuf);
    9941001
    9951002        do
     
    48424849    size_t cbCreated = 0;
    48434850
     4851    /** @todo: It is possible that this gets called from a filter plugin
     4852     * outside of the disk lock. Refine assertion or remove completely. */
     4853#if 0
    48444854    /** @todo: Enable check for sync I/O later. */
    48454855    if (!(pIoCtx->fFlags & VDIOCTX_FLAGS_SYNC))
    48464856        VD_IS_LOCKED(pDisk);
     4857#endif
    48474858
    48484859    cbCreated = RTSgBufSegArrayCreate(&pIoCtx->Req.Io.SgBuf, paSeg, pcSeg, cbData);
     
    61746185        }
    61756186
    6176         rc = pFilter->pBackend->pfnCreate(pDisk->pVDIfsDisk, pVDIfsFilter,
     6187        pFilter->VDIo.pDisk   = pDisk;
     6188        pFilter->pVDIfsFilter = pVDIfsFilter;
     6189
     6190        /* Set up the internal I/O interface. */
     6191        AssertBreakStmt(!VDIfIoIntGet(pVDIfsFilter), rc = VERR_INVALID_PARAMETER);
     6192        vdIfIoIntCallbacksSetup(&pFilter->VDIo.VDIfIoInt);
     6193        rc = VDInterfaceAdd(&pFilter->VDIo.VDIfIoInt.Core, "VD_IOINT", VDINTERFACETYPE_IOINT,
     6194                            &pFilter->VDIo, sizeof(VDINTERFACEIOINT), &pFilter->pVDIfsFilter);
     6195        AssertRC(rc);
     6196
     6197        rc = pFilter->pBackend->pfnCreate(pDisk->pVDIfsDisk, pFilter->pVDIfsFilter,
    61776198                                          &pFilter->pvBackendData);
    61786199
     
    99729993        {
    99739994            if (ASMAtomicCmpXchgBool(&pIoCtx->fComplete, true, false))
     9995            {
     9996                rc2 = vdFilterChainApplyRead(pDisk, pIoCtx->Req.Io.uOffsetXferOrig,
     9997                                             pIoCtx->Req.Io.cbXferOrig, pIoCtx);
     9998                if (RT_FAILURE(rc2))
     9999                    rc = rc2;
    997410000                vdIoCtxFree(pDisk, pIoCtx);
     10001            }
    997510002            else
    997610003                rc = VERR_VD_ASYNC_IO_IN_PROGRESS; /* Let the other handler complete the request. */
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