- Timestamp:
- Jul 14, 2014 9:00:18 PM (11 years ago)
- Location:
- trunk/src/VBox/Devices/Storage
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Storage/DrvBlock.cpp
r47829 r52023 310 310 } 311 311 312 /** @copydoc PDMIBLOCK::pfnIoBufAlloc */ 313 static DECLCALLBACK(int) drvblockIoBufAlloc(PPDMIBLOCK pInterface, size_t cb, void **ppvNew) 314 { 315 PDRVBLOCK pThis = PDMIBLOCK_2_DRVBLOCK(pInterface); 316 317 return pThis->pDrvMedia->pfnIoBufAlloc(pThis->pDrvMedia, cb, ppvNew); 318 } 319 320 /** @copydoc PDMIBLOCK::pfnIoBufFree */ 321 static DECLCALLBACK(int) drvblockIoBufFree(PPDMIBLOCK pInterface, void *pv, size_t cb) 322 { 323 PDRVBLOCK pThis = PDMIBLOCK_2_DRVBLOCK(pInterface); 324 325 return pThis->pDrvMedia->pfnIoBufFree(pThis->pDrvMedia, pv, cb); 326 } 327 312 328 /* -=-=-=-=- IBlockAsync -=-=-=-=- */ 313 329 … … 873 889 pThis->IBlock.pfnGetType = drvblockGetType; 874 890 pThis->IBlock.pfnGetUuid = drvblockGetUuid; 891 pThis->IBlock.pfnIoBufAlloc = drvblockIoBufAlloc; 892 pThis->IBlock.pfnIoBufFree = drvblockIoBufFree; 875 893 876 894 /* IBlockBios. */ -
trunk/src/VBox/Devices/Storage/DrvVD.cpp
r51923 r52023 37 37 #include <iprt/pipe.h> 38 38 #include <iprt/system.h> 39 #include <iprt/memsafer.h> 39 40 40 41 #ifdef VBOX_WITH_INIP … … 1857 1858 } 1858 1859 1860 /** @copydoc PDMIMEDIA::pfnIoBufAlloc */ 1861 static DECLCALLBACK(int) drvvdIoBufAlloc(PPDMIMEDIA pInterface, size_t cb, void **ppvNew) 1862 { 1863 LogFlowFunc(("\n")); 1864 int rc = VINF_SUCCESS; 1865 void *pvNew = NULL; 1866 PVBOXDISK pThis = PDMIMEDIA_2_VBOXDISK(pInterface); 1867 1868 /* Configured encryption requires locked down memory. */ 1869 if (pThis->pCfgCrypto) 1870 pvNew = RTMemSaferAllocZ(cb); 1871 else 1872 { 1873 cb = RT_ALIGN_Z(cb, _4K); 1874 pvNew = RTMemPageAlloc(cb); 1875 } 1876 1877 if (RT_LIKELY(pvNew)) 1878 *ppvNew = pvNew; 1879 else 1880 rc = VERR_NO_MEMORY; 1881 1882 LogFlowFunc(("returns %Rrc\n", rc)); 1883 return rc; 1884 } 1885 1886 /** @copydoc PDMIMEDIA::pfnIoBufFree */ 1887 static DECLCALLBACK(int) drvvdIoBufFree(PPDMIMEDIA pInterface, void *pv, size_t cb) 1888 { 1889 LogFlowFunc(("\n")); 1890 int rc = VINF_SUCCESS; 1891 PVBOXDISK pThis = PDMIMEDIA_2_VBOXDISK(pInterface); 1892 1893 if (pThis->pCfgCrypto) 1894 RTMemSaferFree(pv, cb); 1895 else 1896 { 1897 cb = RT_ALIGN_Z(cb, _4K); 1898 RTMemPageFree(pv, cb); 1899 } 1900 1901 LogFlowFunc(("returns %Rrc\n", rc)); 1902 return rc; 1903 } 1904 1905 1859 1906 /******************************************************************************* 1860 1907 * Async Media interface methods * … … 2387 2434 pThis->IMedia.pfnGetUuid = drvvdGetUuid; 2388 2435 pThis->IMedia.pfnDiscard = drvvdDiscard; 2436 pThis->IMedia.pfnIoBufAlloc = drvvdIoBufAlloc; 2437 pThis->IMedia.pfnIoBufFree = drvvdIoBufFree; 2389 2438 2390 2439 /* IMediaAsync */
Note:
See TracChangeset
for help on using the changeset viewer.