Directory tree deletion as supported file system operation
By using file system software independent of the operating system, and leveraging directory tree deletion attributes and token verification, files and directories in the directory tree can be deleted directly, solving the problems of high overhead and latency in existing technologies and improving deletion efficiency.
Patent Information
- Application Number
- CN202480031854.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Priority Date
- 2023-06-23
- Filing Date
- 2024-06-19
- Publication Date
- 2025-12-16
AI Technical Summary
Existing technologies require opening, marking, and closing operations for each file when deleting a large number of files in a directory tree, resulting in high overhead and latency, especially on low-latency storage media.
The file system is configured as upper-layer software independent of the operating system. It deletes files and directories in the directory tree directly after performing security checks by deleting attributes and token verification through the directory tree, thus avoiding transparent communication with the upper-layer software.
It reduces the overhead associated with opening, marking, and closing files, improves the efficiency of deleting directory trees, and reduces latency, especially significantly improving performance on low-latency storage media.
Smart Images

Figure CN121153033A_ABST
Abstract
Description
Background Technology
[0001] The operating system of a computing device (e.g., a server, desktop computer, laptop computer) is configured to interact with a file system to perform operations associated with files stored on the storage device (e.g., opening a file, deleting a file, writing to a file, reading from a file, replacing a file, copying a file, moving a file, searching for a file, creating a file). The file system is configured to include a hierarchical structure of nodes representing directories and / or files. Furthermore, the file system includes logic that allows navigation of nodes to locate files (e.g., documents, executable files, spreadsheets, images, videos, etc.) and perform operations associated with those files.
[0002] In some instances, applications running via the operating system may want to delete a large number of files (e.g., hundreds or even thousands). Typically, a large number of files can be associated with a directory tree. Therefore, a directory tree consists of multiple nodes representing multiple directories and / or multiple files located within those directories. In one example, when developers use a software development application to write and / or modify the program code of a software product, a large number of files are created and stored in a directory tree. While a file is temporarily stored as part of the directory tree, it can be referred to as an "intermediate" file. In this example, when the intermediate file is no longer needed, the software development application may attempt to delete all files in the directory tree simultaneously.
[0003] In the conventional approach of deleting all files in a directory tree based on a request from an application, the operating system and / or file system are required to enumerate each directory in the directory tree, open each file found, mark the file for deletion, and then close the file. This creates significant overhead for the operating system and / or file system, especially when the number of files in the directory tree is large (e.g., hundreds or even thousands of files). For example, opening a file requires the operating system and / or file system to perform the following operations: (i) switch the operating system from user mode to kernel mode, (ii) create a file object and an Input / Output Request Packet (IRP) and / or other temporary structures that can be used to notify registered operating system components (e.g., filter drivers configured for antivirus, backup agents, encryption products, etc., often referred to as “microfilters”) about the opening of the file, (iii) invoke the registered operating system components so that the registered operating system components can handle the opening of the file, (iv) create a Context Control Block (CCB) for the file object (e.g., “FsContext2”), (v) create a handle for the file object and add the handle entry to the table, (vi) provide the handle to the application requesting deletion, and (vii) switch the operating system from kernel mode back to user mode.
[0004] In addition, marking a file for deletion requires the operating system and / or file system to perform the following operations: (i) switching the operating system from user mode to kernel mode, (ii) creating an IRP and / or other temporary structure that can be used to notify registered operating system components about file deletion, (iii) invoking registered operating system components that are interested in monitoring changes to file data, (iv) specifying the file for deletion, and (v) switching the operating system from kernel mode back to user mode.
[0005] Finally, closing a file requires the operating system and / or file system to perform the following operations: (i) switch the operating system from user mode to kernel mode, (ii) create an IRP and / or other temporary structure that can be used to notify registered operating system components of the file deletion, (iii) invoke registered operating system components to enable them to handle the closing of the file, (iv) remove the file's name (often referred to as the "filename") from the directory where the file is located (often referred to as removing the file from the "namespace"), (v) release the storage allocated for the file's data (e.g., release the allocated clusters), (vi) remove handle entries from the table to release the file object, and (vii) switch the operating system back from kernel mode to user mode.
[0006] While some of the operations outlined above may only need to be performed once for different files, the conventional method of deleting a directory tree still requires each file in the directory tree to be opened, marked for deletion, and then closed, thus increasing the latency associated with deleting the directory tree. With the advent of low-latency storage media, such as non-volatile memory fast interfaces (NVME), this increased latency is even more pronounced for the operating system, the application requesting deletion, and / or the user of the computing device. The content disclosed in this article is presented in response to these and other technical challenges. Summary of the Invention
[0007] The system described in this paper introduces a file system operation that enables the file system to delete the directory tree without the overhead associated with opening each file in the directory tree, marking files for deletion, and closing files. In other words, the file system is configured to support the deletion of directories and / or files in the directory tree independently of (e.g., without) communicating with upper-level software in the operating system, and this operation is transparent to the upper-level software in the operating system. The software mentioned above is often referred to as "upper-level" software because the file system is configured between the software and the storage device storing the file data, and therefore, the software is at a level (or layer) "above" the file system. As described above, the upper-level software in the operating system includes operating system components that have previously registered an interest in monitoring changes to file data (e.g., file data deletion) and / or directories. In one example, these operating system components include filter drivers, often referred to as "microfilters," which can be configured for antivirus, backup agents, encryption products, etc.
[0008] As described herein, file system operations that enable the file system to delete a directory tree are indicated by directory tree deletion attributes (e.g., flags), which can be passed to the file system by the application within a request to delete the directory tree. Furthermore, the request includes an identifier for the directory tree. In one example, the identifier for the directory tree includes the name of the directory at the beginning of the directory tree (e.g., the root directory). In another example, the identifier for the directory tree may include the names of the individual directories and / or individual files that make up the directory tree. The request also includes a token carrying the identity of the application that initiated the request, and more importantly, the identity of the user who initiated the request through that application. The token and other security information attached to the file determine whether deletion can be performed within the directory tree.
[0009] In response to the received request, the file system is configured to ensure that applications and users are authorized to delete files in the directory tree. To do this, the file system retrieves access control information (e.g., access control lists (ACLs)) associated with the files and / or directories in the directory tree. To retrieve the access control information, the file system enumerates the directories and files in the directory tree. The file system then performs a security check by processing the token received in the request and the retrieved access control information. In one example, the file system performs a security check by traversing token list entries and ACL list entries on a per-file and / or per-directory basis to identify token list entries that match the ACL entries. After identifying a match, the ACL entry is checked to confirm its authorization for file deletion, as ACL entries can define other authorized actions (e.g., accessing a file, modifying a file) but may prohibit file deletion.
[0010] If the security check determines that the application and user are authorized to delete a file in the directory tree, the file system deletes the file as part of a file system operation. After the file system operation is fully executed (e.g., all files in the directory tree are deleted), the file system may indicate to the application that requested the directory tree deletion that the operation was successfully completed. If the security check determines that the application and user are not authorized to delete one of the files in the directory tree, the file system causes the file system operation to fail and indicates to the application that requested the directory tree deletion that the operation was not successfully completed.
[0011] As described above, upper-layer software components, such as filter drivers, have registered an interest in accessing, modifying, and / or deleting monitored files (e.g., file data) and / or directories. Therefore, in various embodiments, the file system cannot ignore registered interests for security, policy, and / or other reasons. To address this issue, the file system is configured to pre-request and receive authorization from upper-layer software components to support and execute future file system operations that implement directory tree deletion. In other words, the upper-layer software components must "opt-in" the file system operations that implement directory tree deletion.
[0012] For a given file system operation, the file system can verify that the upper-level software component has provided the necessary authorization to delete the directory tree independently of (e.g., without) communication with the upper-level software component. In one example, the upper-level software component specifically provides authorization for a predefined storage unit (e.g., a specific volume) of the storage device containing the directories and files of the directory tree. In another example, the upper-level software component specifically provides authorization for the directory tree itself; that is, the authorization names the root directory of the directory tree.
[0013] As described in this article, file systems can perform tree deletion operations in different ways. In one example, the file system can perform tree deletion operations in the foreground based on the directory tree deletion attributes of files and directories in a specified directory tree. First, the file system deletes the files and directories under the directory tree. If the token does not authorize the user and / or application to delete the file, the file deletion may fail. Second, the file system deletes the root of the directory tree. Performing tree deletion operations in the foreground based on the directory tree deletion attributes of files and directories in a specified directory tree will execute both actions in the foreground thread. That is, the files and directories in the directory tree, as well as the root directory of the directory tree, are deleted in the foreground thread. Deleting a file or directory involves two distinct actions. First, the file system removes the name of the file (often referred to as the "filename") or the directory from the directory tree. This action is often referred to as removing a file or directory from a namespace. Second, the file system releases the storage medium (e.g., clusters) allocated to the data of the file or directory. If the file is in use, the allocated storage medium can be released after the file is no longer in use.
[0014] In another example, the file system can perform a deferred tree deletion operation based on a directory tree deletion attribute specifying delayed deletion of files within the directory tree. Performing the deferred tree deletion operation based on the specified deferred deletion attribute involves two actions—one in a foreground thread and the other in a background thread. Specifically, the name of the root directory of the directory tree is removed from the namespace via an inline instruction in the foreground thread, and the files and / or directories under the root directory of the directory tree are deleted via a background thread. This deferred method prioritizes and focuses on removing the root directory of the directory tree from the namespace and postpones or delays more resource-intensive (e.g., resource-intensive) operations, such as deleting files and / or directories under the directory tree.
[0015] By reading the following detailed description and reviewing the accompanying drawings, other features and technical benefits, in addition to those explicitly described above, will become apparent. This summary is provided to introduce, in a simplified form, some concepts that will be further described in the following detailed description. This summary is not intended to identify key or essential features of the claimed subject matter, nor is it intended to help determine the scope of the claimed subject matter. For example, the term "technology" may refer to (multiple) systems, (multiple) methods, computer-readable instructions, (multiple) modules, algorithms, hardware logic, and / or (multiple) operations permitted in the context described above and throughout this document. Attached Figure Description
[0016] Specific embodiments are described with reference to the accompanying drawings. In the drawings, the leftmost numeral(s) of the reference numeral(s) indicates the drawing in which the reference numeral(s) first appear. Identical reference numerals in different drawings indicate similar or identical items.
[0017] Figure 1 An example computing device is shown that enables the deletion of a directory tree without the overhead associated with opening each file in the directory tree, marking files for deletion, and closing files.
[0018] Figure 2 This diagram illustrates the security check performed between token list entries and access control list entries associated with the file's access control information.
[0019] Figure 3 This diagram illustrates the foreground deletion of files in a directory tree.
[0020] Figure 4 A schematic diagram illustrating delayed deletion of files in a directory tree is shown.
[0021] Figure 5 This diagram illustrates how more efficient deletion of files in a specific directory of a directory tree can be achieved.
[0022] Figure 6 This diagram illustrates how more efficient deletion of files in a directory tree can be achieved.
[0023] Figure 7 This is an example flowchart illustrating various aspects of a method for implementing efficient directory tree deletion operations in a file system.
[0024] Figure 8 This is a computer architecture diagram illustrating the computer hardware and software architecture of a computing system capable of implementing the techniques and methods presented herein. Detailed Implementation
[0025] The technique described in this paper introduces a file system operation that enables the file system to delete the directory tree without the overhead associated with opening each file in the directory tree, marking files for deletion, and closing files. In other words, the file system is configured to support the deletion of directories and / or files in the directory tree independently of (e.g., without) communicating with upper-level software in the operating system, and this operation is transparent to the upper-level software in the operating system. File system operations can be implemented via directory tree deletion attributes included in the request to delete the directory tree. The file system can perform file system operations in different ways. In one example, the file system can perform file system operations in the foreground based on directory tree deletion attributes specifying foreground deletion of files and directories in the directory tree. In another example, the file system can perform file system operations in the deferred manner based on directory tree deletion attributes specifying deferred deletion of files in the directory tree. By operating on files and directories in a single call, the file system can optimize the overhead associated with security checks and data transfers across the user-to-kernel boundary.
[0026] The following text is for reference only. Figures 1-8 Various instances, scenarios, and aspects of implementing the techniques described in this article are described.
[0027] Figure 1 An example computing device 100 is shown executing a file system 102 that supports deleting a directory tree without the overhead associated with opening each file in the directory tree, marking files for deletion, and closing files. The computing device 100 may be a server computer, desktop computer, laptop computer, etc. Therefore, the computing device 100 includes an operating system 104 configured to interact with the file system 102 to perform operations associated with files stored on storage devices(s) 106 (such as hard disk drives, optical disk drives, etc.).
[0028] As mentioned above, file system 102 is configured to include a hierarchical structure of nodes representing directories and / or files. Furthermore, file system 102 includes logic that allows navigation of nodes to locate files (e.g., documents, executables, spreadsheets, images, videos, etc.) and perform operations associated with those files. Using the techniques described herein, operating system 104 executes application 108 (e.g., operating system applications, third-party applications installed on computing device 100) that want to delete a large number of files (e.g., hundreds or even thousands) associated with directory tree 110.
[0029] like Figure 1As shown, directory tree 110 includes multiple nodes representing multiple directories (represented by "D") and / or multiple files located within multiple directories (represented by "F"). The directories and / or files in the directory tree are located below the directory at the top of the directory tree (e.g., the root directory). For ease of discussion, Figure 1 The directory tree 110 shown includes four directory "D" nodes and five file "F" nodes. It should be understood that, in the context of this disclosure, if the directory tree 110 includes more than... Figure 1 The greater the number of directories and / or files shown, the more pronounced the technical benefits described herein will be.
[0030] Therefore, the file system 102 described herein is configured to support a new file system operation 112 that efficiently deletes the directory tree 110. To implement file system operation 112, file system 102 receives a request 114 from application 108. Request 114 includes an identifier 116 of the directory tree 110. In one example, the identifier 116 of the directory tree 110 includes the name of the directory at the top of the directory tree 110 (e.g., the topmost directory node in the namespace hierarchy at the beginning of the directory tree 110, such as the root node or root directory). In another example, the identifier 116 of the directory tree 110 may include the path of the directory to be deleted (e.g., a path name). In yet another example, the identifier of the directory tree 110 may include the names of the individual directories and / or individual files that make up the directory tree 110. Request 114 also includes a directory tree deletion attribute 118 (e.g., a flag) and a token 120 that indicates the identity of the application 108 issuing the request 114, and more importantly, the identity of the user 122 who initiated the request via application 108. The token helps determine whether an application is authorized to delete directories and / or files in directory tree 110. Therefore, token 120 represents both application 108 (e.g., application identifier) and user 122 (e.g., user identifier).
[0031] In response to receiving request 114, file system 102 is configured to ensure that application 108 and user 122 are authorized to delete files in directory tree 110 via file system operation 112. To this end, file system 102 enumerates 124 files and / or directories in directory tree 110 and obtains access control information 126 (e.g., access control lists (ACLs)) associated with the directories and / or files in directory tree 110. File system 102 then performs a security check 128 by processing the token 120 and access control information 126 received in request 114. In one example, file system 102 performs the security check 128 by traversing token list entries and ACL list entries on a per-file and / or per-directory basis to identify token list entries that match ACL entries. After identifying a match, the matching ACL entry is checked to confirm its authorization for file or directory deletion, as ACL entries may define other authorized actions (e.g., accessing files, modifying files) but may prohibit file or directory deletion.
[0032] If security check 128 determines that application 108 and user 122 are authorized to delete files or directories in directory tree 110, file system 102 continues to perform the two actions that constitute the deletion of the file. First, file system 102 removes 130 the name of the file (usually referred to as "filename") or directory from directory tree 110. Second, file system 102 releases 132 the storage medium (e.g., clusters) of the data 134 allocated to the file or directory.
[0033] After file system operation 112 is fully executed (e.g., all directories and / or all files in directory tree 110 are deleted), file system 102 may indicate to application 108, which requested the directory tree deletion, that the operation was successfully completed. If security check 128 determines that application 108 and user 122 are not authorized to delete one of the files or directories in directory tree 110, file system 102 causes file system operation 112 to fail and indicates to application 108, which requested the directory tree deletion, that the operation was not successfully completed. In various examples, file system operation 112 may fail after file system 102 deletes some, but not all, files in directory tree 110. Therefore, request 114 may result in partial directory tree deletion.
[0034] Therefore, the implementation of file system operations 112 within file system 102 avoids the conventional communication and overhead 136 associated with opening each file in the directory tree, marking files for deletion, and closing files. For example, file system 102 can perform file system operations 112 while remaining opaque to upper-layer software components 138, such as filter drivers 140 (alternatively referred to as “microfilters”), which have previously registered an interest in monitoring files (e.g., file data) and / or directories for access, modification, and / or deletion.
[0035] To ensure that the functionality (e.g., security) of the filter driver 140 is not compromised by the implementation of file system operation 112 based on directory tree deletion attribute 118, the file system 102 is configured to pre-request and accept authorization 142 so that the file system 102 supports and executes the file system operation 112 that implements directory tree deletion. In other words, the filter driver 140 must "actively consent" to the file system operation that implements directory tree deletion.
[0036] For a given file system operation (such as file system operation 112), file system 102 can confirm that filter driver 140 has provided the authorization 142 required to delete directory tree 110 independently of (e.g., without) communication with filter driver 140. In one example, filter driver 140 specifically provides authorization 142 for a predefined storage unit (e.g., a specific volume) of storage device 106 that stores directories and files of directory tree 110. In another example, filter driver 140 specifically provides authorization 142 for directory tree 110 itself. That is, authorization 142 identifies the name of the parent (e.g., root) directory at the beginning of directory tree 110.
[0037] Figure 2 This diagram illustrates the security checks performed between token list entries and ACL entries in the file's ACL. As described above, in order to perform file system operation 112, file system 102 needs to ensure that application 108 and user 122 are authorized to delete all files and / or directories in directory tree 110. Figure 2The diagram illustrates an enumerated directory tree (e.g., directory tree 110), which is identified in the file system as "ABC" directory tree 202 (e.g., "ABC" is the name of the directory tree). To proceed with file system operation 112, file system 102 examines the metadata 204 stored in association with "ABC" directory tree 202 to confirm that filter driver 140 is authorized to perform file system operation 112 without file system 102 providing general transparency to filter driver 140. As described above, filter driver 140 can authorize 142 for a predefined storage unit (e.g., a specific volume) of storage device 106 storing "ABC" directory tree 202, as shown via element 206. Alternatively, filter driver 140 can authorize directory tree 202 itself by the name of the directory that identifies the beginning of directory tree 202, as shown via element 208.
[0038] like Figure 2 As shown, each node of the “ABC” directory tree 202 can be associated with ACL 210 (1-N). A file can have its own unique ACL, or a file can inherit an ACL from the directory where it resides. While the file system 102 may need to use ACLs on files, using ACLs on directories may be optional.
[0039] Token 120 includes a list of token entries, referred to as token list entries 212 (1-M), where M can include any number (e.g., 1, 2, 3, 5, 10, 100). Token list entries include identifiers of the user group to which user 122 belongs (e.g., "Full-time Employee," "Finance Department," "Executive Team"). For discussion purposes, Figure 2 ACL 210(7) is shown to include a list of ACL entries, referred to as ACL list entries 214(1-L), where L can include any number (e.g., 1, 2, 3, 5, 10, 100). Similar to token list entries, ACL entries include the identifier of a user group (e.g., “Full-time Employees”, “Finance Department”, “Execution Team”) and the operations that user group is authorized to perform on the file (e.g., access the file, modify the file, delete the file, move the file, copy the file).
[0040] Figure 1The execution of security check 128 involves traversing the token list entries 212 (1-M) and ACL entries 210 (7) of a given file to identify matches 216 between a specific token list entry and a specific ACL entry. Once a match is found, file system 102 checks the authorized operation specified by the matching ACL entry to confirm that application 108 and user 122 are authorized to delete the file (as indicated by the “X” on the file node associated with ACL 210 (7)). Such a traversal of the list is performed on all files and / or directories in the “ABC” directory tree 202. That is, after comparing token 120 with ACL 210 (7), token 120 is compared with ACLs 210 (8), 210 (N), 210 (5), and 210 (6) (not in a specific order). In one example, file system 102 is configured to perform security checks on all files and / or directories before deleting any files, as this reduces the likelihood of partial directory tree deletion. However, in other examples, file system 102 is configured to begin deleting files and / or directories before performing security checks on all files and / or directories.
[0041] In some embodiments, the directory itself may also be deleted (e.g., removed from the namespace) after all files in a particular directory have been deleted and the directory is empty. In alternative embodiments, a directory-level security check may be performed to confirm that an empty directory can be deleted. For example, file system 102 may compare token 120 with ACL 210 (4).
[0042] Figure 3 A schematic diagram is shown in which the directory tree deletion attribute 118 in request 114 specifies that a foreground deletion 302 of a file in the directory tree should be implemented. Based on the specified foreground deletion 302, the file system 102 is configured to perform a file system operation 112 in a foreground thread 304 associated with the central processing unit (CPU) 306. That is, the filename (e.g., "file1") of a specific file 308 is deleted from the namespace of the "ABC" directory tree 202 via a first inline instruction 310 of the foreground thread 304. As described above, deleting a file includes removing the filename ("file1") from the ABC directory tree 202 and releasing the storage medium (e.g., clusters) allocated to the file data. Next, Figure 3 The example shows the deletion of the filename of another file 312 (e.g., "file 2") from the namespace of the "ABC" directory tree 202 via a second inline instruction 314 of the foreground thread 304, and the deletion of the filename of yet another file 316 (e.g., "file 3") from the namespace of the "ABC" directory tree 202 via a third inline instruction 318 of the foreground thread 304.
[0043] Figure 4A schematic diagram is shown in which the directory tree deletion attribute 118 in request 114 specifies the implementation of delayed deletion 402 of files in the directory tree. Based on the specified delayed deletion 402, the file system 102 is configured to perform file system operation 112 using a foreground thread 404 and a background thread 406 associated with CPU 408. That is, the name of the root directory of the directory tree (e.g., "ABC directory") is removed from the namespace via an inline instruction 410 in the foreground thread 404, and files and / or directories under the root directory of the directory tree are deleted via the background thread 406. As shown, the filename of a specific file 412 (e.g., "file 1") is deleted from the namespace of the "ABC" directory tree 202 via a first delayed instruction 414 of the background thread 406, and the filename of another file 416 (e.g., "file 2") is deleted from the namespace of the "ABC" directory tree 202 via a second delayed instruction 418 of the background thread 406. This delayed approach prioritizes and focuses on removing the root directory of the directory tree from the namespace, and postpones or delays more resource-intensive (e.g., resource-intensive) operations, such as deleting files and / or directories under the directory tree.
[0044] In various examples, if neither foreground deletion 302 nor delayed deletion 402 is specified (or conversely, if both foreground deletion 302 and delayed deletion 402 are specified), then as a result of the technical benefits provided by delayed deletion 402, file system 102 may preferentially or by default use delayed deletion 402.
[0045] Figure 5 This diagram illustrates how more efficient deletion of files within a specific directory of a directory tree can be achieved. As shown in the figure, Figure 2 Directory 502 in the ABC directory tree 202 is associated with directory metadata 504. The file system 102 is configured to store information in the directory metadata 504 indicating whether all files in a given directory 502 have inherited an ACL from directory 502. In other words, the file system stores information indicating whether ACL 210 (7-N) is the same as ACL 210 (4), because files stored in directory 502 automatically (e.g., by default) inherit directory-level ACL 210 (4).
[0046] Therefore, file system 102 tracks and / or counts the total number of files 506 in the directory (e.g., directory 502 has three files) and stores the number 506 in directory metadata 504. Furthermore, file system 102 tracks and counts the number 508 of files that have ACLs inherited from directory 502. When performing security check 128, file system 102 compares the number 506 with the number 508 510, and if comparison 510 determines that the number 506 is equal to the number 508 512, file system 102 can delete all files in directory 502 by performing a single security check 514. In other words, file system 102 does not need to perform security check 128 on every file in directory 502. Instead, file system 102 only needs to perform security check 128 using the ACL of one file in directory 502, and if a match is identified, file system 102 can delete the remaining files in the directory because they have the same ACL. Alternatively, file system 102 may not need to access the files at all, but can perform security check 128 at the same directory-level ACL as the file's ACL.
[0047] Figure 6 This diagram illustrates a more efficient way to delete files within a directory tree. As shown in the figure, Figure 2 The “ABC” directory tree 202 is associated with cache 602. Cache 602 is configured to store identifiers for ACL 210 (1-N). The file system 102 identifies a match between a specific token list entry and a specific ACL entry for a given file or directory in the “ABC” directory tree 202, and confirms that the deletion operation is authorized (as described above). Figure 2 After describing an example (as described in the text), file system 102 adds the identifier of the ACL that includes the specific ACL entry to cache 602. Therefore, cache 602 includes a set of ACL identifiers authorized for deletion based on token 120. Before deleting a file or directory, file system 102 may check cache 602 to determine if the identifier of the ACL associated with the file or directory has been authorized for deletion. For example, when checking to see if file 606 can be deleted, file system 102 checks cache 602 to look for the identifier associated with ACL 210 (7). Therefore, the deletion of file 606 is optimized because file system 102 does not need to perform the above steps for each file or directory. Figure 2 The traversal described.
[0048] Now go to Figure 7 , Figure 7 This is an example flowchart illustrating a method for implementing efficient directory tree deletion operations in a file system.
[0049] At operation 702, the file system receives from the application a request to perform a file system operation to delete directories and files in the directory tree. As described above, the request includes an identifier 116 associated with the directory tree, a directory tree deletion attribute 118, and a token 120 indicating the identity of the application 108 and the user 122 who initiated the request via the application 108.
[0050] At operation 704, the file system performs security checks by processing tokens and access control information associated with files in the directory tree. For example, it performs security checks on individual files by traversing token list entries and access control list entries to identify token list entries that match access control list entries. After identifying a match, the file system can confirm the deletion of the file for which the matching access control list entry is authorized.
[0051] At operation 706, the file system uses security checks to determine whether applications and users are authorized to delete directories and files in the directory tree.
[0052] At operation 708, independent of (for example, without) communication with the upper-level software of the operating system, the file system performs file system operations to delete directories and files from the directory tree of the storage device.
[0053] For ease of understanding, the methods discussed in this disclosure are depicted as individual operations (represented as independent boxes). However, these individually depicted operations should not be interpreted as having a dependency on each other in their execution order. The order in which the method is described is not intended to be construed as a limitation, and any number of boxes described can be combined in any order to implement the method or alternative methods. Furthermore, one or more operations among the provided operations may be modified or omitted.
[0054] The specific implementation of the techniques disclosed herein depends on the choice of computing device performance and other requirements. Therefore, the logical operations described herein may be referred to differently as states, operations, structural devices, actions, or modules. These states, operations, structural devices, actions, and modules can be implemented using hardware, software, firmware, special-purpose digital logic, and any combination thereof. It should be understood that more or fewer operations can be performed than those shown in the figures and described herein. These operations can also be performed in a different order than those described herein.
[0055] It should also be understood that the method shown can end at any time and need not be fully executed. Some or all of the operations of the method and / or substantially equivalent operations can be executed by executing computer-readable instructions included on a computer storage medium as defined below. The term "computer-readable instructions" and its variations as used in the specification and claims are used herein to broadly include routines, applications, application modules, program modules, programs, components, data structures, algorithms, etc. Computer-readable instructions can be implemented on various system configurations, including single-processor or multi-processor systems, minicomputers, mainframe computers, personal computers, handheld computing devices, microprocessor-based programmable consumer electronics products, and combinations thereof.
[0056] Therefore, it should be understood that the logical operations described herein are implemented as (1) computer-implemented sequences of actions or program modules running on a computing system, and / or (2) interconnected machine logic circuits or circuit modules within the computing system. The implementation method is a matter of choice depending on the performance and other requirements of the computing system.
[0057] Figure 8 Additional details are shown for an example computer architecture 800 for a device such as a computer or server capable of executing computer instructions. Figure 8 The illustrated computer architecture 800 includes multiple processing units 802, a system memory 804 including random access memory 806 (RAM) and read-only memory (ROM) 808, and a system bus 810 coupling the memory 804 to the multiple processing units 802. The processing units 802 may also include or be part of a processing system. In various examples, the processing units 802 of the processing system are distributed. In other words, one processing unit 802 of the processing system may be located in a first location (e.g., a rack in a data center), while another processing unit 802 of the processing system is located in a second location separate from the first location.
[0058] The processing units (such as processing units 802) can represent, for example, CPU-type processing units, graphics processing units (GPUs), field-programmable gate arrays (FPGAs), another type of digital signal processor (DSP), or other hardware logic components that can be driven by a CPU in some cases. For example, illustrative types of hardware logic components that can be used include application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), complex programmable logic devices (CPLDs), etc.
[0059] A basic input / output system is stored in ROM 808, which contains basic routines such as those that facilitate the transfer of information between components within the computer architecture 800 during startup. The computer architecture 800 also includes a mass storage device 812 for storing an operating system 814, applications(s) 816, a file system 818, and other data described herein.
[0060] Mass storage device 812 is connected to processing unit(s) 802 via a mass storage controller connected to bus 810. Mass storage device 812 and its associated computer-readable media provide non-volatile storage for computer architecture 800. Although the description of the computer-readable media herein refers to a mass storage device, those skilled in the art will understand that the computer-readable media can be any available computer-readable storage or communication medium accessible by computer architecture 800.
[0061] Computer-readable media include computer-readable storage media and / or communication media. Computer-readable storage media include one or more of the following: volatile memory, non-volatile memory, and / or other persistent and / or auxiliary computer storage media, removable and non-removable computer storage media implemented in any method or technology, for storing information such as computer-readable instructions, data structures, program modules, or other data. Therefore, computer storage media includes tangible and / or physical media included in devices and / or hardware components that are part of a device or external to a device, including RAM, static RAM (SRAM), dynamic RAM (DRAM), phase-change memory (PCM), ROM, erasable programmable ROM (EPROM), electrically EPROM (EEPROM), flash memory, optical disc read-only memory (CD-ROM), digital versatile disc (DVD), optical cards or other optical storage media, magnetic tape cassettes, magnetic tape, disk storage devices, magnetic cards or other magnetic storage devices or media, solid-state storage devices, storage arrays, network-attached storage devices, storage area networks, hosted computer storage devices, or any other memory storage, storage device, and / or storage medium that can be used to store and maintain information accessible to computing devices.
[0062] Compared to computer-readable storage media, communication media can embody computer-readable instructions, data structures, program modules, or other data in modulated data signals (such as carrier waves) or other transmission mechanisms. As defined herein, computer storage media does not include communication media. That is, computer-readable storage media does not include communication media consisting solely of modulated data signals, carrier waves, or propagation signals themselves.
[0063] Depending on the configuration, computer architecture 800 can operate in a networked environment that establishes a logical connection with a remote computer via network 820. Computer architecture 800 can be connected to network 820 via network interface unit 822 connected to bus 810.
[0064] It should be understood that the software components described herein, when loaded into and executed, can transform the processing unit(s) 802 and the entire computer architecture 800 from a general-purpose computing system into a special-purpose computing system tailored to facilitate the functionality presented herein. The processing unit(s) 802 can be constructed from any number of transistors or other discrete circuit elements, which can individually or collectively represent any number of states. More specifically, in response to executable instructions contained in the software modules disclosed herein, the processing unit(s) 802 can operate as a finite state machine. These computer-executable instructions can transform the processing unit(s) 802 by specifying how it transitions between states, thereby transforming the transistors or other discrete hardware elements constituting the processing unit(s) 802.
[0065] The public information presented herein also covers the topics set forth in the following clauses.
[0066] Example Item A, a method implemented by a file system of a computing device, includes: receiving from an application a request to perform a file system operation to delete directories and files in a directory tree, wherein the request includes: an identifier associated with the directory tree; directory tree deletion attributes specifying that the execution of the file system operation is independent of communication with upper-layer software of the operating system; and a token indicating the identity of the application and the identity of the user who initiated the request via the application, the token being usable to determine whether the application is authorized to delete directories and files in the directory tree; performing a security check by processing the token and access control information associated with the files in the directory tree; determining, based on the security check, that the application and the user are authorized to delete directories and files in the directory tree; and, in response to determining that the application and the user are authorized to delete directories and files in the directory tree, performing a file system operation to delete directories and files in the directory tree from a storage device, independent of communication with upper-layer software of the operating system.
[0067] Example Clause B, which describes the method according to Example Clause A, wherein the upper-layer software includes a filter driver.
[0068] Example Clause C, which describes the method according to Example Clause B, further includes verifying via directory tree deletion attributes that the filter driver has been authorized to perform file system operations.
[0069] Example Clause D, as described in Example Clause C, wherein the authorization is provided specifically for a storage unit on which a storage device stores directories and files.
[0070] Example clause E, as described in example clause C, wherein the authorization is provided specifically for the directory tree.
[0071] Example Clause F, the method according to any one of Example Clauses A to E, wherein: the access control information includes an access control list; and performing a security check includes, for an access control list associated with a file in a file: traversing token list entries and access control list entries to identify token list entries that match access control list entries; and determining that the access control list entries authorize the deletion of the file.
[0072] Example clause G, the method described according to example clause F, further includes: adding an identifier of an access control list to a cache configured to store the identifier of an access control list for which a token has been authorized for deletion; and checking the cache based on the fact that the identifier of the access control list has been added to determine that another file associated with the access control list in the file has been authorized for deletion.
[0073] Example clause H, the method described according to example clause F or example clause G, further includes: tracking a first number of files stored in a directory, the directory comprising files; and tracking a second number of files associated with an access control list inherited from the directory, wherein performing a security check includes: determining that the first number equals the second number; and deleting the file stored in the directory based on traversal and confirmation of the access control list implementation associated with the file.
[0074] Example Clause I, the method according to any one of Example Clauses A to H, wherein: the directory tree deletion attribute specifies foreground deletion of directories and files in the directory tree; and performing file system operations includes: executing a foreground thread based on the foreground deletion specified in the directory tree deletion attribute to delete directories and files in the directory tree from the storage device.
[0075] Example Clause J, the method according to any one of Example Clauses A to H, wherein: the directory tree deletion attribute specifies delayed deletion of directories and files in the directory tree; and performing file system operations includes: executing a foreground thread to remove the name of the directory tree from the namespace; and executing a background thread to delete the directories and files in the directory tree from the storage device based on the delayed deletion specified in the directory tree deletion attribute.
[0076] Example Item K: A system includes: a processing system; a file system; and a computer-readable storage medium storing instructions that, when executed by the processing system, cause the file system to perform operations, including: receiving from an application a request to perform a file system operation to delete directories and files in a directory tree, wherein the request includes: an identifier associated with the directory tree; directory tree deletion attributes specifying that the execution of the file system operation is independent of communication with upper-layer software of the operating system; and a token indicating the identity of the application and the identity of the user who initiated the request via the application, the token being usable to determine whether the application is authorized to delete directories and files in the directory tree; performing a security check by processing the token and access control information associated with the files in the directory tree; determining, based on the security check, that the application and the user are authorized to delete directories and files in the directory tree; and, in response to determining that the application and the user are authorized to delete directories and files in the directory tree, performing the file system operation to delete directories and files in the directory tree from a storage device, independent of communication with upper-layer software of the operating system.
[0077] Example Clause L, the system described in Example Clause K, wherein: the upper-layer software includes a filter driver; and the operation further includes confirming via directory tree deletion attributes that the filter driver has been authorized to perform file system operations.
[0078] Example clause M, the system described in example clause L, wherein the license is provided specifically for a storage unit on which a storage device storing directories and files is stored.
[0079] Example Clause N, the system described in Example Clause L, wherein the authorization is provided specifically for the directory tree.
[0080] Example Clause O, a system pursuant to any one of Example Clauses K to N, wherein: access control information includes access control lists; and performing security checks includes, for an access control list associated with a file in a file: traversing token list entries and access control list entries to identify token list entries that match access control list entries; and confirming that the access control list entries authorize the deletion of the file.
[0081] Example Clause P, the system described in Example Clause O, further includes: adding an identifier of an access control list to a cache configured to store the identifier of an access control list for which a token has been authorized for deletion; and checking the cache based on the fact that the identifier of the access control list has been added to determine that another file associated with the access control list in the file has been authorized for deletion.
[0082] Example Clause Q, the system described in Example Clause O or Example Clause P, further includes: tracking a first number of files stored in a directory, the directory comprising files; and tracking a second number of files associated with an access control list inherited from the directory, wherein performing a security check includes: determining that the first number equals the second number; and deleting the file stored in the directory based on traversal and confirmation of the access control list implementation associated with the file.
[0083] Example clause R, a system according to any one of example clauses K to Q, wherein: the directory tree deletion attribute specifies foreground deletion of directories and files in the directory tree; and performing file system operations includes executing a foreground thread based on the foreground deletion specified in the directory tree deletion attribute to delete directories and files in the directory tree from the storage device.
[0084] Example Clause S, a system pursuant to any one of Example Clauses K to Q, wherein: the directory tree deletion attribute specifies delayed deletion of directories and files in the directory tree; and performing file system operations includes: executing a foreground thread to remove the name of the directory tree from the namespace; and executing a background thread to delete the directories and files in the directory tree from the storage device based on the delayed deletion specified in the directory tree deletion attribute.
[0085] Example Clause T, a computer-readable storage medium storing instructions that, when executed by a processing system, cause a file system to perform operations, including: receiving from an application a request to perform a file system operation to delete directories and files in a directory tree, wherein the request includes: an identifier associated with the directory tree; directory tree deletion attributes specifying that the execution of the file system operation is independent of communication with upper-layer software of the operating system; and a token indicating the identity of the application and the identity of the user who initiated the request via the application, the token being usable to determine whether the application is authorized to delete directories and files in the directory tree; performing a security check by processing the token and access control information associated with the files in the directory tree; determining, based on the security check, that the application and the user are authorized to delete directories and files in the directory tree; and, in response to determining that the application and the user are authorized to delete directories and files in the directory tree, performing a file system operation to delete directories and files in the directory tree from a storage device, independent of communication with upper-layer software of the operating system.
[0086] While certain exemplary embodiments have been described, these embodiments are presented by way of example only and are not intended to limit the scope of the invention disclosed herein. Therefore, nothing in the foregoing description is intended to imply that any particular feature, characteristic, step, component, module, or block is necessary or indispensable. In fact, the novel methods and systems described herein can be implemented in various other forms; furthermore, various omissions, substitutions, and changes can be made to the form of the methods and systems described herein without departing from the spirit of the invention disclosed herein. The appended claims and their equivalents are intended to cover forms or modifications that fall within the scope and spirit of the invention disclosed herein.
[0087] It should be understood that any reference to elements such as “first”, “second”, etc., in the summary of the invention and / or the detailed description is not intended and should not be construed as necessarily corresponding to any reference to elements such as “first”, “second”, etc., in the claims. Rather, any use of “first” and “second” in the summary of the invention, the detailed description, and / or the claims can be used to distinguish two different instances of the same element (e.g., two different files, two different directories).
[0088] Finally, while various configurations have been described using language specific to structural features and / or methodological actions, it should be understood that the subject matter defined in the appended statements is not necessarily limited to the specific features or actions described. Rather, these specific features and actions are disclosed as exemplary forms of implementing the claimed subject matter.
Claims
1. A method implemented by a file system (102) of a computing device (100), comprising: Receive (702) a request (114) from application (108) to perform a file system operation (112) to delete directories and files in directory tree (110), wherein the request includes: The identifier (116) associated with the directory tree; The directory tree deletion attribute (118) specifies that the file system operation will be performed independently of communication with the upper-level software (138) of the operating system (104); and A token (120) indicating the identity of the application and the identity of the user who initiated the request through the application, the token being used to determine whether the application is authorized to delete the directory and the file in the directory tree; A security check (704) (128) is performed by processing the token and the access control information (126) associated with the file in the directory tree; Based on the security check, it is determined (706) that the application and the user are authorized to delete the directory and the file in the directory tree; and In response to determining that the application and the user are authorized to delete the directories and files in the directory tree, independent of communication with the upper-layer software of the operating system, the file system operation of deleting the directories and files in the directory tree from the storage device (106) is performed (708).
2. The method according to claim 1, wherein the upper-layer software includes a filter driver.
3. The method according to claim 2, further comprising: The filter driver is confirmed to have been authorized to perform the file system operations by deleting the directory tree attributes.
4. The method of claim 3, wherein the authorization is provided specifically for a storage unit of the storage device, on which the directory and the files are stored.
5. The method of claim 3, wherein the authorization is provided specifically for the directory tree.
6. The method according to any one of claims 1 to 5, wherein: The access control information includes an access control list; as well as Performing the security check includes checking the access control list associated with the files in the file: Iterate through the token list entries and access control list entries to identify token list entries that match the access control list entries; as well as Confirm that the access control list entry authorizes the deletion of the file.
7. The method of claim 6, further comprising: The identifier for the access control list is added to the cache, which is configured to store the identifier for the access control list for which the token is authorized to be deleted; as well as Based on the fact that the identifier for the access control list has been added to the cache, the cache is checked to determine if another file associated with the access control list in the file has been authorized to be deleted.
8. The method of claim 6, further comprising: Track a first number of files stored in a directory, which includes the files; as well as Tracking a second number of files associated with an access control list inherited from the directory, wherein performing the security check includes: The first number is determined to be equal to the second number; The file stored in the directory is deleted based on the traversal and confirmation implemented for the access control list associated with the file.
9. The method according to any one of claims 1 to 8, wherein: The directory tree deletion attribute specifies the foreground deletion of the directory and the file in the directory tree; as well as Performing the file system operation includes executing a foreground thread based on the foreground deletion specified in the directory tree deletion attribute to delete the directory and the file from the directory tree in the storage device.
10. The method according to any one of claims 1 to 8, wherein: The directory tree deletion attribute specifies the delayed deletion of the directories and files in the directory tree; as well as Performing the file system operations includes: Execute a foreground thread to remove the name of the directory tree from the namespace; as well as Based on the delayed deletion specified in the directory tree deletion attribute, a background thread is executed to delete the directory and the file in the directory tree from the storage device.
11. A system (100), (800), comprising: Processing system (802); File system (102); as well as Computer-readable storage media (804), (812), wherein the computer-readable storage media stores instructions, which, when executed by the processing system, cause the file system to perform operations, including: Receive (702) a request from application (108) to perform a file system operation (112) to delete directories and files in the directory tree (110), wherein the request includes: The identifier (116) associated with the directory tree; The directory tree deletion attribute (118) specifies that the file system operation will be performed independently of communication with the upper-level software (138) of the operating system (104); and A token (120) indicating the identity of the application and the identity of the user who initiated the request through the application, the token being used to determine whether the application is authorized to delete the directory and the file in the directory tree; A security check (704) (128) is performed by processing the token and the access control information (126) associated with the file in the directory tree; Based on the security check, it is determined (706) that the application and the user are authorized to delete the directory and the file in the directory tree; and In response to determining that the application and the user are authorized to delete the directories and files in the directory tree, independent of communication with the upper-layer software of the operating system, the file system operation of deleting the directories and files in the directory tree from the storage device (106) is performed (708).
12. The system according to claim 11, wherein: The upper-layer software includes a filter driver; and The operation also includes verifying, via the directory tree deletion attribute, that the filter driver has been authorized to perform the file system operation.
13. The system of claim 12, wherein the authorization is provided specifically for a storage unit of the storage device, on which the directory and the files are stored.
14. The system of claim 12, wherein the authorization is provided specifically for the directory tree.
15. The system according to any one of claims 11 to 14, wherein: The access control information includes an access control list; as well as Performing the security check includes checking the access control list associated with the files in the file: Iterate through the token list entries and access control list entries to identify token list entries that match the access control list entries; as well as Confirm that the access control list entry authorizes the deletion of the file.
16. The system of claim 15, wherein the operation further comprises: The identifier for the access control list is added to the cache, which is configured to store the identifier for the access control list for which the token is authorized to be deleted; as well as Based on the fact that the identifier for the access control list has been added to the cache, the cache is checked to determine if another file associated with the access control list in the file has been authorized to be deleted.
17. The system of claim 15, wherein the operation further comprises: Track a first number of files stored in a directory, which includes the files; as well as Tracking a second number of files associated with an access control list inherited from the directory, wherein performing the security check includes: The first number is determined to be equal to the second number; The file in the directory is deleted based on the traversal and confirmation implemented for the access control list associated with the file.
18. The system according to any one of claims 11 to 17, wherein: The directory tree deletion attribute specifies the foreground deletion of the directory and the file in the directory tree; as well as Performing the file system operation includes executing a foreground thread based on the foreground deletion specified in the directory tree deletion attribute to delete the directory and the file from the directory tree in the storage device.
19. The system according to any one of claims 11 to 17, wherein: The directory tree deletion attribute specifies the delayed deletion of the directories and files in the directory tree; as well as Performing the file system operations includes: Execute a foreground thread to remove the name of the directory tree from the namespace; as well as Based on the delayed deletion specified in the directory tree deletion attribute, a background thread is executed to delete the directory and the file in the directory tree from the storage device.
20. A computer-readable storage medium (804), (812), wherein the computer-readable storage medium stores instructions, which, when executed by a processing system (802), cause a file system (102) to perform operations, including: Receive (702) a request from application (108) to perform a file system operation (112) to delete directories and files in directory tree (110), wherein the request includes: The identifier (116) associated with the directory tree; The directory tree deletion attribute (118) specifies that the file system operation will be performed independently of communication with the upper-level software (138) of the operating system; and A token (120) indicating the identity of the application and the identity of the user who initiated the request through the application, the token being used to determine whether the application is authorized to delete the directory and the file in the directory tree; A security check (704) (128) is performed by processing the token and the access control information (126) associated with the file in the directory tree; Based on the security check, it is determined (706) that the application and the user are authorized to delete the directory and the file in the directory tree; and In response to determining that the application and the user are authorized to delete the directories and files in the directory tree, independent of communication with the upper-layer software of the operating system, the file system operation of deleting the directories and files in the directory tree from the storage device (106) is performed (708).