VirtualBox

Changeset 59455 in vbox for trunk/include/VBox


Ignore:
Timestamp:
Jan 25, 2016 12:23:10 PM (9 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
105208
Message:

Storage/VD: Remove the custom code in each backend which allocates all blocks in a fixed size image by writing zeros to it. Preparations to make use of more optimized methods to allocate large files on recent hosts (fallocate() and friends)

Location:
trunk/include/VBox
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/vd-ifs-internal.h

    r58106 r59455  
    205205     * @param   pStorage        The storage handle.
    206206     * @param   cbSize          The new size of the image.
     207     *
     208     * @note Depending on the host the underlying storage (backing file, etc.)
     209     *       might not have all required storage allocated (sparse file) which
     210     *       can delay writes or fail with a not enough free space error if there
     211     *       is not enough space on the storage medium when writing to the range for
     212     *       the first time.
     213     *       Use VDINTERFACEIOINT::pfnSetAllocationSize to make sure the storage is
     214     *       really alloacted.
    207215     */
    208216    DECLR3CALLBACKMEMBER(int, pfnSetSize, (void *pvUser, PVDIOSTORAGE pStorage,
    209217                                           uint64_t cbSize));
     218
     219    /**
     220     * Sets the size of the opened storage backend making sure the given size
     221     * is really allocated.
     222     *
     223     * @return VBox status code.
     224     * @param   pvUser          The opaque data passed on container creation.
     225     * @param   pStorage        The storage handle.
     226     * @param   cbSize          The new size of the image.
     227     * @param   fFlags          Flags for controlling the allocation strategy.
     228     *                          Reserved for future use, MBZ.
     229     */
     230    DECLR3CALLBACKMEMBER(int, pfnSetAllocationSize, (void *pvUser, PVDIOSTORAGE pStorage,
     231                                                     uint64_t cbSize, uint32_t fFlags,
     232                                                     PFNVDPROGRESS pfnProgress,
     233                                                     void *pvUser, unsigned uPercentStart,
     234                                                     unsigned uPercentSpan));
    210235
    211236    /**
     
    485510}
    486511
     512DECLINLINE(int) vdIfIoIntFileSetAllocationSize(PVDINTERFACEIOINT pIfIoInt, PVDIOSTORAGE pStorage,
     513                                               uint64_t cbSize, uint32_t fFlags,
     514                                               PFNVDPROGRESS pfnProgress,
     515                                               void *pvUser, unsigned uPercentStart,
     516                                               unsigned uPercentSpan)
     517{
     518    return pIfIoInt->pfnSetAllocationSize(pIfIoInt->Core.pvUser, pStorage, cbSize, fFlags,
     519                                          pfnProgress, pvUser, uPercentStart, uPercentSpan);
     520}
     521
    487522DECLINLINE(int) vdIfIoIntFileWriteSync(PVDINTERFACEIOINT pIfIoInt, PVDIOSTORAGE pStorage,
    488523                                       uint64_t uOffset, const void *pvBuffer, size_t cbBuffer)
  • trunk/include/VBox/vd-ifs.h

    r58106 r59455  
    432432     * @param   pStorage        The opaque storage handle to close.
    433433     * @param   cbSize          The new size of the image.
     434     *
     435     * @note Depending on the host the underlying storage (backing file, etc.)
     436     *       might not have all required storage allocated (sparse file) which
     437     *       can delay writes or fail with a not enough free space error if there
     438     *       is not enough space on the storage medium when writing to the range for
     439     *       the first time.
     440     *       Use VDINTERFACEIO::pfnSetAllocationSize to make sure the storage is
     441     *       really alloacted.
    434442     */
    435443    DECLR3CALLBACKMEMBER(int, pfnSetSize, (void *pvUser, void *pStorage, uint64_t cbSize));
     444
     445    /**
     446     * Sets the size of the opened storage backend making sure the given size
     447     * is really allocated.
     448     *
     449     * @return VBox status code.
     450     * @retval VERR_NOT_SUPPORTED if the implementer of the interface doesn't support
     451     *         this method.
     452     * @param  pvUser          The opaque data passed on container creation.
     453     * @param  pStorage        The storage handle.
     454     * @param  cbSize          The new size of the image.
     455     * @param  fFlags          Flags for controlling the allocation strategy.
     456     *                         Reserved for future use, MBZ.
     457     */
     458    DECLR3CALLBACKMEMBER(int, pfnSetAllocationSize, (void *pvUser, void *pStorage,
     459                                                     uint64_t cbSize, uint32_t fFlags));
    436460
    437461    /**
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