Using a Data Structure to Manage Directory-Tree Operations in File Storage
An illustrative data storage system establishes a data structure for a directory of a file system, the data structure referenced by all files and directories within the directory tree of the directory. The data storage system coordinates, based on the data structure and on operations applied to the directory, implementation of the operations on the files and directories within the directory tree of the directory.
1 . A data storage system comprising:
a memory storing instructions; and
a processor communicatively coupled to the memory and configured to execute the instructions to:
establish a data structure for a directory of a file system, the data structure referenced by all files and directories within a directory tree of the directory; and
coordinate, based on the data structure and on operations applied to the directory, implementation of the operations on the files and directories within the directory tree of the directory.
2 . The data storage system of claim 1 , wherein the coordinating implementation of the operations on the files and directories within the directory tree of the directory comprises using the data structure to delay implementation of one or more of the operations on one or more of the files and directories.
3 . The data storage system of claim 1 , wherein:
the operations comprise a snapshot of the directory of the file system; and
the coordinating implementation of the operations on the files and directories within the directory tree of the directory comprises taking a snapshot of a file in response to a request to modify the file.
4 . The data storage system of claim 3 , wherein:
the snapshot is applied to the directory at a first time; and
the implementation of the snapshot on the file is delayed until the request to modify the file is received at a second time subsequent to the first time.
5 . The data storage system of claim 1 , further comprising:
maintaining versions of the data structure comprising a first version of the data structure and a second version of the data structure.
6 . The data storage system of claim 5 , wherein:
the first version of the data structure represents all files and directories within the directory tree of the directory at a first time; and
the second version of the data structure represents all files and directories within the directory tree of the directory at a second time subsequent to the first time.
7 . The data storage system of claim 6 , wherein the files and directories within the directory tree of the directory at the second time is different from the files and directories within the directory tree of the directory at the first time.
8 . The data storage system of claim 1 , wherein the operations comprise at least one of a snapshot operation, a cloning operation, a replication operation, a continuous data protection operation, a quota operation, a space management operation, or a space accounting operation.
9 . The data storage system of claim 1 , wherein the directory is a managed directory configured to support application of operations to contents of the managed directory as a group.
10 . The data storage system of claim 9 , wherein the managed directory is a subdirectory within a root directory tree of the file system.
11 . A method comprising:
establishing, by a data storage system, a data structure for a directory of a file system, the data structure referenced by all files and directories within a directory tree of the directory; and
coordinating, by the data storage system and based on the data structure and on operations applied to the directory, implementation of the operations on the files and directories within the directory tree of the directory.
12 . The method of claim 11 , wherein the coordinating implementation of the operations on the files and directories within the directory tree of the directory comprises using the data structure to delay implementation of one or more of the operations on one or more of the files and directories.
13 . The method of claim 11 , wherein:
the operations comprise a snapshot of the directory of the file system; and
the coordinating implementation of the operations on the files and directories within the directory tree of the directory comprises taking a snapshot of a file in response to a request to modify the file.
14 . The method of claim 13 , wherein:
the snapshot is applied to the directory at a first time; and
the implementation of the snapshot on the file is delayed until the request to modify the file is received at a second time subsequent to the first time.
15 . The method of claim 11 , further comprising:
maintaining versions of the data structure comprising a first version of the data structure and a second version of the data structure.
16 . The method of claim 15 , wherein:
the first version of the data structure represents all files and directories within the directory tree of the directory at a first time; and
the second version of the data structure represents all files and directories within the directory tree of the directory at a second time subsequent to the first time.
17 . The method of claim 16 , wherein the files and directories within the directory tree of the directory at the second time is different from the files and directories within the directory tree of the directory at the first time.
18 . The method of claim 11 , wherein the operations comprise at least one of a snapshot operation, a cloning operation, a replication operation, a continuous data protection operation, a quota operation, a space management operation, or a space accounting operation.
19 . The method of claim 11 , wherein the directory is a managed directory configured to support application of operations to contents of the managed directory as a group.
20 . A computer program product embodied on a non-transitory computer-readable medium and comprising instructions that, when executed, cause a computing device to perform a process comprising:
establishing a data structure for a directory of a file system, the data structure referenced by all files and directories within a directory tree of the directory; and
coordinating, based on the data structure and on operations applied to the directory, implementation of the operations on the files and directories within the directory tree of the directory.