VirtualBox

Ignore:
Timestamp:
Feb 7, 2012 11:09:31 PM (13 years ago)
Author:
vboxsync
Message:

Runtime/Dvm: Add callbacks to query the allocation status of blocks (for filesystem aware image compaction)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/common/dvm/dvmgpt.cpp

    r39083 r40027  
    482482    NOREF(hVolFmt); /* No supported flags for now. */
    483483    return 0;
     484}
     485
     486DECLCALLBACK(bool) rtDvmFmtGptVolumeIsRangeIntersecting(RTDVMVOLUMEFMT hVolFmt,
     487                                                        uint64_t offStart, size_t cbRange,
     488                                                        uint64_t *poffVol,
     489                                                        size_t *pcbIntersect)
     490{
     491    bool fIntersect = false;
     492    PRTDVMVOLUMEFMTINTERNAL pVol = hVolFmt;
     493
     494    if (RTDVM_RANGE_IS_INTERSECTING(pVol->offStart, pVol->cbVolume, offStart))
     495    {
     496        fIntersect    = true;
     497        *poffVol      = offStart - pVol->offStart;
     498        *pcbIntersect = RT_MIN(cbRange, pVol->offStart + pVol->cbVolume - offStart);
     499    }
     500
     501    return fIntersect;
    484502}
    485503
     
    530548    /* pfnVolumeGetFlags */
    531549    rtDvmFmtGptVolumeGetFlags,
     550    /* pfnVolumeIsRangeIntersecting */
     551    rtDvmFmtGptVolumeIsRangeIntersecting,
    532552    /* pfnVolumeRead */
    533553    rtDvmFmtGptVolumeRead,
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