CPC G06F 16/128 (2019.01) [G06F 16/1748 (2019.01); G06F 16/185 (2019.01)] | 21 Claims |
1. A method comprising:
receiving, by a computer system, an instruction to remove a snapshot from a filesystem, the snapshot being a point-in-time copy of a filesystem tree that includes a plurality of file map entries mapped to data blocks; and
for each file map entry in the plurality of file map entries:
determining, by the computer system, whether the file map entry is present in a previous snapshot or a next snapshot, the previous snapshot being a prior point-in-time copy of the filesystem tree and the next snapshot being a subsequent point-in-time copy of the filesystem tree;
upon determining that the file map entry is not present in the previous snapshot or the next snapshot, determining, by the computer system, whether any file clone in the next snapshot refers to a data block mapped to the file map entry by checking whether a reference count entry for the data block in the next snapshot is non-zero; and
upon determining that no file clone in the next snapshot refers to the data block mapped to the file map entry, reclaiming, by the computer system, the data block.
|