VirtualBox

Changeset 32195 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Sep 2, 2010 1:18:14 PM (14 years ago)
Author:
vboxsync
Message:

VMDK/StreamOptimized: Truncate the file only if the size changed. Fixes horrible export performance if xfs is used on the target volume

File:
1 edited

Legend:

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

    r31776 r32195  
    10211021             * guarantees that data gets only appended. */
    10221022            Assert(DeflateState.uFileOffset > uCompOffset);
    1023             rc = vmdkFileSetSize(pVmdkFile, DeflateState.uFileOffset);
     1023
     1024            /*
     1025             * Change the file size only if the size really changed,
     1026             * because this is very expensive on some filesystems
     1027             * like XFS.
     1028             */
     1029            uint64_t cbOld;
     1030            rc = vmdkFileGetSize(pVmdkFile, &cbOld);
     1031            if (RT_FAILURE(rc))
     1032                return rc;
     1033
     1034            if (cbOld != DeflateState.uFileOffset)
     1035                rc = vmdkFileSetSize(pVmdkFile, DeflateState.uFileOffset);
    10241036
    10251037            if (uMarker == VMDK_MARKER_IGNORE)
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