VirtualBox

Changeset 27739 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Mar 26, 2010 1:23:35 PM (15 years ago)
Author:
vboxsync
Message:

DrvVD: Implement set size operation for the async I/O interface

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Storage/DrvVD.cpp

    r27303 r27739  
    351351}
    352352
    353 static DECLCALLBACK(int) drvvdAsyncIOGetSize(void *pvUser, void *pStorage, uint64_t *pcbSize)
    354 {
    355     PVBOXDISK pDrvVD = (PVBOXDISK)pvUser;
    356     PDRVVDSTORAGEBACKEND pStorageBackend = (PDRVVDSTORAGEBACKEND)pStorage;
    357 
    358     return PDMR3AsyncCompletionEpGetSize(pStorageBackend->pEndpoint, pcbSize);
    359 }
    360 
    361 static DECLCALLBACK(int) drvvdAsyncIOSetSize(void *pvUser, void *pStorage, uint64_t cbSize)
    362 {
    363     PVBOXDISK pDrvVD = (PVBOXDISK)pvUser;
    364     PDRVVDSTORAGEBACKEND pStorageBackend = (PDRVVDSTORAGEBACKEND)pStorage;
    365 
    366     return VERR_NOT_SUPPORTED;
    367 }
    368 
    369353static DECLCALLBACK(int) drvvdAsyncIOReadSync(void *pvUser, void *pStorage, uint64_t uOffset,
    370354                                              size_t cbRead, void *pvBuf, size_t *pcbRead)
     
    488472    return PDMR3AsyncCompletionEpFlush(pStorageBackend->pEndpoint, pvCompletion,
    489473                                       (PPPDMASYNCCOMPLETIONTASK)ppTask);
     474}
     475
     476static DECLCALLBACK(int) drvvdAsyncIOGetSize(void *pvUser, void *pStorage, uint64_t *pcbSize)
     477{
     478    PVBOXDISK pDrvVD = (PVBOXDISK)pvUser;
     479    PDRVVDSTORAGEBACKEND pStorageBackend = (PDRVVDSTORAGEBACKEND)pStorage;
     480
     481    return PDMR3AsyncCompletionEpGetSize(pStorageBackend->pEndpoint, pcbSize);
     482}
     483
     484static DECLCALLBACK(int) drvvdAsyncIOSetSize(void *pvUser, void *pStorage, uint64_t cbSize)
     485{
     486    PVBOXDISK pDrvVD = (PVBOXDISK)pvUser;
     487    PDRVVDSTORAGEBACKEND pStorageBackend = (PDRVVDSTORAGEBACKEND)pStorage;
     488
     489    int rc = drvvdAsyncIOFlushSync(pvUser, pStorage);
     490    if (RT_SUCCESS(rc))
     491        rc = PDMR3AsyncCompletionEpSetSize(pStorageBackend->pEndpoint, cbSize);
     492
     493    return rc;
    490494}
    491495
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