A method in a storage system reads blocks having both physical addresses
and logical addresses in the storage system from a first set of locations
in non-volatile storage to a cache memory and determines the level of
data fragmentation in the non-volatile storage. If the level of data
fragmentation exceeds a threshold level, the cache memory is marked and
the blocks are written to physically sequential locations with new
physical addresses in the non-volatile storage at a data consistency
point without changing the logical addresses of the blocks.