VirtualBox

Changeset 44412 in vbox


Ignore:
Timestamp:
Jan 28, 2013 10:39:34 AM (12 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
83386
Message:

Storage: Merge sync/async interface for the cache

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/vd-cache-plugin.h

    r38469 r44412  
    132132
    133133    /**
    134      * Read data from a cache image. The area read never crosses a block
    135      * boundary.
    136      *
    137      * @returns VBox status code.
    138      * @returns VERR_VD_BLOCK_FREE if this image contains no data for this block.
    139      * @param   pBackendData    Opaque state data for this image.
    140      * @param   uOffset         Offset to start reading from.
    141      * @param   pvBuf           Where to store the read bits.
    142      * @param   cbRead          Number of bytes to read.
    143      * @param   pcbActuallyRead Pointer to returned number of bytes read.
    144      */
    145     DECLR3CALLBACKMEMBER(int, pfnRead, (void *pBackendData, uint64_t uOffset, void *pvBuf,
    146                                         size_t cbRead, size_t *pcbActuallyRead));
    147 
    148     /**
    149      * Write data to a cache image. The area written never crosses a block
    150      * boundary.
    151      *
    152      * @returns VBox status code.
    153      * @param   pBackendData    Opaque state data for this image.
    154      * @param   uOffset         Offset to start writing to.
    155      * @param   pvBuf           Where to retrieve the written bits.
    156      * @param   cbWrite         Number of bytes to write.
    157      * @param   pcbWriteProcess Pointer to returned number of bytes that could
    158      *                          be processed.
    159      */
    160     DECLR3CALLBACKMEMBER(int, pfnWrite, (void *pBackendData, uint64_t uOffset,
    161                                          const void *pvBuf, size_t cbWrite,
    162                                          size_t *pcbWriteProcess));
    163 
    164     /**
    165      * Flush data to disk.
    166      *
    167      * @returns VBox status code.
    168      * @param   pBackendData    Opaque state data for this image.
    169      */
    170     DECLR3CALLBACKMEMBER(int, pfnFlush, (void *pBackendData));
    171 
    172     /**
    173      * Get the version of a cache image.
    174      *
    175      * @returns version of cache image.
    176      * @param   pBackendData    Opaque state data for this image.
    177      */
    178     DECLR3CALLBACKMEMBER(unsigned, pfnGetVersion, (void *pBackendData));
    179 
    180     /**
    181      * Get the capacity of a cache image.
    182      *
    183      * @returns size of cache image in bytes.
    184      * @param   pBackendData    Opaque state data for this image.
    185      */
    186     DECLR3CALLBACKMEMBER(uint64_t, pfnGetSize, (void *pBackendData));
    187 
    188     /**
    189      * Get the file size of a cache image.
    190      *
    191      * @returns size of cache image in bytes.
    192      * @param   pBackendData    Opaque state data for this image.
    193      */
    194     DECLR3CALLBACKMEMBER(uint64_t, pfnGetFileSize, (void *pBackendData));
    195 
    196     /**
    197      * Get the image flags of a cache image.
    198      *
    199      * @returns image flags of cache image.
    200      * @param   pBackendData    Opaque state data for this image.
    201      */
    202     DECLR3CALLBACKMEMBER(unsigned, pfnGetImageFlags, (void *pBackendData));
    203 
    204     /**
    205      * Get the open flags of a cache image.
    206      *
    207      * @returns open flags of cache image.
    208      * @param   pBackendData    Opaque state data for this image.
    209      */
    210     DECLR3CALLBACKMEMBER(unsigned, pfnGetOpenFlags, (void *pBackendData));
    211 
    212     /**
    213      * Set the open flags of a cache image. May cause the image to be locked
    214      * in a different mode or be reopened (which can fail).
    215      *
    216      * @returns VBox status code.
    217      * @param   pBackendData    Opaque state data for this image.
    218      * @param   uOpenFlags      New open flags for this image.
    219      */
    220     DECLR3CALLBACKMEMBER(int, pfnSetOpenFlags, (void *pBackendData, unsigned uOpenFlags));
    221 
    222     /**
    223      * Get comment of a cache image.
    224      *
    225      * @returns VBox status code.
    226      * @param   pBackendData    Opaque state data for this image.
    227      * @param   pszComment      Where to store the comment.
    228      * @param   cbComment       Size of the comment buffer.
    229      */
    230     DECLR3CALLBACKMEMBER(int, pfnGetComment, (void *pBackendData, char *pszComment, size_t cbComment));
    231 
    232     /**
    233      * Set comment of a cache image.
    234      *
    235      * @returns VBox status code.
    236      * @param   pBackendData    Opaque state data for this image.
    237      * @param   pszComment      Where to get the comment from. NULL resets comment.
    238      *                          The comment is silently truncated if the image format
    239      *                          limit is exceeded.
    240      */
    241     DECLR3CALLBACKMEMBER(int, pfnSetComment, (void *pBackendData, const char *pszComment));
    242 
    243     /**
    244      * Get UUID of a cache image.
    245      *
    246      * @returns VBox status code.
    247      * @param   pBackendData    Opaque state data for this image.
    248      * @param   pUuid           Where to store the image UUID.
    249      */
    250     DECLR3CALLBACKMEMBER(int, pfnGetUuid, (void *pBackendData, PRTUUID pUuid));
    251 
    252     /**
    253      * Set UUID of a cache image.
    254      *
    255      * @returns VBox status code.
    256      * @param   pBackendData    Opaque state data for this image.
    257      * @param   pUuid           Where to get the image UUID from.
    258      */
    259     DECLR3CALLBACKMEMBER(int, pfnSetUuid, (void *pBackendData, PCRTUUID pUuid));
    260 
    261     /**
    262      * Get last modification UUID of a cache image.
    263      *
    264      * @returns VBox status code.
    265      * @param   pBackendData    Opaque state data for this image.
    266      * @param   pUuid           Where to store the image modification UUID.
    267      */
    268     DECLR3CALLBACKMEMBER(int, pfnGetModificationUuid, (void *pBackendData, PRTUUID pUuid));
    269 
    270     /**
    271      * Set last modification UUID of a cache image.
    272      *
    273      * @returns VBox status code.
    274      * @param   pBackendData    Opaque state data for this image.
    275      * @param   pUuid           Where to get the image modification UUID from.
    276      */
    277     DECLR3CALLBACKMEMBER(int, pfnSetModificationUuid, (void *pBackendData, PCRTUUID pUuid));
    278 
    279     /**
    280      * Dump information about a cache image.
    281      *
    282      * @param   pBackendData    Opaque state data for this image.
    283      */
    284     DECLR3CALLBACKMEMBER(void, pfnDump, (void *pBackendData));
    285 
    286     /**
    287      * Start an asynchronous read request.
     134     * Start a read request.
    288135     *
    289136     * @returns VBox status code.
     
    294141     * @param   pcbActuallyRead Pointer to returned number of bytes read.
    295142     */
    296     DECLR3CALLBACKMEMBER(int, pfnAsyncRead, (void *pBackendData, uint64_t uOffset, size_t cbRead,
    297                                              PVDIOCTX pIoCtx, size_t *pcbActuallyRead));
    298 
    299     /**
    300      * Start an asynchronous write request.
     143    DECLR3CALLBACKMEMBER(int, pfnRead, (void *pBackendData, uint64_t uOffset, size_t cbRead,
     144                                        PVDIOCTX pIoCtx, size_t *pcbActuallyRead));
     145
     146    /**
     147     * Start a write request.
    301148     *
    302149     * @returns VBox status code.
     
    312159     *                          amount of (previously read) padding data.
    313160     */
    314     DECLR3CALLBACKMEMBER(int, pfnAsyncWrite, (void *pBackendData, uint64_t uOffset, size_t cbWrite,
    315                                               PVDIOCTX pIoCtx, size_t *pcbWriteProcess));
     161    DECLR3CALLBACKMEMBER(int, pfnWrite, (void *pBackendData, uint64_t uOffset, size_t cbWrite,
     162                                         PVDIOCTX pIoCtx, size_t *pcbWriteProcess));
    316163
    317164    /**
     
    322169     * @param   pIoCtx          I/O context associated with this request.
    323170     */
    324     DECLR3CALLBACKMEMBER(int, pfnAsyncFlush, (void *pBackendData, PVDIOCTX pIoCtx));
     171    DECLR3CALLBACKMEMBER(int, pfnFlush, (void *pBackendData, PVDIOCTX pIoCtx));
     172
     173    /**
     174     * Discards the given amount of bytes from the cache.
     175     *
     176     * @returns VBox status code.
     177     * @retval  VERR_VD_DISCARD_ALIGNMENT_NOT_MET if the range doesn't meet the required alignment
     178     *          for the discard.
     179     * @param   pBackendData         Opaque state data for this image.
     180     * @param   pIoCtx               I/O context associated with this request.
     181     * @param   uOffset              The offset of the first byte to discard.
     182     * @param   cbDiscard            How many bytes to discard.
     183     */
     184    DECLR3CALLBACKMEMBER(int, pfnDiscard, (void *pBackendData, PVDIOCTX pIoCtx,
     185                                           uint64_t uOffset, size_t cbDiscard,
     186                                           size_t *pcbPreAllocated,
     187                                           size_t *pcbPostAllocated,
     188                                           size_t *pcbActuallyDiscarded,
     189                                           void   **ppbmAllocationBitmap,
     190                                           unsigned fDiscard));
     191
     192    /**
     193     * Get the version of a cache image.
     194     *
     195     * @returns version of cache image.
     196     * @param   pBackendData    Opaque state data for this image.
     197     */
     198    DECLR3CALLBACKMEMBER(unsigned, pfnGetVersion, (void *pBackendData));
     199
     200    /**
     201     * Get the capacity of a cache image.
     202     *
     203     * @returns size of cache image in bytes.
     204     * @param   pBackendData    Opaque state data for this image.
     205     */
     206    DECLR3CALLBACKMEMBER(uint64_t, pfnGetSize, (void *pBackendData));
     207
     208    /**
     209     * Get the file size of a cache image.
     210     *
     211     * @returns size of cache image in bytes.
     212     * @param   pBackendData    Opaque state data for this image.
     213     */
     214    DECLR3CALLBACKMEMBER(uint64_t, pfnGetFileSize, (void *pBackendData));
     215
     216    /**
     217     * Get the image flags of a cache image.
     218     *
     219     * @returns image flags of cache image.
     220     * @param   pBackendData    Opaque state data for this image.
     221     */
     222    DECLR3CALLBACKMEMBER(unsigned, pfnGetImageFlags, (void *pBackendData));
     223
     224    /**
     225     * Get the open flags of a cache image.
     226     *
     227     * @returns open flags of cache image.
     228     * @param   pBackendData    Opaque state data for this image.
     229     */
     230    DECLR3CALLBACKMEMBER(unsigned, pfnGetOpenFlags, (void *pBackendData));
     231
     232    /**
     233     * Set the open flags of a cache image. May cause the image to be locked
     234     * in a different mode or be reopened (which can fail).
     235     *
     236     * @returns VBox status code.
     237     * @param   pBackendData    Opaque state data for this image.
     238     * @param   uOpenFlags      New open flags for this image.
     239     */
     240    DECLR3CALLBACKMEMBER(int, pfnSetOpenFlags, (void *pBackendData, unsigned uOpenFlags));
     241
     242    /**
     243     * Get comment of a cache image.
     244     *
     245     * @returns VBox status code.
     246     * @param   pBackendData    Opaque state data for this image.
     247     * @param   pszComment      Where to store the comment.
     248     * @param   cbComment       Size of the comment buffer.
     249     */
     250    DECLR3CALLBACKMEMBER(int, pfnGetComment, (void *pBackendData, char *pszComment, size_t cbComment));
     251
     252    /**
     253     * Set comment of a cache image.
     254     *
     255     * @returns VBox status code.
     256     * @param   pBackendData    Opaque state data for this image.
     257     * @param   pszComment      Where to get the comment from. NULL resets comment.
     258     *                          The comment is silently truncated if the image format
     259     *                          limit is exceeded.
     260     */
     261    DECLR3CALLBACKMEMBER(int, pfnSetComment, (void *pBackendData, const char *pszComment));
     262
     263    /**
     264     * Get UUID of a cache image.
     265     *
     266     * @returns VBox status code.
     267     * @param   pBackendData    Opaque state data for this image.
     268     * @param   pUuid           Where to store the image UUID.
     269     */
     270    DECLR3CALLBACKMEMBER(int, pfnGetUuid, (void *pBackendData, PRTUUID pUuid));
     271
     272    /**
     273     * Set UUID of a cache image.
     274     *
     275     * @returns VBox status code.
     276     * @param   pBackendData    Opaque state data for this image.
     277     * @param   pUuid           Where to get the image UUID from.
     278     */
     279    DECLR3CALLBACKMEMBER(int, pfnSetUuid, (void *pBackendData, PCRTUUID pUuid));
     280
     281    /**
     282     * Get last modification UUID of a cache image.
     283     *
     284     * @returns VBox status code.
     285     * @param   pBackendData    Opaque state data for this image.
     286     * @param   pUuid           Where to store the image modification UUID.
     287     */
     288    DECLR3CALLBACKMEMBER(int, pfnGetModificationUuid, (void *pBackendData, PRTUUID pUuid));
     289
     290    /**
     291     * Set last modification UUID of a cache image.
     292     *
     293     * @returns VBox status code.
     294     * @param   pBackendData    Opaque state data for this image.
     295     * @param   pUuid           Where to get the image modification UUID from.
     296     */
     297    DECLR3CALLBACKMEMBER(int, pfnSetModificationUuid, (void *pBackendData, PCRTUUID pUuid));
     298
     299    /**
     300     * Dump information about a cache image.
     301     *
     302     * @param   pBackendData    Opaque state data for this image.
     303     */
     304    DECLR3CALLBACKMEMBER(void, pfnDump, (void *pBackendData));
    325305
    326306    /** Returns a human readable hard disk location string given a
  • trunk/src/VBox/Storage/VCICache.cpp

    r44233 r44412  
    11831183                while (pInt)
    11841184                {
    1185                    
     1185
    11861186                }
    11871187            }
     
    16321632
    16331633/** @copydoc VDCACHEBACKEND::pfnRead */
    1634 static int vciRead(void *pBackendData, uint64_t uOffset, void *pvBuf,
    1635                    size_t cbToRead, size_t *pcbActuallyRead)
    1636 {
    1637     LogFlowFunc(("pBackendData=%#p uOffset=%llu pvBuf=%#p cbToRead=%zu pcbActuallyRead=%#p\n", pBackendData, uOffset, pvBuf, cbToRead, pcbActuallyRead));
     1634static int vciRead(void *pBackendData, uint64_t uOffset, size_t cbToRead,
     1635                   PVDIOCTX pIoCtx, size_t *pcbActuallyRead)
     1636{
     1637    LogFlowFunc(("pBackendData=%#p uOffset=%llu cbToRead=%zu pIoCtx=%#p pcbActuallyRead=%#p\n",
     1638                 pBackendData, uOffset, cbToRead, pIoCtx, pcbActuallyRead));
    16381639    PVCICACHE pCache = (PVCICACHE)pBackendData;
    16391640    int rc = VINF_SUCCESS;
     
    16521653        cBlocksToRead = RT_MIN(cBlocksToRead, pExtent->u32Blocks - offRead);
    16531654
    1654         rc = vdIfIoIntFileReadSync(pCache->pIfIo, pCache->pStorage,
     1655        rc = vdIfIoIntFileReadUser(pCache->pIfIo, pCache->pStorage,
    16551656                                   pExtent->u64BlockAddr + offRead,
    1656                                    pvBuf, cBlocksToRead);
     1657                                   pIoCtx, cBlocksToRead);
    16571658    }
    16581659    else
     
    16721673
    16731674/** @copydoc VDCACHEBACKEND::pfnWrite */
    1674 static int vciWrite(void *pBackendData, uint64_t uOffset, const void *pvBuf,
    1675                     size_t cbToWrite, size_t *pcbWriteProcess)
    1676 {
    1677     LogFlowFunc(("pBackendData=%#p uOffset=%llu pvBuf=%#p cbToWrite=%zu pcbWriteProcess=%#p\n",
    1678                  pBackendData, uOffset, pvBuf, cbToWrite, pcbWriteProcess));
     1675static int vciWrite(void *pBackendData, uint64_t uOffset, size_t cbToWrite,
     1676                    PVDIOCTX pIoCtx, size_t *pcbWriteProcess)
     1677{
     1678    LogFlowFunc(("pBackendData=%#p uOffset=%llu cbToWrite=%zu pIoCtx=%#p pcbWriteProcess=%#p\n",
     1679                 pBackendData, uOffset, cbToWrite, pIoCtx, pcbWriteProcess));
    16791680    PVCICACHE pCache = (PVCICACHE)pBackendData;
    16801681    int rc = VINF_SUCCESS;
     
    16891690    while (cBlocksToWrite)
    16901691    {
    1691        
     1692
    16921693    }
    16931694
     
    16991700
    17001701/** @copydoc VDCACHEBACKEND::pfnFlush */
    1701 static int vciFlush(void *pBackendData)
     1702static int vciFlush(void *pBackendData, PVDIOCTX pIoCtx)
    17021703{
    17031704    LogFlowFunc(("pBackendData=%#p\n", pBackendData));
     
    19561957{
    19571958    NOREF(pBackendData);
    1958 }
    1959 
    1960 /** @copydoc VDCACHEBACKEND::pfnAsyncRead */
    1961 static int vciAsyncRead(void *pBackendData, uint64_t uOffset, size_t cbRead,
    1962                         PVDIOCTX pIoCtx, size_t *pcbActuallyRead)
    1963 {
    1964     int rc = VERR_NOT_SUPPORTED;
    1965     PVCICACHE pCache = (PVCICACHE)pBackendData;
    1966 
    1967     return rc;
    1968 }
    1969 
    1970 /** @copydoc VDCACHEBACKEND::pfnAsyncWrite */
    1971 static int vciAsyncWrite(void *pBackendData, uint64_t uOffset, size_t cbWrite,
    1972                          PVDIOCTX pIoCtx, size_t *pcbWriteProcess)
    1973 {
    1974     int rc = VERR_NOT_SUPPORTED;
    1975     PVCICACHE pCache = (PVCICACHE)pBackendData;
    1976 
    1977     return rc;
    1978 }
    1979 
    1980 /** @copydoc VDCACHEBACKEND::pfnAsyncFlush */
    1981 static int vciAsyncFlush(void *pBackendData, PVDIOCTX pIoCtx)
    1982 {
    1983     int rc = VERR_NOT_SUPPORTED;
    1984     PVCICACHE pCache = (PVCICACHE)pBackendData;
    1985 
    1986     return rc;
    19871959}
    19881960
     
    20161988    /* pfnFlush */
    20171989    vciFlush,
     1990    /* pfnDiscard */
     1991    NULL,
    20181992    /* pfnGetVersion */
    20191993    vciGetVersion,
     
    20422016    /* pfnDump */
    20432017    vciDump,
    2044     /* pfnAsyncRead */
    2045     vciAsyncRead,
    2046     /* pfnAsyncWrite */
    2047     vciAsyncWrite,
    2048     /* pfnAsyncFlush */
    2049     vciAsyncFlush,
    20502018    /* pfnComposeLocation */
    20512019    NULL,
  • trunk/src/VBox/Storage/VD.cpp

    r44408 r44412  
    833833 * @param   pCache   The cache to read from.
    834834 * @param   uOffset  Offset of the virtual disk to read.
    835  * @param   pvBuf    Where to store the read data.
    836835 * @param   cbRead   How much to read.
     836 * @param   pIoCtx   The I/O context to read into.
    837837 * @param   pcbRead  Where to store the number of bytes actually read.
    838838 *                   On success this indicates the number of bytes read from the cache.
     
    843843 */
    844844static int vdCacheReadHelper(PVDCACHE pCache, uint64_t uOffset,
    845                              void *pvBuf, size_t cbRead, size_t *pcbRead)
     845                             PVDIOCTX pIoCtx, size_t cbRead, size_t *pcbRead)
    846846{
    847847    int rc = VINF_SUCCESS;
    848848
    849     LogFlowFunc(("pCache=%#p uOffset=%llu pvBuf=%#p cbRead=%zu pcbRead=%#p\n",
    850                  pCache, uOffset, pvBuf, cbRead, pcbRead));
     849    LogFlowFunc(("pCache=%#p uOffset=%llu pIoCtx=%p cbRead=%zu pcbRead=%#p\n",
     850                 pCache, uOffset, pIoCtx, cbRead, pcbRead));
    851851
    852852    AssertPtr(pCache);
    853853    AssertPtr(pcbRead);
    854854
    855 #if 0 /** @todo: Cache implementation update */
    856     rc = pCache->Backend->pfnRead(pCache->pBackendData, uOffset, pvBuf,
    857                                   cbRead, pcbRead);
    858 #endif
     855    rc = pCache->Backend->pfnRead(pCache->pBackendData, uOffset, cbRead,
     856                                  pIoCtx, pcbRead);
    859857
    860858    LogFlowFunc(("returns rc=%Rrc pcbRead=%zu\n", rc, *pcbRead));
     
    868866 * @param   pCache     The cache to write to.
    869867 * @param   uOffset    Offset of the virtual disk to write to the cache.
    870  * @param   pcvBuf     The data to write.
    871868 * @param   cbWrite    How much to write.
     869 * @param   pIoCtx     The I/O context to ẃrite from.
    872870 * @param   pcbWritten How much data could be written, optional.
    873871 */
    874 static int vdCacheWriteHelper(PVDCACHE pCache, uint64_t uOffset, const void *pcvBuf,
    875                               size_t cbWrite, size_t *pcbWritten)
     872static int vdCacheWriteHelper(PVDCACHE pCache, uint64_t uOffset, size_t cbWrite,
     873                              PVDIOCTX pIoCtx, size_t *pcbWritten)
    876874{
    877875    int rc = VINF_SUCCESS;
    878876
    879     LogFlowFunc(("pCache=%#p uOffset=%llu pvBuf=%#p cbWrite=%zu pcbWritten=%#p\n",
    880                  pCache, uOffset, pcvBuf, cbWrite, pcbWritten));
     877    LogFlowFunc(("pCache=%#p uOffset=%llu pIoCtx=%p cbWrite=%zu pcbWritten=%#p\n",
     878                 pCache, uOffset, pIoCtx, cbWrite, pcbWritten));
    881879
    882880    AssertPtr(pCache);
    883     AssertPtr(pcvBuf);
     881    AssertPtr(pIoCtx);
    884882    Assert(cbWrite > 0);
    885883
    886 #if 0 /** @todo: Change cache implementation */
    887884    if (pcbWritten)
    888         rc = pCache->Backend->pfnWrite(pCache->pBackendData, uOffset, pcvBuf,
    889                                        cbWrite, pcbWritten);
     885        rc = pCache->Backend->pfnWrite(pCache->pBackendData, uOffset, cbWrite,
     886                                       pIoCtx, pcbWritten);
    890887    else
    891888    {
     
    894891        do
    895892        {
    896             rc = pCache->Backend->pfnWrite(pCache->pBackendData, uOffset, pcvBuf,
    897                                            cbWrite, &cbWritten);
     893            rc = pCache->Backend->pfnWrite(pCache->pBackendData, uOffset, cbWrite,
     894                                           pIoCtx, &cbWritten);
    898895            uOffset += cbWritten;
    899             pcvBuf   = (char *)pcvBuf + cbWritten;
    900896            cbWrite -= cbWritten;
    901897        } while (   cbWrite
    902                  && RT_SUCCESS(rc));
    903     }
    904 #endif
     898                 && (   RT_SUCCESS(rc)
     899                     || rc == VERR_VD_ASYNC_IO_IN_PROGRESS));
     900    }
    905901
    906902    LogFlowFunc(("returns rc=%Rrc pcbWritten=%zu\n",
     
    1002998            && !pImageParentOverride)
    1003999        {
     1000#if 0 /** @todo: Will go soon when the sync and async read helper versions are merged. */
    10041001            rc = vdCacheReadHelper(pDisk->pCache, uOffset, pvBuf,
    10051002                                   cbThisRead, &cbThisRead);
    1006 
     1003#endif
    10071004            if (rc == VERR_VD_BLOCK_FREE)
    10081005            {
     
    10141011                    && fUpdateCache)
    10151012                {
     1013#if 0 /** @todo: Will go soon when the sync and async read helper versions are merged. */
    10161014                    rc = vdCacheWriteHelper(pDisk->pCache, uOffset, pvBuf,
    10171015                                            cbThisRead, NULL);
     1016#endif
    10181017                }
    10191018            }
     
    22122211    } while (cbWriteCur != 0 && RT_SUCCESS(rc));
    22132212
     2213#if 0 /** @todo: Soon removed when sync and async version of the write helper are merged. */
    22142214    /* Update the cache on success */
    22152215    if (   RT_SUCCESS(rc)
     
    22202220    if (RT_SUCCESS(rc))
    22212221        rc = vdDiscardSetRangeAllocated(pDisk, uOffset, cbWrite);
     2222#endif
    22222223
    22232224    return rc;
     
    82058206        rc = pImage->Backend->pfnFlush(pImage->pBackendData, &IoCtx);
    82068207
    8207 #if 0 /** @todo: Change cache implementation. */
    82088208        if (   RT_SUCCESS(rc)
    82098209            && pDisk->pCache)
    8210             rc = pDisk->pCache->Backend->pfnFlush(pDisk->pCache->pBackendData);
    8211 #endif
     8210            rc = pDisk->pCache->Backend->pfnFlush(pDisk->pCache->pBackendData, &IoCtx);
    82128211    } while (0);
    82138212
Note: See TracChangeset for help on using the changeset viewer.

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