VirtualBox

Ignore:
Timestamp:
Apr 15, 2008 12:24:52 PM (17 years ago)
Author:
vboxsync
Message:

VMDK: added missing bit for optimizing away writes with the same data (takes care of zero block writes and same data writes for snapshots in one go).

File:
1 edited

Legend:

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

    r7896 r7981  
    37283728    }
    37293729
    3730     /** @todo implement suppressing of zero data writes (a bit tricky in this
    3731      * case, as VMDK has no marker for zero blocks). We somehow need to get the
    3732      * information whether the information in this area is all zeroes as of the
    3733      * parent image. Then (based on the assumption that parent images are
    3734      * immutable) the write can be ignored. */
    3735 
    37363730    /* Handle the write according to the current extent type. */
    37373731    switch (pExtent->enmType)
     
    37523746                {
    37533747                    /* Full block write to a previously unallocated block.
    3754                      * Allocate GT and find out where to store the grain. */
    3755                     rc = vmdkAllocGrain(pImage->pGTCache, pExtent,
    3756                                         uSectorExtentRel, pvBuf, cbToWrite);
     3748                     * Check if the caller wants to avoid this. */
     3749                    if (!(fWrite & VD_WRITE_NO_ALLOC))
     3750                    {
     3751                        /* Allocate GT and find out where to store the grain. */
     3752                        rc = vmdkAllocGrain(pImage->pGTCache, pExtent,
     3753                                            uSectorExtentRel, pvBuf, cbToWrite);
     3754                    }
     3755                    else
     3756                        rc = VERR_VDI_BLOCK_FREE;
    37573757                    *pcbPreRead = 0;
    37583758                    *pcbPostRead = 0;
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