Patent ID: 8504524

Claim:
A computer-implemented method for reclaiming space in a file system coupled to a block device, the computer-implemented method comprising computer-implemented operations for: writing a file to a volume in the block device at a first region, the first region having a first size; deleting the file from the first region; creating a dummy file; expanding the dummy file to fill the volume in the block device; retrieving locations reserved by the file system for the dummy file in the block device; upon retrieving the locations reserved by the file system for the dummy file in the block device, reclaiming the locations reserved by the file system for the dummy file by: if the locations reserved by the file system for the dummy file are not used by a snapshot of the volume, freeing the locations reserved by the file system for the dummy file for use by the file system; and if the locations reserved by the file system for the dummy file are used by a snapshot of the volume: determining whether a size of a subsequent file is less than the first size; and writing the subsequent file without performing a read-write-modify operation using the snapshot of the volume; and upon reclaiming the locations reserved by the file system for the dummy file, deleting the dummy file.