Patent attributes
A method of conditionally truncating a volume file in a data storage system includes identifying counts of categories of data blocks of the volume file, including (1) a first count of blocks owned by the volume file and located after the target end-of-file, (2) a second count of blocks located after the target end-of-file and requiring relocation to before the target end-of-file, and (3) a third count of blocks being free and owned by the volume file and located before the target end-of-file. An approximation of space to be freed is generated as a difference between the first count and a value expressing an excess of the second count over the third count. When the approximation is above a predetermined threshold, then the volume file is truncated to the target end-of-file, and otherwise truncating is refrained from.