VirtualBox

Changeset 64019 in vbox for trunk/src/VBox/Devices


Ignore:
Timestamp:
Sep 26, 2016 4:32:53 PM (8 years ago)
Author:
vboxsync
Message:

Storage: Get rid of PDMIMEDIA::pfnIoBufAllocate and PDMIMEDIA::pfnIoBufFree, was only used by AHCI anyway and is superseded by the I/O buffer management in PDMIMEDIAEX now

Location:
trunk/src/VBox/Devices/Storage
Files:
4 edited

Legend:

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

    r64002 r64019  
    951951}
    952952
    953 /** @interface_method_impl{PDMIMEDIA,pfnIoBufAlloc} */
    954 static DECLCALLBACK(int) drvdiskintIoBufAlloc(PPDMIMEDIA pInterface, size_t cb, void **ppvNew)
    955 {
    956     LogFlowFunc(("\n"));
    957     PDRVDISKINTEGRITY pThis = PDMIMEDIA_2_DRVDISKINTEGRITY(pInterface);
    958 
    959     return pThis->pDrvMedia->pfnIoBufAlloc(pThis->pDrvMedia, cb, ppvNew);
    960 }
    961 
    962 /** @interface_method_impl{PDMIMEDIA,pfnIoBufFree} */
    963 static DECLCALLBACK(int) drvdiskintIoBufFree(PPDMIMEDIA pInterface, void *pv, size_t cb)
    964 {
    965     LogFlowFunc(("\n"));
    966     PDRVDISKINTEGRITY pThis = PDMIMEDIA_2_DRVDISKINTEGRITY(pInterface);
    967 
    968     return pThis->pDrvMedia->pfnIoBufFree(pThis->pDrvMedia, pv, cb);
    969 }
    970 
    971953/** @interface_method_impl{PDMIMEDIA,pfnReadPcBios} */
    972954static DECLCALLBACK(int) drvdiskintReadPcBios(PPDMIMEDIA pInterface,
     
    16611643    pThis->IMedia.pfnGetSectorSize       = drvdiskintGetSectorSize;
    16621644    pThis->IMedia.pfnGetType             = drvdiskintGetType;
    1663     pThis->IMedia.pfnIoBufAlloc          = drvdiskintIoBufAlloc;
    1664     pThis->IMedia.pfnIoBufFree           = drvdiskintIoBufFree;
    16651645    pThis->IMedia.pfnReadPcBios          = drvdiskintReadPcBios;
    16661646
  • trunk/src/VBox/Devices/Storage/DrvHostBase.cpp

    r63482 r64019  
    324324
    325325    LogFlow(("%s-%d: drvHostBaseGetUuid: returns VINF_SUCCESS *pUuid=%RTuuid\n", pThis->pDrvIns->pReg->szName, pThis->pDrvIns->iInstance, pUuid));
    326     return VINF_SUCCESS;
    327 }
    328 
    329 
    330 /** @interface_method_impl{PDMIBLOCK,pfnIoBufAlloc} */
    331 static DECLCALLBACK(int) drvHostBaseIoBufAlloc(PPDMIMEDIA pInterface, size_t cb, void **ppvNew)
    332 {
    333     RT_NOREF(pInterface);
    334     LogFlowFunc(("\n"));
    335 
    336     int rc;
    337     void *pvNew = RTMemAlloc(cb);
    338     if (RT_LIKELY(pvNew))
    339     {
    340         *ppvNew = pvNew;
    341         rc = VINF_SUCCESS;
    342     }
    343     else
    344         rc = VERR_NO_MEMORY;
    345 
    346     LogFlowFunc(("returns %Rrc\n", rc));
    347     return rc;
    348 }
    349 
    350 /** @interface_method_impl{PDMIBLOCK,pfnIoBufFree} */
    351 static DECLCALLBACK(int) drvHostBaseIoBufFree(PPDMIMEDIA pInterface, void *pv, size_t cb)
    352 {
    353     RT_NOREF(pInterface, cb);
    354     LogFlowFunc(("\n"));
    355 
    356     RTMemFree(pv);
    357 
    358     LogFlowFunc(("returns %Rrc\n", VINF_SUCCESS));
    359326    return VINF_SUCCESS;
    360327}
     
    19101877    pThis->IMedia.pfnGetType                = drvHostBaseGetType;
    19111878    pThis->IMedia.pfnGetUuid                = drvHostBaseGetUuid;
    1912     pThis->IMedia.pfnIoBufAlloc             = drvHostBaseIoBufAlloc;
    1913     pThis->IMedia.pfnIoBufFree              = drvHostBaseIoBufFree;
    19141879    pThis->IMedia.pfnBiosGetPCHSGeometry    = drvHostBaseGetPCHSGeometry;
    19151880    pThis->IMedia.pfnBiosSetPCHSGeometry    = drvHostBaseSetPCHSGeometry;
  • trunk/src/VBox/Devices/Storage/DrvRamDisk.cpp

    r64002 r64019  
    624624}
    625625
    626 /** @copydoc PDMIMEDIA::pfnIoBufAlloc */
    627 static DECLCALLBACK(int) drvramdiskIoBufAlloc(PPDMIMEDIA pInterface, size_t cb, void **ppvNew)
    628 {
    629     RT_NOREF1(pInterface);
    630 
    631     int rc = VINF_SUCCESS;
    632     void *pv = RTMemAlloc(cb);
    633     if (pv)
    634         *ppvNew = pv;
    635     else
    636         rc = VERR_NO_MEMORY;
    637 
    638     return rc;
    639 }
    640 
    641 /** @copydoc PDMIMEDIA::pfnIoBufFree */
    642 static DECLCALLBACK(int) drvramdiskIoBufFree(PPDMIMEDIA pInterface, void *pv, size_t cb)
    643 {
    644     RT_NOREF2(pInterface, cb);
    645     RTMemFree(pv);
    646     return VINF_SUCCESS;
    647 }
    648 
    649626/** @copydoc PDMIMEDIA::pfnReadPcBios */
    650627static DECLCALLBACK(int) drvramdiskReadPcBios(PPDMIMEDIA pInterface,
     
    16611638    pThis->IMedia.pfnGetUuid             = drvramdiskGetUuid;
    16621639    pThis->IMedia.pfnGetSectorSize       = drvramdiskGetSectorSize;
    1663     pThis->IMedia.pfnIoBufAlloc          = drvramdiskIoBufAlloc;
    1664     pThis->IMedia.pfnIoBufFree           = drvramdiskIoBufFree;
    16651640    pThis->IMedia.pfnReadPcBios          = drvramdiskReadPcBios;
    16661641    pThis->IMedia.pfnDiscard             = drvramdiskDiscard;
  • trunk/src/VBox/Devices/Storage/DrvVD.cpp

    r64005 r64019  
    23752375}
    23762376
    2377 /** @interface_method_impl{PDMIMEDIA,pfnIoBufAlloc} */
    2378 static DECLCALLBACK(int) drvvdIoBufAlloc(PPDMIMEDIA pInterface, size_t cb, void **ppvNew)
    2379 {
    2380     LogFlowFunc(("\n"));
    2381     int rc;
    2382     PVBOXDISK pThis = PDMIMEDIA_2_VBOXDISK(pInterface);
    2383 
    2384     /* Configured encryption requires locked down memory. */
    2385     if (pThis->pCfgCrypto)
    2386         rc = RTMemSaferAllocZEx(ppvNew, cb, RTMEMSAFER_F_REQUIRE_NOT_PAGABLE);
    2387     else
    2388     {
    2389         cb = RT_ALIGN_Z(cb, _4K);
    2390         void *pvNew = RTMemPageAlloc(cb);
    2391         if (RT_LIKELY(pvNew))
    2392         {
    2393             *ppvNew = pvNew;
    2394             rc = VINF_SUCCESS;
    2395         }
    2396         else
    2397             rc = VERR_NO_MEMORY;
    2398     }
    2399 
    2400     LogFlowFunc(("returns %Rrc\n", rc));
    2401     return rc;
    2402 }
    2403 
    2404 /** @interface_method_impl{PDMIMEDIA,pfnIoBufFree} */
    2405 static DECLCALLBACK(int) drvvdIoBufFree(PPDMIMEDIA pInterface, void *pv, size_t cb)
    2406 {
    2407     LogFlowFunc(("\n"));
    2408     int rc = VINF_SUCCESS;
    2409     PVBOXDISK pThis = PDMIMEDIA_2_VBOXDISK(pInterface);
    2410 
    2411     if (pThis->pCfgCrypto)
    2412         RTMemSaferFree(pv, cb);
    2413     else
    2414     {
    2415         cb = RT_ALIGN_Z(cb, _4K);
    2416         RTMemPageFree(pv, cb);
    2417     }
    2418 
    2419     LogFlowFunc(("returns %Rrc\n", rc));
    2420     return rc;
    2421 }
    2422 
    2423 
    24242377/* -=-=-=-=- IMount -=-=-=-=- */
    24252378
     
    43514304    pThis->IMedia.pfnGetUuid             = drvvdGetUuid;
    43524305    pThis->IMedia.pfnDiscard             = drvvdDiscard;
    4353     pThis->IMedia.pfnIoBufAlloc          = drvvdIoBufAlloc;
    4354     pThis->IMedia.pfnIoBufFree           = drvvdIoBufFree;
    43554306    pThis->IMedia.pfnSendCmd             = NULL;
    43564307
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