VirtualBox

Changeset 44252 in vbox for trunk/src/VBox/Storage/DMG.cpp


Ignore:
Timestamp:
Jan 8, 2013 1:23:54 PM (12 years ago)
Author:
vboxsync
Message:

Storage/Backends: async/sync I/O unification, remove separate entries for sync and async I/O callbacks, remove unused code

File:
1 edited

Legend:

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

    r44233 r44252  
    16601660
    16611661/** @copydoc VBOXHDDBACKEND::pfnRead */
    1662 static int dmgRead(void *pBackendData, uint64_t uOffset, void *pvBuf,
    1663                    size_t cbToRead, size_t *pcbActuallyRead)
    1664 {
    1665     LogFlowFunc(("pBackendData=%#p uOffset=%llu pvBuf=%#p cbToRead=%zu pcbActuallyRead=%#p\n", pBackendData, uOffset, pvBuf, cbToRead, pcbActuallyRead));
     1662static int dmgRead(void *pBackendData, uint64_t uOffset,  size_t cbToRead,
     1663                   PVDIOCTX pIoCtx, size_t *pcbActuallyRead)
     1664{
     1665    LogFlowFunc(("pBackendData=%#p uOffset=%llu pIoCtx=%#p cbToRead=%zu pcbActuallyRead=%#p\n",
     1666                 pBackendData, uOffset, pIoCtx, cbToRead, pcbActuallyRead));
    16661667    PDMGIMAGE pThis = (PDMGIMAGE)pBackendData;
    16671668    PDMGEXTENT pExtent = NULL;
     
    16921693            case DMGEXTENTTYPE_RAW:
    16931694            {
    1694                 rc = vdIfIoIntFileReadSync(pThis->pIfIo, pThis->pStorage,
     1695                rc = vdIfIoIntFileReadUser(pThis->pIfIo, pThis->pStorage,
    16951696                                           pExtent->offFileStart + DMG_BLOCK2BYTE(uExtentRel),
    1696                                            pvBuf, cbToRead);
     1697                                           pIoCtx, cbToRead);
    16971698                break;
    16981699            }
    16991700            case DMGEXTENTTYPE_ZERO:
    17001701            {
    1701                 memset(pvBuf, 0, cbToRead);
     1702                vdIfIoIntIoCtxSet(pThis->pIfIo, pIoCtx, 0, cbToRead);
    17021703                break;
    17031704            }
     
    17291730
    17301731                if (RT_SUCCESS(rc))
    1731                     memcpy(pvBuf, (uint8_t *)pThis->pvDecompExtent + DMG_BLOCK2BYTE(uExtentRel), cbToRead);
     1732                    vdIfIoIntIoCtxCopyTo(pThis->pIfIo, pIoCtx,
     1733                                         (uint8_t *)pThis->pvDecompExtent + DMG_BLOCK2BYTE(uExtentRel),
     1734                                         cbToRead);
    17321735                break;
    17331736            }
     
    17481751
    17491752/** @copydoc VBOXHDDBACKEND::pfnWrite */
    1750 static int dmgWrite(void *pBackendData, uint64_t uOffset, const void *pvBuf,
    1751                     size_t cbToWrite, size_t *pcbWriteProcess,
    1752                     size_t *pcbPreRead, size_t *pcbPostRead, unsigned fWrite)
    1753 {
    1754     LogFlowFunc(("pBackendData=%#p uOffset=%llu pvBuf=%#p cbToWrite=%zu pcbWriteProcess=%#p pcbPreRead=%#p pcbPostRead=%#p\n",
    1755                  pBackendData, uOffset, pvBuf, cbToWrite, pcbWriteProcess, pcbPreRead, pcbPostRead));
     1753static int dmgWrite(void *pBackendData, uint64_t uOffset, size_t cbToWrite,
     1754                    PVDIOCTX pIoCtx, size_t *pcbWriteProcess, size_t *pcbPreRead,
     1755                    size_t *pcbPostRead, unsigned fWrite)
     1756{
     1757    LogFlowFunc(("pBackendData=%#p uOffset=%llu pIoCtx=%#p cbToWrite=%zu pcbWriteProcess=%#p pcbPreRead=%#p pcbPostRead=%#p\n",
     1758                 pBackendData, uOffset, pIoCtx, cbToWrite, pcbWriteProcess, pcbPreRead, pcbPostRead));
    17561759    PDMGIMAGE pThis = (PDMGIMAGE)pBackendData;
    17571760    int rc = VERR_NOT_IMPLEMENTED;
     
    17751778
    17761779/** @copydoc VBOXHDDBACKEND::pfnFlush */
    1777 static int dmgFlush(void *pBackendData)
     1780static int dmgFlush(void *pBackendData, PVDIOCTX pIoCtx)
    17781781{
    17791782    LogFlowFunc(("pBackendData=%#p\n", pBackendData));
     
    22692272    /* pfnFlush */
    22702273    dmgFlush,
     2274    /* pfnDiscard */
     2275    NULL,
    22712276    /* pfnGetVersion */
    22722277    dmgGetVersion,
     
    23212326    /* pfnSetParentFilename */
    23222327    NULL,
    2323     /* pfnAsyncRead */
    2324     NULL,
    2325     /* pfnAsyncWrite */
    2326     NULL,
    2327     /* pfnAsyncFlush */
    2328     NULL,
    23292328    /* pfnComposeLocation */
    23302329    genericFileComposeLocation,
     
    23352334    /* pfnResize */
    23362335    NULL,
    2337     /* pfnDiscard */
    2338     NULL,
    2339     /* pfnAsyncDiscard */
    2340     NULL,
    23412336    /* pfnRepair */
    23422337    NULL
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