US 11,841,826 B2
Embedded reference counts for file clones
Sriram Patil, San Jose, CA (US); Abhay Kumar Jain, Cupertino, CA (US); Wenguang Wang, Santa Clara, CA (US); Nitin Rastogi, San Bruno, CA (US); Pranay Singh, San Ramon, CA (US); and Richard P. Spillane, Mountain View, CA (US)
Assigned to VMWARE INC., Palo Alto, CA (US)
Filed by VMware, Inc., Palo Alto, CA (US)
Filed on Oct. 4, 2022, as Appl. No. 17/960,023.
Application 17/960,023 is a continuation of application No. 17/119,959, filed on Dec. 11, 2020, granted, now 11,494,334.
Prior Publication US 2023/0028391 A1, Jan. 26, 2023
This patent is subject to a terminal disclaimer.
Int. Cl. G06F 17/00 (2019.01); G06F 7/00 (2006.01); G06F 16/11 (2019.01); G06F 16/185 (2019.01); G06F 16/174 (2019.01)
CPC G06F 16/128 (2019.01) [G06F 16/1748 (2019.01); G06F 16/185 (2019.01)] 21 Claims
OG exemplary drawing
 
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.