An inode processing method, device, equipment and storage medium
By migrating the index nodes from the metadata information table to the reverse lookup table, the problem of low file access efficiency in hard link scenarios is solved, and more efficient file access is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- CHINA ELECTRONICS CLOUD DIGITAL INTELLIGENCE TECH CO LTD
- Filing Date
- 2023-07-31
- Publication Date
- 2026-04-14
AI Technical Summary
In hard link scenarios, the directory entry corresponding to the file is stored together with the inode, resulting in low file access efficiency.
The index nodes corresponding to the index node identification information in the file's metadata information table are migrated to the reverse lookup table. The index nodes in the reverse lookup table are used to respond to file access requests.
It improves file access efficiency by directly retrieving the inode from the reverse lookup table to access the file, thus increasing the speed of file access.
Smart Images

Figure CN117194328B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of data processing, and in particular to a method, apparatus, device, and storage medium for processing index nodes. Background Technology
[0002] A hard link, also known as a link, refers to one or more filenames of a file, that is, creating one or more access paths for the file.
[0003] Typically, to access a file, you first need to obtain the inode number (i.e., inode identification information) in the directory entry corresponding to the file, then obtain the corresponding inode based on the inode number, and finally access the file based on the file storage location information stored in the inode.
[0004] However, in hard link scenarios, the directory entry corresponding to the file is stored together with the inode, which is not conducive to the retrieval of the inode, and thus affects file access, resulting in low file access efficiency. Therefore, how to improve file access efficiency has become a technical problem that urgently needs to be solved. Summary of the Invention
[0005] To address the aforementioned technical problems, this disclosure provides a method for processing index nodes.
[0006] Firstly, this disclosure provides a method for processing index nodes, the method comprising:
[0007] In response to a preset hard link creation request for a first file, a hard link is created for the first file, and the index node identification information of the first file is obtained from the metadata information table of the first file; wherein, the hard link includes the access path of the first file, the metadata information table stores the metadata of the first file, the metadata of the first file includes the index node identification information of the first file and the index node corresponding to the index node identification information, the index node carries the attribute information of the first file, and the attribute information of the first file includes the storage location information of the first file.
[0008] The index node corresponding to the index node identification information in the metadata information table of the first file is migrated to the reverse lookup table; wherein, the index node in the reverse lookup table is used to respond to file access requests for the first file.
[0009] In an optional implementation, before migrating the index node corresponding to the index node identifier information in the metadata information table of the first file to the reverse lookup table, the method further includes:
[0010] Determine whether the index node corresponding to the index node identification information is stored in the metadata information table of the first file;
[0011] Accordingly, migrating the index node corresponding to the index node identifier information in the metadata information table of the first file to the reverse lookup table includes:
[0012] If it is determined that the index node corresponding to the index node identification information is stored in the metadata information table of the first file, then the index node corresponding to the index node identification information in the metadata information table of the first file is migrated to the reverse lookup table.
[0013] In an optional implementation, after migrating the index node corresponding to the index node identifier information in the metadata information table of the first file to the reverse lookup table, the method further includes:
[0014] In response to a file access request for the first file, the index node corresponding to the index node identification information in the file access request for the first file is determined from the reverse lookup table;
[0015] Access the first file based on the storage location information of the first file carried in the index node.
[0016] In an optional implementation, after migrating the index node corresponding to the index node identifier information in the metadata information table of the first file to the reverse lookup table, the method further includes:
[0017] In response to the initial hard link deletion request for the first file, the initial hard link of the first file is deleted from the metadata information table of the first file; wherein, the initial hard link of the first file is used to represent the hard link corresponding to the first file when it was created.
[0018] In an optional implementation, after migrating the index node corresponding to the index node identifier information in the metadata information table of the first file to the reverse lookup table, the method further includes:
[0019] In response to the hard link deletion request for the first file, the hard link of the first file is deleted from the metadata information table of the first file;
[0020] If it is determined that the number of hard links to the first file in the reverse lookup table is 1, then the index node corresponding to the index node identification information of the first file in the reverse lookup table is migrated to the metadata information table of the first file.
[0021] In an optional implementation, after migrating the index node corresponding to the index node identifier information in the metadata information table of the first file to the reverse lookup table, the method further includes:
[0022] In response to the hard link deletion request for the first file, the hard link of the first file is deleted from the metadata information table of the first file;
[0023] In response to a file access request for the first file, if it is determined that the number of hard links to the first file in the reverse lookup table is 1, then the index node corresponding to the index node identification information of the first file in the reverse lookup table is migrated to the metadata information table of the first file.
[0024] In one optional implementation, after creating a hard link for the first file, the method further includes:
[0025] Update the number of hard links to the first file in the reverse lookup table.
[0026] Secondly, this disclosure provides an index node processing apparatus, the apparatus comprising:
[0027] A creation module is configured to respond to a preset hard link creation request for a first file, create a hard link for the first file, and obtain the index node identification information of the first file from the metadata information table of the first file; wherein, the hard link includes the access path of the first file, the metadata information table stores the metadata of the first file, the metadata of the first file includes the index node identification information of the first file and the index node corresponding to the index node identification information, the index node carries the attribute information of the first file, and the attribute information of the first file includes the storage location information of the first file.
[0028] The first migration module is used to migrate the index node corresponding to the index node identification information in the metadata information table of the first file to the reverse lookup table; wherein the index node in the reverse lookup table is used to respond to file access requests for the first file.
[0029] Thirdly, this disclosure provides a computer-readable storage medium storing instructions that, when executed on a terminal device, cause the terminal device to perform the above-described method.
[0030] Fourthly, this disclosure provides a processing device for an index node, including: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the above-described method.
[0031] Fifthly, this disclosure provides a computer program product comprising a computer program / instruction that, when executed by a processor, implements the method described above.
[0032] The technical solution provided in this disclosure has at least the following advantages compared with the prior art:
[0033] This disclosure provides a method for processing index nodes. In response to a preset hard link creation request for a first file, a hard link is created for the first file, and index node identification information of the first file is obtained from the first file's metadata information table. The hard link includes the access path of the first file. The metadata information table stores the metadata of the first file, including the index node identification information and the corresponding index node. The index node carries attribute information of the first file, including its storage location information. The index node corresponding to the index node identification information in the first file's metadata information table is migrated to a reverse lookup table. The index node in the reverse lookup table is used to respond to file access requests for the first file. Therefore, by migrating the index node corresponding to the index node identification information in the first file's metadata information table to a reverse lookup table, this disclosure allows direct access to the first file based on the storage location information carried by the index node when a file access request for the first file is received. This improves file access efficiency. Attached Figure Description
[0034] The accompanying drawings, which are incorporated in and form a part of this specification, illustrate embodiments consistent with this disclosure and, together with the description, serve to explain the principles of this disclosure.
[0035] To more clearly illustrate the technical solutions in the embodiments of this disclosure or the prior art, the accompanying drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, those skilled in the art can obtain other drawings based on these drawings without creative effort.
[0036] Figure 1 A flowchart illustrating an index node processing method provided in this embodiment of the disclosure;
[0037] Figure 2 A schematic diagram of a directory structure provided in an embodiment of this disclosure;
[0038] Figure 3 A schematic diagram of the structure of an index node processing device provided in an embodiment of this disclosure;
[0039] Figure 4 This is a schematic diagram of the structure of an index node processing device provided in an embodiment of the present disclosure. Detailed Implementation
[0040] To better understand the above-mentioned objectives, features, and advantages of this disclosure, the solutions disclosed herein will be further described below. It should be noted that, unless otherwise specified, the embodiments and features described herein can be combined with each other.
[0041] Numerous specific details are set forth in the following description in order to provide a full understanding of this disclosure, but this disclosure may also be implemented in other ways different from those described herein; obviously, the embodiments in the specification are only some, and not all, of the embodiments of this disclosure.
[0042] To improve file access efficiency, this disclosure provides a method for processing index nodes.
[0043] Specifically, in response to a preset hard link creation request for the first file, a hard link is created for the first file, and the index node identification information of the first file is obtained from the metadata information table of the first file. The hard link includes the access path of the first file. The metadata information table stores the metadata of the first file, including the index node identification information and the corresponding index node. The index node carries the attribute information of the first file, including its storage location information. The index node corresponding to the index node identification information in the metadata information table of the first file is migrated to a reverse lookup table. The index node in the reverse lookup table is used to respond to file access requests for the first file. Therefore, by migrating the index node corresponding to the index node identification information in the metadata information table of the first file to a reverse lookup table, this embodiment of the present disclosure enables direct access to the first file based on the storage location information of the first file carried by the index node when a file access request for the first file is received. This improves file access efficiency.
[0044] Based on this, embodiments of this disclosure provide a method for processing index nodes, referring to... Figure 1 The flowchart below illustrates a method for processing index nodes according to an embodiment of this disclosure. The method includes:
[0045] S101: In response to a preset hard link creation request for the first file, create a hard link for the first file and obtain the inode identifier information of the first file from the metadata information table of the first file.
[0046] The hard link includes the access path of the first file. The metadata information table stores the metadata of the first file. The metadata of the first file includes the inode identifier information of the first file and the inode corresponding to the inode identifier information. The inode carries the attribute information of the first file, including the storage location information of the first file.
[0047] In this embodiment of the disclosure, the first file can be any file in the file system. Accordingly, the preset hard link creation request can be a hard link creation request for the first file when the number of hard links to the first file is 1.
[0048] In this embodiment of the disclosure, after receiving a preset hard link creation request for the first file, the preset hard link creation request is parsed to obtain the inode identifier information of the first file, and then a hard link is created for the first file based on the inode identifier information, that is, different access paths are created for the first file based on the inode identifier information.
[0049] Specifically, the inode identification information is used to identify the first file. For example, the inode identification information of the first file can be the inode number corresponding to the first file, and the inode number is stored in the directory entry.
[0050] refer to Figure 2 This is a schematic diagram of a directory structure provided in an embodiment of the present disclosure. In this directory structure, each subdirectory or file is stored as a directory entry, and the directory entry stores an inode number, such as... Figure 2 As shown, taking file 2 as the first file as an example, the inode number = 4095...130 can be used as the inode identification information of the first file.
[0051] For ease of understanding, let's continue using the inode identifier information stored in the directory entry as an example. For instance, we can refer to Table 1, which provides a file metadata information table:
[0052] file name Directory Items index node Document 1 Directory item 1 (index node number = 4095...129) Index node 1 Document 2 Directory item 2 (index node number = 4095...130) Index node 2
[0053] Table 1
[0054] Continuing with file 2 as the first file as an example, as shown in Table 1, Table 1 stores the inode identification information (i.e., inode number = 4095...130) of the first file (i.e., file 2) and the inode corresponding to the inode identification information (i.e., inode 2).
[0055] Upon receiving a pre-defined hard link creation request for the first file (i.e., file 2), and after creating the hard link for the first file (i.e., file 2), the metadata information table of another file provided in Table 2 can be used as an example:
[0056] file name Directory Items index node Document 1 Directory item 1 (index node number = 4095...129) Index node 1 Document 2 Directory item 2 (index node number = 4095...130) Index node 2 Document 2.1 Directory item 2.1 (Inode number = 4095...130)
[0057] Table 2
[0058] As shown in Table 2, file 2.1 is the hard link file corresponding to the first file (i.e., file 2) after a hard link is created. The inode identification information (i.e., inode number = 4095...130) of this hard link file is the same as that of the first file (i.e., file 2).
[0059] It should be noted that Tables 1 and 2 are merely examples of metadata information tables for files and should not be considered as limitations.
[0060] In addition, after creating a hard link for the first file, the number of hard links for the first file in the reverse lookup table can be updated. For example, a reverse lookup table provided in Table 4 can be used as an example. As shown in Table 4 below, after creating a hard link for the first file (i.e., file 2), the number of hard links corresponding to the inode identifier information (i.e., inode number 4095...130) of the first file (i.e. file 2) in the reverse lookup table is updated to 2.
[0061] S102: Move the index node corresponding to the index node identifier information in the metadata information table of the first file to the reverse lookup table.
[0062] In the reverse lookup table, the index node is used to respond to file access requests for the first file.
[0063] In this embodiment of the disclosure, after obtaining the index node identification information of the first file from the metadata information table of the first file, the corresponding index node is determined from the metadata information table of the first file based on the index node identification information, and then the index node is migrated to the reverse lookup table. This allows the index node to be directly obtained from the reverse lookup table when a file access request for the first file is received, thereby accessing the first file based on the storage location information of the first file carried by the index node, thus improving the file access efficiency.
[0064] Continuing with file 2 as the first file as an example, after creating a hard link for the first file (i.e., file 2), the inode identifier information (i.e., inode number = 4095...130) of the first file (i.e., file 2) is obtained from the metadata information table of the first file. Then, the inode corresponding to the inode identifier information (i.e., inode number = 4095...130) (i.e., inode 2) is migrated to the reverse lookup table. For example, you can refer to the metadata information table of another type of file provided in Table 3:
[0065] file name Directory Items index node Document 1 Directory item 1 (index node number = 4095...129) Index node 1 Document 2 Directory item 2 (index node number = 4095...130) Document 2.1 Directory item 2.1 (Inode number = 4095...130)
[0066] Table 3
[0067] As shown in Table 3, the index node (i.e., index node 2) corresponding to the index node identifier information (i.e., index node number = 4095...130) has been migrated to the reverse lookup table (as shown in Table 4), and the number of hard links corresponding to the index node identifier information (i.e., index node number 4095...130) in the reverse lookup table has been updated to 2.
[0068] Inode Identifier Information Number of hard links index node Inode number = 4095...129 1 / Inode number = 4095...130 2 Index node 2
[0069] Table 4
[0070] It should be noted that Table 3 is only an example of a file metadata information table, and Table 4 is only an example of a reverse lookup table, and should not be regarded as a limitation.
[0071] In addition, to improve the migration efficiency of index nodes, before migrating the index node corresponding to the index node identifier information in the metadata information table of the first file to the reverse lookup table, in one optional implementation, it is first determined whether the index node corresponding to the index node identifier information is stored in the metadata information table of the first file. If it is determined that the index node corresponding to the index node identifier information is stored in the metadata information table of the first file, then the index node corresponding to the index node identifier information in the metadata information table of the first file is migrated to the reverse lookup table.
[0072] Furthermore, after migrating the index node corresponding to the index node identification information in the metadata information table of the first file to the reverse lookup table, the first file can still be accessed in response to a file access request for the first file. To this end, in one optional implementation, in response to a file access request for the first file, the index node corresponding to the index node identification information in the file access request for the first file is determined from the reverse lookup table, and the first file is accessed based on the storage location information of the first file carried in the index node.
[0073] In this embodiment of the present disclosure, after receiving a file access request for a first file, the file access request is parsed to obtain the inode identifier information carried in the file access request for the first file. Then, based on the inode identifier information, the inode corresponding to the inode identifier information is determined from the reverse lookup table, thereby accessing the first file based on the storage location information of the first file carried in the inode.
[0074] After migrating the inode corresponding to the inode identifier information in the metadata information table of the first file to the reverse lookup table, the initial hard link of the first file can also be directly deleted. Therefore, in one optional implementation, in response to a request to delete the initial hard link of the first file, the initial hard link of the first file is deleted from the metadata information table of the first file.
[0075] The initial hard links in the first file are used to represent the hard links corresponding to the creation of the first file.
[0076] In this embodiment of the disclosure, after receiving an initial hard link deletion request for the first file, the initial hard link deletion request is parsed to obtain the initial hard link identifier information of the first file carried in the initial hard link deletion request. Then, based on the initial hard link identifier information, the initial hard link of the first file is directly deleted from the metadata information table of the first file.
[0077] As can be seen, in this embodiment of the present disclosure, since the index node corresponding to the index node identification information in the metadata information table of the first file has been migrated to the reverse lookup table before the initial hard link deletion request for the first file is received, the initial hard link of the first file in the metadata information table can be deleted directly when the initial hard link of the first file is deleted.
[0078] To optimize the access performance of the first file, after migrating the index node corresponding to the index node identifier information in the metadata information table of the first file to the reverse lookup table, the index node corresponding to the index node identifier information in the reverse lookup table can be migrated back to the metadata information table of the first file when the number of hard links to the first file in the reverse lookup table is 1. Therefore, in one optional implementation, in response to a hard link deletion request for the first file, the hard links to the first file are deleted from the metadata information table of the first file. If it is determined that the number of hard links to the first file in the reverse lookup table is 1, then the index node corresponding to the index node identifier information in the reverse lookup table is migrated to the metadata information table of the first file.
[0079] In this embodiment of the disclosure, upon receiving a hard link deletion request for the first file, the hard link deletion request is parsed to obtain the hard link identifier information of the first file carried in the initial hard link deletion request. Then, based on the hard link identifier information, the hard link of the first file is deleted from the metadata information table of the first file, and the number of hard links of the first file in the reverse lookup table is updated. It is then determined whether the number of hard links of the first file in the reverse lookup table is 1. If it is determined that the number of hard links of the first file in the reverse lookup table is 1, the index node corresponding to the index node identifier information of the first file in the reverse lookup table can be migrated to the metadata information table of the first file. This allows the index node corresponding to the index node identifier information in the file access request for the first file to be determined from the metadata information table after receiving a file access request for the first file, and the first file to be accessed based on the storage location information of the first file carried in the index node.
[0080] In another optional implementation, in response to a hard link deletion request for the first file, the hard links of the first file are deleted from the metadata information table of the first file. In response to a file access request for the first file, if it is determined that the number of hard links of the first file in the reverse lookup table is 1, the index node corresponding to the index node identification information of the first file in the reverse lookup table is migrated to the metadata information table of the first file.
[0081] In this embodiment of the disclosure, after deleting the hard links of the first file from the metadata information table of the first file, when a file access request for the first file is received, it is determined whether the number of hard links of the first file in the reverse lookup table is 1. If it is determined that the number of hard links of the first file in the reverse lookup table is 1, then the index node corresponding to the index node identification information of the first file in the reverse lookup table is migrated to the metadata information table of the first file.
[0082] In the index node processing method provided in this embodiment, in response to a preset hard link creation request for a first file, a hard link is created for the first file, and the index node identification information of the first file is obtained from the metadata information table of the first file. The hard link includes the access path of the first file, and the metadata information table stores the metadata of the first file. The metadata of the first file includes the index node identification information of the first file and the index node corresponding to the index node identification information. The index node carries the attribute information of the first file, including the storage location information of the first file. The index node corresponding to the index node identification information in the metadata information table of the first file is migrated to a reverse lookup table. The index node in the reverse lookup table is used to respond to file access requests for the first file. Therefore, by migrating the index node corresponding to the index node identification information in the metadata information table of the first file to a reverse lookup table, this embodiment of the present disclosure enables direct access to the first file based on the storage location information of the first file carried by the index node when a file access request for the first file is received. This improves file access efficiency.
[0083] Based on the above method embodiments, this disclosure also provides an index node processing apparatus, with reference to... Figure 3 This is a schematic diagram of the structure of an index node processing device provided in an embodiment of the present disclosure. The device includes:
[0084] The creation module 301 is configured to respond to a preset hard link creation request for the first file, create a hard link for the first file, and obtain the index node identification information of the first file from the metadata information table of the first file; wherein, the hard link includes the access path of the first file, the metadata information table stores the metadata of the first file, the metadata of the first file includes the index node identification information of the first file and the index node corresponding to the index node identification information, the index node carries the attribute information of the first file, and the attribute information of the first file includes the storage location information of the first file.
[0085] The first migration module 302 is used to migrate the index node corresponding to the index node identification information in the metadata information table of the first file to the reverse lookup table; wherein the index node in the reverse lookup table is used to respond to file access requests for the first file.
[0086] In one optional embodiment, the apparatus further includes:
[0087] The first determining module is used to determine whether the index node corresponding to the index node identification information is stored in the metadata information table of the first file;
[0088] Accordingly, the first migration module 302 is specifically used for:
[0089] If it is determined that the index node corresponding to the index node identification information is stored in the metadata information table of the first file, then the index node corresponding to the index node identification information in the metadata information table of the first file is migrated to the reverse lookup table.
[0090] In one optional embodiment, the apparatus further includes:
[0091] The second determining module is used to determine, in response to a file access request for the first file, the index node corresponding to the index node identification information in the file access request for the first file from the reverse lookup table;
[0092] The access module is used to access the first file based on the storage location information of the first file carried in the index node.
[0093] In one optional embodiment, the apparatus further includes:
[0094] The first deletion module is configured to delete the initial hard link of the first file from the metadata information table of the first file in response to the initial hard link deletion request for the first file; wherein the initial hard link of the first file is used to represent the hard link corresponding to the first file when it was created.
[0095] In one optional embodiment, the apparatus further includes:
[0096] The second deletion module is used to delete the hard links of the first file from the metadata information table of the first file in response to a hard link deletion request for the first file.
[0097] The second migration module is used to migrate the index node corresponding to the index node identification information of the first file in the reverse lookup table to the metadata information table of the first file when the number of hard links of the first file in the reverse lookup table is 1.
[0098] In one optional embodiment, the apparatus further includes:
[0099] The third deletion module is used to delete the hard links of the first file from the metadata information table of the first file in response to the hard link deletion request for the first file.
[0100] The third migration module is used to respond to a file access request for the first file. If it is determined that the number of hard links to the first file in the reverse lookup table is 1, then the index node corresponding to the index node identification information of the first file in the reverse lookup table is migrated to the metadata information table of the first file.
[0101] In one optional embodiment, the device further includes:
[0102] The update module is used to update the number of hard links to the first file in the reverse lookup table.
[0103] In the index node processing apparatus provided in this embodiment, in response to a preset hard link creation request for a first file, a hard link is created for the first file, and the index node identification information of the first file is obtained from the metadata information table of the first file. The hard link includes the access path of the first file, and the metadata information table stores the metadata of the first file. The metadata of the first file includes the index node identification information of the first file and the index node corresponding to the index node identification information. The index node carries the attribute information of the first file, including the storage location information of the first file. The index node corresponding to the index node identification information in the metadata information table of the first file is migrated to a reverse lookup table. The index node in the reverse lookup table is used to respond to file access requests for the first file. Therefore, by migrating the index node corresponding to the index node identification information in the metadata information table of the first file to a reverse lookup table, this embodiment of the present disclosure enables direct access to the first file based on the storage location information of the first file carried by the index node when a file access request for the first file is received, thereby improving file access efficiency.
[0104] In addition to the methods and apparatus described above, embodiments of this disclosure also provide a computer-readable storage medium storing instructions that, when executed on a terminal device, cause the terminal device to implement the index node processing method described in embodiments of this disclosure.
[0105] This disclosure also provides a computer program product, which includes a computer program / instruction that, when executed by a processor, implements the index node processing method described in this disclosure.
[0106] In addition, this disclosure also provides an inode processing device, see [link to relevant documentation]. Figure 4 As shown, it may include:
[0107] The inode processing device includes a processor 401, a memory 402, an input device 403, and an output device 404. The number of processors 401 in the inode processing device can be one or more. Figure 4 Taking a processor as an example. In some embodiments of this disclosure, the processor 401, memory 402, input device 403, and output device 404 can be connected via a bus or other means, wherein, Figure 4 Taking the example of a connection between China and Israel via a bus.
[0108] The memory 402 can be used to store software programs and modules. The processor 401 executes various functional applications and data processing of the inode processing device by running the software programs and modules stored in the memory 402. The memory 402 may mainly include a program storage area and a data storage area. The program storage area may store the operating system, at least one application program required for a function, etc. In addition, the memory 402 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other volatile solid-state storage device. The input device 403 can be used to receive input digital or character information, and generate signal inputs related to user settings and function control of the inode processing device.
[0109] Specifically in this embodiment, the processor 401 will load the executable files corresponding to the processes of one or more applications into the memory 402 according to the following instructions, and the processor 401 will run the applications stored in the memory 402, thereby realizing the various functions of the processing device of the above-mentioned inode.
[0110] It should be noted that, in this document, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0111] The above description is merely a specific embodiment of this disclosure, enabling those skilled in the art to understand or implement it. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this disclosure. Therefore, this disclosure is not to be limited to the embodiments described herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A method for processing index nodes, characterized in that, The method includes: In response to a preset hard link creation request for a first file, a hard link is created for the first file, and the index node identification information of the first file is obtained from the metadata information table of the first file; wherein, the hard link includes the access path of the first file, the metadata information table stores the metadata of the first file, the metadata of the first file includes the index node identification information of the first file and the index node corresponding to the index node identification information, the index node carries the attribute information of the first file, and the attribute information of the first file includes the storage location information of the first file. The index node corresponding to the index node identification information in the metadata information table of the first file is migrated to the reverse lookup table; wherein, the index node in the reverse lookup table is used to respond to the file access request for the first file to access the first file based on the storage location information of the first file carried by it; If it is determined that the number of hard links to the first file in the reverse lookup table is 1, then the index node corresponding to the index node identification information of the first file in the reverse lookup table is migrated to the metadata information table of the first file.
2. The method according to claim 1, characterized in that, Before migrating the index node corresponding to the index node identifier information in the metadata information table of the first file to the reverse lookup table, the method further includes: Determine whether the index node corresponding to the index node identification information is stored in the metadata information table of the first file; Accordingly, migrating the index node corresponding to the index node identifier information in the metadata information table of the first file to the reverse lookup table includes: If it is determined that the index node corresponding to the index node identification information is stored in the metadata information table of the first file, then the index node corresponding to the index node identification information in the metadata information table of the first file is migrated to the reverse lookup table.
3. The method according to claim 1, characterized in that, After migrating the index node corresponding to the index node identifier information in the metadata information table of the first file to the reverse lookup table, the method further includes: In response to a file access request for the first file, the index node corresponding to the index node identification information in the file access request for the first file is determined from the reverse lookup table; Access the first file based on the storage location information of the first file carried in the index node.
4. The method according to claim 1, characterized in that, After migrating the index node corresponding to the index node identifier information in the metadata information table of the first file to the reverse lookup table, the method further includes: In response to the initial hard link deletion request for the first file, the initial hard link of the first file is deleted from the metadata information table of the first file; wherein, the initial hard link of the first file is used to represent the hard link corresponding to the first file when it was created.
5. The method according to claim 1, characterized in that, After migrating the index node corresponding to the index node identifier information in the metadata information table of the first file to the reverse lookup table, the method further includes: In response to the hard link deletion request for the first file, the hard link of the first file is deleted from the metadata information table of the first file; If it is determined that the number of hard links to the first file in the reverse lookup table is 1, then the index node corresponding to the index node identification information of the first file in the reverse lookup table is migrated to the metadata information table of the first file.
6. The method according to claim 1, characterized in that, After migrating the index node corresponding to the index node identifier information in the metadata information table of the first file to the reverse lookup table, the method further includes: In response to the hard link deletion request for the first file, the hard link of the first file is deleted from the metadata information table of the first file; In response to a file access request for the first file, if it is determined that the number of hard links to the first file in the reverse lookup table is 1, then the index node corresponding to the index node identification information of the first file in the reverse lookup table is migrated to the metadata information table of the first file.
7. The method according to claim 1, characterized in that, After creating a hard link for the first file, the process further includes: Update the number of hard links to the first file in the reverse lookup table.
8. A processing apparatus for index nodes, characterized in that, The device includes: A creation module is configured to respond to a preset hard link creation request for a first file, create a hard link for the first file, and obtain the index node identification information of the first file from the metadata information table of the first file; wherein, the hard link includes the access path of the first file, the metadata information table stores the metadata of the first file, the metadata of the first file includes the index node identification information of the first file and the index node corresponding to the index node identification information, the index node carries the attribute information of the first file, and the attribute information of the first file includes the storage location information of the first file. The first migration module is used to migrate the index node corresponding to the index node identification information in the metadata information table of the first file to the reverse lookup table; wherein, the index node in the reverse lookup table is used to respond to the file access request for the first file to access the first file based on the storage location information of the first file carried by it; The second migration module is used to migrate the index node corresponding to the index node identifier information of the first file in the reverse lookup table to the metadata information table of the first file when the number of hard links of the first file in the reverse lookup table is 1.
9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores instructions that, when executed on a terminal device, cause the terminal device to perform the method as described in any one of claims 1-7.
10. A processing device for index nodes, characterized in that, include: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor, when executing the computer program, implements the method as described in any one of claims 1-7.
Citation Information
Patent Citations
Satellite cloud-oriented distributed file system
CN116401225A