Patent ID: 8117160

Claim:
A method for use in a computer system having a file system that stores a plurality of files in a plurality of data blocks allocated to the file system, each of the plurality of files including at least one of the plurality of data blocks allocated to the file system, the computer system maintaining a reference count for at least some of the data blocks, each reference count for a corresponding data block providing an indication of a number of files that share the corresponding data block, the method comprising: (A) in response to a request to create a point in time copy of at least one existing file in the file system, the at least one existing file including an indirect association with at least one data block, the computer system: (A1) creating at least one new file that is a point in time copy of the at least one existing file, wherein the at least one new file and the at least one existing file share the at least one data block using the indirect association; and (A2) deferring updating the reference count for the at least one data block to reflect that the at least one data block is shared by the at least one new file and the at least one existing file via the indirect association; and (B) after deferring the updating of the reference count, the computer system updating the reference count for the at least one data block following an event that affects at least one direct association with the at least one data block, wherein the file system includes a first file system, wherein the at least one existing file includes the plurality of files in the first file system so that the act (A) is performed in response to a request to create a point in time copy of the first file system, and wherein (A1) includes creating a new file system that is a point in time copy of the first file system and (A2) includes deferring updating the reference count for the plurality of data blocks allocated to the first file system to reflect that the plurality of data blocks allocated to the first file system are shared by the at least one new file system, and wherein the plurality of files in the first file system includes a first file comprising a plurality of data blocks, and wherein the act (B) further includes updating the reference count for at least some of the plurality of data blocks in the first file to reflect that the at least some of the plurality of data blocks in the first file are shared by a second file in the new file system in response to a write occurring to the first file after the creation of the new file system and wherein the plurality of data blocks in the first file comprises at least first and second data blocks, and wherein the act (B) further comprises an act of: updating the reference count for the first data block to reflect that the first data block is shared by the second file in response to a write occurring to the first file that results in overwriting the second data block but does not result in overwriting the first data block.