WO2016206070A1 - Procédé de mise à jour de fichier et dispositif de mémorisation - Google Patents

Procédé de mise à jour de fichier et dispositif de mémorisation Download PDF

Info

Publication number
WO2016206070A1
WO2016206070A1 PCT/CN2015/082442 CN2015082442W WO2016206070A1 WO 2016206070 A1 WO2016206070 A1 WO 2016206070A1 CN 2015082442 W CN2015082442 W CN 2015082442W WO 2016206070 A1 WO2016206070 A1 WO 2016206070A1
Authority
WO
WIPO (PCT)
Prior art keywords
file
data
update
read
block number
Prior art date
Application number
PCT/CN2015/082442
Other languages
English (en)
Chinese (zh)
Inventor
罗彩珠
陈克平
文刘飞
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Priority to PCT/CN2015/082442 priority Critical patent/WO2016206070A1/fr
Priority to CN201580001153.0A priority patent/CN107430546B/zh
Publication of WO2016206070A1 publication Critical patent/WO2016206070A1/fr

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation

Definitions

  • the present invention relates to the field of file systems, and in particular, to a file update method and a storage device.
  • each file contains file metadata and actual data.
  • the file metadata includes file permissions (rxw) in Linux, file attributes (owner, group, time parameters, etc.) and save files. Data storage location.
  • the file system usually stores the two pieces of data in different blocks, the permissions and attributes are placed in the index node, and the actual data is placed in the data block.
  • the index node records the attributes of the file.
  • a file occupies an index node and records the location of the data block where the data of the file is located.
  • each index node and data block are numbered, and each file occupies an index node, the index node has a pointer to a logical block number of a data block for storing file data. Therefore, if the index node of the file can be found, then the logical block number of the data block storing the data can naturally be known, and the actual data of the file at the physical address can be read by the logical block number.
  • the invention provides a file updating method, which can reduce the modification of the metadata when updating the file data of the file system, and has a simple method and can improve the update efficiency of the file data.
  • a first aspect of the embodiments of the present invention provides a file update method, which may include:
  • Receiving a file update request where the file update request carries a file identifier of the first file, a first file offset, and second data, where the second data is used to update the first data in the first file; Allocating an idle data block to the second data according to a size of the second data;
  • the method may further include:
  • Reading the data to be read according to the physical address of the data to be read.
  • the method further includes:
  • the update flag bit in the index node of the first file is set to have an update, and the update flag bit is used to determine an update status of the first file.
  • the method further includes:
  • the method further includes:
  • the update flag bit is used to determine an update status of the second file.
  • the second aspect of the embodiment of the present invention further provides an apparatus, which may include:
  • a receiving module configured to receive a file update request, where the file update request carries a file identifier of the first file, a first file offset, and second data, where the second data is used to update the first file First data;
  • An allocating module configured to allocate an idle data block to the second data according to the size of the second data
  • a writing module configured to write the second data into the allocated data block
  • a determining module configured to determine, according to the first file offset, a file block number of the first data, where the file block number is used to identify a logical location of the first data
  • a recording module configured to record, in a file update table pointed by the first pointer in the index node of the first file, a file block number of the first data and a logical block number of a data block storing the second data Corresponding relationship, the logical block number is used to point to a physical address storing the second data;
  • the state setting module sets the state of the first data to be invalid in a file state table pointed by the second pointer in the index node.
  • the receiving module is further configured to receive a file read request, where the file read request carries a file identifier of the second file and a second file offset;
  • the determining module is further configured to determine an index node of the second file according to the file identifier of the second file;
  • the storage device may further include:
  • a searching module configured to determine, according to a file update table pointed by the first pointer in the index node of the second file, a logical block number corresponding to a file block number of the data to be read;
  • a reading module configured to determine a physical address of the data to be read according to a logical block number corresponding to the file block number of the data to be read, and read the data to be read according to the physical address of the data to be read .
  • the status setting module is further configured to set an update flag bit in the index node of the first file to be updated, and the update flag bit is used to determine an update status of the first file.
  • the determining module is further configured to:
  • the update flag bit is used to determine an update status of the second file.
  • the third aspect of the embodiment of the present invention further provides a storage device, where the file system is established, and the storage device may include:
  • a memory for storing file data
  • a controller configured to receive a file update request, where the file update request carries a file identifier of the first file, a first file offset, and second data, where the second data is used for updating The first data in the file;
  • the controller is also used to:
  • Reading the data to be read according to the physical address of the data to be read.
  • the controller is further configured to:
  • the update flag bit in the index node of the first file is set to have an update, and the update flag bit is used to determine an update status of the first file.
  • the controller is further configured to:
  • Determining the second according to an update flag bit in an index node of the second file before determining a state of the data to be read according to a file state table pointed to by a second pointer in the index node of the second file The file has an update, and the update flag is used to determine an update status of the second file.
  • the embodiment of the present invention has the following advantages: the embodiment of the present invention has a first update pointer and a second pointer to the two tables in the index node because the file update table and the file state table are set.
  • the update table stores the correspondence between the file block number of the file and the logical block number.
  • the second data is first stored in the allocated free data block to determine the file block number of the first data, and then Determining an index node according to the first file, determining a file update table and a file status table, and then recording, in the file update table, a correspondence between a file block number of the first data and a logical block number of the data block storing the second data, It is possible to correspond to the new logical block number by the file block number, and After the status of the first data is set to invalid in the file status table, the data update operation can be completed.
  • the metadata modification can be reduced when the file data of the file system is updated, and the copying and disk fragmentation of the data block can be reduced. And the method is simple, and the update efficiency of the file data can be improved.
  • FIG. 1 is a schematic diagram of a storage system to which a file update method in an embodiment of the present invention is applied;
  • FIG. 2 is a diagram showing a file system update state of a conventional copy-on-write technique
  • FIG. 3 is a diagram of an embodiment of a file update method according to an embodiment of the present invention.
  • FIG. 4 is a diagram showing another embodiment of a file updating method according to an embodiment of the present invention.
  • FIG. 5 is a diagram of another embodiment of a file update method according to an embodiment of the present invention.
  • FIG. 6 is a diagram of an embodiment of a storage device according to an embodiment of the present invention.
  • FIG. 7 is a diagram of another embodiment of a storage device according to an embodiment of the present invention.
  • FIG. 8 is a schematic structural diagram of a storage device according to an embodiment of the present invention.
  • Figure 9 is a diagram showing another embodiment of a storage device in an embodiment of the present invention.
  • the embodiment of the invention provides a file updating method and a storage device, which are used to solve the problem that the metadata modified by the existing COW file system is more complicated and complicated, which leads to low efficiency and excessive disk fragmentation. The problem.
  • FIG. 2 is a schematic structural diagram of a storage system according to an embodiment of the present invention.
  • the storage system is connected to a server 101 through a channel switch 102.
  • the storage system includes at least one storage device 103.
  • the channel switch 102 Each of the at least one storage device 103 is connected to the storage device 103.
  • the file system module 1011 for managing the storage device is further disposed in the server 101.
  • the system controls the storage device 103 through the file system module 1011 in the server 101 in cooperation with the channel switch 102, such as the file system module 1011 reading data from the storage device 103 through the Fibre Channel switch 102 or to the storage device.
  • 103 stores data.
  • the channel switch 102 can be a Fibre Channel switch or other channel switch capable of supporting a larger bandwidth, as long as there is sufficient bandwidth between the server 101 and the storage device 103 to transmit data.
  • the embodiment of the present invention can also be applied to DAS Direct-Attached Storage, SAN Storage Area Network, and network connection.
  • the application scenario of the embodiment of the present invention is not limited herein.
  • FIG. 2 is a file system update state diagram of a conventional copy-on-write technology.
  • point A is a file system tree.
  • Root node, C node and E node are indexes pointing to the data block where the data in the file is located Node, when it is necessary to update the data block pointed to by the C node, the update data is written into the free new data block, and a new index node C' node is generated, and the C' node points to the new data block.
  • the number of the B nodes may be more than one, such as having a B node and a D node at the same time, and the B node and the D node are at the same level.
  • the B node points to the C node and the E node at the same time, and the D node points to the F node.
  • the F node and the C node and the E node are both the index nodes pointing to the data block where the data in the file is located.
  • the A node does not directly point to the C node, but first points to the B node, and then the B node points to the C node. Therefore, when updating, it starts from the C node, first establishes the C' node, and then establishes the pointing to the C' node. The B' node, while the B' node points to the E node, and finally establishes the A' node pointing to the B' node, and the A' node points to the D node. Finally, the A node pointed to by the super block is changed to point to the A' node, and the data is completed. Update.
  • each modification of the user data will result in the copying and modification of a batch of related metadata blocks (such as C node, B node and A node).
  • the file system will not update the index node in situ (eg C nodes) and indirect pointers (such as Node B) must be copied and modified in a new location.
  • the file system must force all blocks to be completely written to disk, which results in large delays, inefficiencies in the update operation, and invalid old blocks each time a new block of data needs to be allocated, which can result in a lot of disk fragmentation. .
  • FIG. 3 is a schematic flowchart of a method for updating a file according to an embodiment of the present invention.
  • the method may be executed by the server 101 in the storage system shown in FIG. 1 or by a file system module in a storage device.
  • the file update request carries a file identifier of the first file, a first file offset, and second data, and the second data is used to update the first data in the file.
  • the file system After receiving the file update request, the file system allocates an idle data block for the second data according to the size of the second data to facilitate writing the second data.
  • the second data is written into the allocated data block.
  • the file block number is used to identify the logical location of the first data, the file identifier can be used to determine the update file, and then the file block number of the first data can be obtained by the file offset.
  • the file block number is that the file is divided into several file blocks according to a fixed value of the preset file block size when storing, such as the first file here, and each file block is set to one.
  • the file block number, and the first file offset is a specific value, which is used to determine the file block number corresponding to the first data to be updated, that is, when determining the file block number, only the corresponding first file offset needs to be known.
  • the shift amount can be calculated by the first file offset and the preset fixed value.
  • the logical position corresponds to a specific point on the X axis, which is the starting point of the logical position
  • the file block number corresponds to a segment of the line on the X axis
  • the length of the line segment is The size of the file block
  • the first file offset is a specific point
  • the file block number corresponding to the line segment is determined by judging the line segment in which the point falls.
  • the index node of the first file can be determined according to the file identifier of the first file.
  • a first pointer is set in the index node of the first file, the first pointer points to the file update table, and the first pointer in the index node can be determined according to the index node of the first file, so that the file update table can be determined, and the table is updated.
  • the correspondence between the file block number of the file and the logical block number is stored.
  • the file block number and storage of the first data can be recorded in the file update table.
  • Corresponding relationship of the logical block numbers of the data blocks of the second data so that the logical block numbers corresponding to the second data correspond to the file block numbers corresponding to the first data.
  • a second pointer is disposed in the index node of the first file, the second pointer points to the file state table, and the file state table is determined according to the second pointer, and the file state table stores a state for indicating validity of the data.
  • the status of the first data is set to invalid to indicate that the first data has been updated.
  • the index node since the file update table and the file status table are set, the index node has a first pointer and a second pointer to the two tables, and the update table stores the file block number and the logical block number of the file. Correspondence relationship.
  • the second data is first stored in the allocated free data block, the file block number of the first data is determined, and then the index node is determined according to the first file, and the file update table and the file status table are determined.
  • the correspondence between the file block number of the first data and the logical block number of the data block storing the second data is recorded in the file update table, so that the file block number corresponds to the new logical block number, and then the file status is achieved.
  • the status of the first data is set to be invalid, and the data update operation can be completed.
  • the modification of the metadata can be reduced when the file data of the file system is updated, and the method is simple, and the file data can be improved.
  • the update efficiency and can reduce the copy of the data block and disk fragmentation, and ultimately achieve the purpose of improving the efficiency of the update operation.
  • the update flag bit can be used to quickly identify whether the file corresponding to the index node is updated. It should be noted that the setting mode of the state in the file state table is more important, which directly affects whether the file system can quickly find the state of locating the first data. One of the setting modes is described below, which can improve the efficiency of the first data of the file system. .
  • the file status table in which the status of each data is recorded is arranged in the order of the file block number. Since the file block number is determined when the file is stored, the file block number is not determined. The corresponding logical block number is changed, so that the state of the data can be quickly obtained after the file block number of the data is known, and the state of the data is arranged in the order of the file block number, and the number can be known. According to the file block number, the state of quickly finding the data is beneficial to improve the efficiency of file update. For the first data, the efficiency of the file system setting the state corresponding to the first data can be improved, thereby improving the efficiency of file update. .
  • the state of the data arranged in the order of the file block number is adopted, and when the second data is substituted for the first data and the state needs to be set to be invalid, the file of the first data is first passed.
  • the block number looks up the state of the first data corresponding to the file block number in the file status table, and then sets the state of the first data to be invalid.
  • an update flag bit may also be set in the index node to indicate that the data corresponding to the index node is updated; please refer to FIG. 4, which is another implementation of the file update method in the embodiment of the present invention. As shown in FIG. 4, in addition to the file update method shown in FIG. 3, steps 401 to 407 are similar to steps 301 to 307, and the file update method further includes
  • the update flag is used to determine the update status of the first file.
  • the update flag can be used to quickly identify whether the file corresponding to the index node is updated, although the identifier of the data in the file status table can be known. Whether there is data update, but there are two disadvantages. One is that the file status table needs to be determined by the second pointer in the index node of the first file, and the invalid identifier in the file status table is determined. Therefore, in the manner of the foregoing step 408, it is possible to directly learn from the index node of the first file whether the file corresponding to the index node is updated, and it is not necessary to determine the file state table by using the second pointer, thereby greatly improving the execution efficiency of the file system update. .
  • FIG. 5 is a schematic diagram of another embodiment of a method for updating a file according to an embodiment of the present invention.
  • the method for reading data in the method for updating a file according to an embodiment of the present invention is as shown in FIG. 5 , and the update method in this embodiment may also be used.
  • the update method in this embodiment may also be used.
  • the file read request carries the file identifier of the second file and the second file offset.
  • the file read request is sent to the file system.
  • the index node corresponding to the second file is first determined according to the second file, so as to query the actual storage location of the data to be read according to the index node.
  • the file block number of the data to be read can be determined by the second file offset for subsequent use.
  • the status of the data to be read in the file status table is determined.
  • the subsequent steps are performed.
  • the file update table is determined according to the first pointer of the index node, and then the logical block number corresponding to the file block number of the data to be read is determined by the file update table.
  • the physical address of the actual storage location of the data to be read may be determined according to the correspondence between the logical block number and the physical address.
  • Read data to be read according to a physical address of the data to be read.
  • the data stored in the physical disk can be read from the physical address, and the data reading process is completed.
  • the data to be read is updated data, that is, whether the state of the data to be read is invalid, and determining the file block by using the index node of the second file.
  • a chart and determining a state of the data to be read therein, such as an invalid identifier, indicating that the data corresponding to the state is erroneous data through the existing read, and at this time, the file update table is determined by the index node of the second file, Find the location of the file block number corresponding to the data to be read in the file update table, and then find the updated logical block number of the data to be read, and read the physical disk to be read by the physical address corresponding to the logical block number.
  • Data is taken, and the data is first read when reading by the solution of the embodiment of the present invention. The judgment is made, and then the subsequent reading operation is performed according to the judgment result. Since the data storage location on the index node is not directly read, when the reading is performed, the data reading error does not occur, and the reading table is read by reading.
  • the logic block number reads the manner of the data to be read, further increasing the achievability of the file update method of the embodiment of the present invention.
  • the file update table and the file status table are set, and since the index node has the first pointer and the second pointer pointing to the two tables, when reading the data to be read, for the two types of data to be read, That is, the updated data and the unupdated data are different in reading manner, that is, when determining that the state of the data to be read is invalid and non-invalid, there are two different ways:
  • the data to be read is the updated data
  • the data is read in the manner shown in steps 501 to 507 above. If the data to be read is unupdated data, the third pointer in the index node is pointed. The data block position reads the data to be read.
  • the file system reads the data by searching for the third pointer in the index node corresponding to the data to be read, and reading the data block position pointed by the third pointer. The data to be read.
  • the data block position pointed by the third pointer in the index node can be read and read. data.
  • the update table is first determined by the index node, and then the logical block number corresponding to the file block number of the data to be read is searched from the update table, and then passed.
  • the logical block number reads the data to be read on the physical block corresponding to the logical block number, and the two reading modes can be arbitrarily set to one of them.
  • the data processing method may further include: before determining, according to the file state table pointed by the second pointer in the index node of the second file, the data processing method:
  • the update flag is used to determine an update status of the second file, and when it is determined that there is an update, triggering the second pointer of the index node according to the second file to determine the file status table.
  • this update flag bit is to know whether the data corresponding to the index node is updated only by reading the index node, without first reading the file status table, and then searching the file status table.
  • the data processing method may further include: in step 504, before determining the state of the data to be read according to the file state table pointed by the second pointer in the index node of the second file, the data processing method may further include:
  • the second file is determined to be non-updated according to the update flag bit in the index node of the second file.
  • the data pointer pointing to the actual location of the data in the index node of the second file is directly acquired, and the data to be read on the physical address is read by the pointer.
  • the data pointer when reading the data to be read, if the index node of the second file corresponds to more data, the data pointer can also be used as the intermediate pointer to point to the actual pointer, and then the actual pointer points to the actual data to be read. .
  • the data to be read may also be read in the manner of steps 504 to 507, and the selection may be performed according to the requirement of the read data.
  • FIG. 6 is an embodiment of the storage device in the embodiment of the present invention, and FIG. 6 provides A storage device can include:
  • the receiving module 601 is configured to receive a file update request, where the file update request carries a file identifier of the first file, a first file offset, and second data, where the second data is used to update the first data in the first file;
  • the allocating module 602 is configured to allocate idle data blocks to the second data according to the size of the second data
  • a writing module 603, configured to write the second data into the allocated data block
  • a determining module 604 configured to determine a file block number of the first data according to the first file offset, where the file block number is used to identify a logical position of the first data;
  • a recording module 605 configured to record, in a file update table pointed by the first pointer in the index node of the first file, a correspondence between a file block number of the first data and a logical block number of the data block storing the second data, the logic block The number is used to point to the physical address where the second data is stored;
  • the state setting module 606 sets the state of the first data to be invalid in the file state table pointed to by the second pointer in the index node.
  • the index node since the file update table and the file state table are set, the index node has a first pointer and a second pointer pointing to the two tables, and the update table stores the file with the file. Corresponding relationship between the block number and the logical block number.
  • the second data is first stored in the allocated idle memory by the assigning module 602 through the writing module 603.
  • the file block number of the first data is determined by the determining module 604, and then the index node determines the file update table and the file status table according to the first file, and the first data is recorded in the file update table by the recording module 605.
  • the file status table in which the status of each data is recorded is arranged in the order of the file block number. Since the file block number is determined when the file is stored, the logical block number corresponding to the file block number is not used. The change is changed, so that the state of the data can be quickly obtained after knowing the file block number of the data.
  • By arranging the state of the data in the order of the file block number it is possible to quickly find the state of the data in the case of knowing the file block number of the data, which is advantageous for improving the efficiency of file update.
  • the efficiency of the file system setting the state corresponding to the first data can be improved, thereby improving the efficiency of file update.
  • the state setting module 606 is further configured to set the update flag bit in the index node of the first file to be updated.
  • the update flag is used to determine the update status of the first file.
  • the purpose of the state setting module 606 is to quickly identify whether the file corresponding to the index node is updated by using the update flag, although the status in the file status table can also be used to know whether there is data update, but the disadvantages are Two points, one of which is to determine the file status table through the second pointer in the index node of the first file, and determine the invalid identifier in the file status table. Therefore, the state setting module 606 can directly learn whether the file corresponding to the index node has an update from the index node of the first file, and does not need to determine the file state table by using the second pointer, thereby greatly improving the execution efficiency of the file system update.
  • FIG. 7 is stored in the embodiment of the present invention.
  • FIG. 7 provides a storage device for reading data, wherein
  • the receiving module 701 is further configured to receive a file read request, where the file read request carries a file identifier of the second file and a second file offset;
  • the determining module 704 is further configured to determine an index node of the second file according to the file identifier of the second file; determine a file block number of the data to be read according to the second file offset; and use a second one of the index nodes according to the second file
  • the file status table pointed to by the pointer determines that the status of the data to be read is invalid
  • the storage device also includes:
  • the searching module 707 is configured to determine, according to the file update table pointed to by the first pointer in the index node of the second file, a logical block number corresponding to the file block number of the data to be read;
  • the reading module 708 is configured to determine a physical address of the data to be read according to the logical block number corresponding to the file block number of the data to be read, and read the data to be read according to the physical address of the data to be read.
  • the receiving module 704 When the storage device in the embodiment of the present invention actually reads data, the receiving module 704 first receives the file reading request, and then the determining module 704 determines the index node of the second file according to the file identifier of the second file. Then, the determining module 704 determines the file block number of the data to be read according to the second file offset. Before reading the data to be read, it is necessary to determine whether the data to be read is updated data, that is, to determine the pending reading. Whether the state of the data is invalid, the determining module 704 determines the file block text chart according to the index node of the second file, and determines the state of the data to be read therein, and if it is invalid, it indicates that the data corresponding to the state passes the current state.
  • the search module 707 determines the file update table according to the index node of the second file, and finds the location of the file block number corresponding to the data to be read in the file update table, thereby finding the to-be-read. Taking the updated logical block number of the data, and then the reading module 708 determines the physicality of the data to be read according to the logical block number corresponding to the file block number of the data to be read. Address, and reads data to be read on a physical disk to the physical address corresponding to this logical block number.
  • the read data is first determined during reading, and then the subsequent read operation is performed according to the judgment result, since the data storage location on the index node is not directly read, so the read is performed.
  • the file updating method of the embodiment of the present invention is further increased. The achievability.
  • the determining module 704 is further configured to determine that the second file is updated according to the update flag bit in the index node of the second file.
  • the update flag is used to determine the update status of the second file.
  • the determination module 704 determines the file status table according to the second pointer of the index node of the second file.
  • this update flag bit is to know whether the data corresponding to the index node is updated only by reading the index node, without first reading the file status table, and then searching the file status table. In the state of the data to be read corresponding to the file block number of the data to be read, it is judged whether there is an update by the state, thereby saving data reading time and improving data reading efficiency.
  • FIG. 8 is a schematic structural diagram of a storage device according to an embodiment of the present invention.
  • a file system is established in the device, and the storage device 8 includes:
  • a memory 801 configured to store file data
  • the controller 802 is connected to the memory, and is configured to receive a file update request, where the file update request carries a file identifier of the first file, a first file offset, and second data, where the second data is used to update the file.
  • First data carries a file identifier of the first file, a first file offset, and second data, where the second data is used to update the file.
  • Corresponding relationship between a file block number of the first data and a logical block number of the data block storing the second data is recorded in the file update table pointed to by the first pointer in the index node of the first file, and the logical block number is used to point to the storage The physical address of the second data;
  • the state of the first data is set to be invalid in the file state table pointed to by the second pointer in the index node.
  • the memory 801 is used to store file data.
  • the controller 802 firstly The second data is stored in the allocated free data block, and the file block number of the first data is determined, and then the controller 802 determines the index node according to the first file, determines the file update table and the file status table, and then the controller 802 is in the file.
  • the correspondence between the file block number of the first data and the logical block number of the data block storing the second data is recorded in the update table, so that the file block number corresponds to the new logical block number, and then the controller 802 is in the file.
  • the state table the state of the first data is set to be invalid, and the data update operation is completed.
  • controller 802 may also perform a data reading operation, wherein the controller 802 may also perform the following operations:
  • the data to be read is read according to the physical address of the data to be read.
  • the file read request is first received by the controller 802, and then the controller 802 determines the second file according to the file identifier of the second file. The index node of the file, and then the controller 802 determines the file block number of the data to be read according to the second file offset. Before reading the data to be read, it is necessary to determine whether the data to be read is updated.
  • Data that is, determining whether the state of the data to be read is invalid, may be determined by the controller 802 according to the index node of the second file, and determining the state of the data to be read therein, if it is invalid, indicating The data corresponding to the status is erroneous data read by the existing one.
  • the controller 802 determines the file update table according to the index node of the second file, and finds the position of the file block number corresponding to the data to be read in the file update table. And then find the updated logical block of the data to be read.
  • controller 802 determines the physical address of the data to be read according to the logical block number corresponding to the file block number of the data to be read, and the controller 802 reads the physical address on the physical disk through the physical address corresponding to the logical block number. The data to be read.
  • controller 802 is further configured to:
  • the update flag bit in the index node of the first file is set to have an update, and the update flag bit is used to determine an update status of the first file.
  • the controller 802 can quickly identify whether the file corresponding to the index node is updated by using the update flag bit.
  • the status of the data in the file status table can be used to know whether there is data update, there are two disadvantages.
  • One is that the file status table needs to be determined by the second pointer in the index node of the first file, and the invalid identifier in the file status table is determined. Therefore, if the controller 802 can directly learn from the index node of the first file whether the file corresponding to the index node has an update, and does not need to determine the file state table by using the second pointer, the execution efficiency of the file system update is greatly improved.
  • controller 802 is further configured to:
  • the controller 802 determines that the second file is updated according to the update flag bit in the index node of the second file, and the update flag is used to determine the second file. update status. Therefore, if this step is used to update the update flag, it indicates that the second file has been updated.
  • the existing read mode may not read the data to be read. Therefore, it is necessary to first go to the file status table to determine the pending read. The state of the data is fetched, and then the manner in which the data to be read is read is determined, thereby improving the execution efficiency of the file system update.
  • a communication interface and a cache are further disposed in the storage device 8 in the embodiment of the present invention, where: the communication interface 803 is configured to allow the storage device to communicate with the external device;
  • the cache 804 is used for data interaction between the controller and the memory, and the cache is set between the controller and the storage.
  • the communication interface 803 is connected to the controller 802, and is used for the storage device and the external device.
  • the line communication may be a physical wired interface such as an Ethernet interface or a fiber interface, or may be a wireless interface, which is determined by a specific application scenario of the storage device, and is not limited.
  • the cache 804 serves as a buffer between the memory 801 and the controller 802. Since the rate of the file data of the controller 802 is much larger than the read data of the memory 801, the cache 804 is read between the memory 801 and the controller 802, and the cache 804 is read. The rate at which the data is fetched is much larger than the memory 801, and is smaller than the rate at which the controller 802 reads the data. Therefore, by setting the buffer 804, the data that needs to be operated is read from the memory 801 into the cache 804 in advance, and then The controller 801 operates to greatly improve the reading efficiency of the data, thereby improving the operating efficiency of the storage device.
  • FIG. 9 is in the embodiment of the present invention.
  • FIG. 9 is in the embodiment of the present invention.
  • FIG. 9 is in the embodiment of the present invention.
  • a single cache 904 or multiple caches 904 are used, the purpose is to serve as a buffer between the controller and the memory.
  • a cache 904 is preferably configured for each of the memories 901.
  • a large buffer may be configured for the plurality of memories 904.
  • the specific settings may be set according to other conditions, such as the rate of the buffer 904 and the controller 902 respectively. That is, the ratio of the memory 901.
  • the cache 904 can be a level one cache 904, or a multi-level cache 904 can be employed, wherein the closer to the cache 904 of the controller 902, the higher the rate at which data is accessed.
  • the embodiment of the invention further provides a computer program product for data processing, comprising a computer readable storage medium storing program code, the program code comprising instructions for executing the method flow described in any one of the foregoing method embodiments.
  • a person skilled in the art can understand that the foregoing storage medium includes: a USB flash drive, a mobile hard disk, a magnetic disk, an optical disk, a random access memory (RAM), a solid state disk (SSD), or a nonvolatile.
  • a non-transitory machine readable medium that can store program code, such as a non-volatile memory.
  • each component in the above embodiment may have another division manner in actual implementation.
  • multiple modules or components may be combined or integrated into another device, or some features may be omitted or not performed.
  • the coupling or direct coupling or communication connection of the components shown or discussed may be through some communication interface, indirect coupling or communication connection of the modules, and may include electrical, mechanical, or other forms of connection.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

La présente invention se rapporte au domaine des systèmes de fichier, et concerne en particulier un procédé de mise à jour de fichier et un dispositif de mémorisation. Le procédé peut consister à : recevoir une demande de mise à jour de fichier, et écrire des secondes données dans un bloc de données attribué ; déterminer un numéro de bloc de fichier de premières données selon un premier décalage de fichier ; déterminer un nœud d'index d'un premier fichier selon un identifiant de fichier du premier fichier ; enregistrer, dans une table de mise à jour de fichier vers laquelle pointe un premier pointeur dans le nœud d'index du premier fichier, une correspondance entre le numéro de bloc de fichier des premières données et un numéro de bloc logique d'un bloc de données pour la mémorisation des secondes données, le numéro de bloc logique étant utilisé pour pointer vers une adresse physique pour la mémorisation des secondes données ; et définir l'état des premières données en tant qu'invalides dans une table d'états de fichier vers laquelle pointe un second pointeur dans le nœud d'index. Au moyen de la solution selon les modes de réalisation de la présente invention, lors de la mise à jour de données, étant donné qu'aucun contenu et qu'aucun pointeur de bloc indirect dans un nœud d'index ne doit être modifié, la modification de métadonnées lors de la mise à jour de données de fichier d'un système de fichier peut être réduite, ce qui permet d'améliorer l'efficacité de mise à jour des données de fichier.
PCT/CN2015/082442 2015-06-26 2015-06-26 Procédé de mise à jour de fichier et dispositif de mémorisation WO2016206070A1 (fr)

Priority Applications (2)

Application Number Priority Date Filing Date Title
PCT/CN2015/082442 WO2016206070A1 (fr) 2015-06-26 2015-06-26 Procédé de mise à jour de fichier et dispositif de mémorisation
CN201580001153.0A CN107430546B (zh) 2015-06-26 2015-06-26 一种文件更新方法及存储设备

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2015/082442 WO2016206070A1 (fr) 2015-06-26 2015-06-26 Procédé de mise à jour de fichier et dispositif de mémorisation

Publications (1)

Publication Number Publication Date
WO2016206070A1 true WO2016206070A1 (fr) 2016-12-29

Family

ID=57584605

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2015/082442 WO2016206070A1 (fr) 2015-06-26 2015-06-26 Procédé de mise à jour de fichier et dispositif de mémorisation

Country Status (2)

Country Link
CN (1) CN107430546B (fr)
WO (1) WO2016206070A1 (fr)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20220226735A1 (en) * 2019-05-31 2022-07-21 Sony Interactive Entertainment Inc. Information processing device

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109164977B (zh) * 2018-07-23 2022-01-11 中国建设银行股份有限公司 一种数据存储系统和方法、存储介质
CN111444138B (zh) * 2019-01-16 2024-03-15 深圳市茁壮网络股份有限公司 一种文件局部修改方法及系统
CN110162525B (zh) * 2019-04-17 2023-09-26 平安科技(深圳)有限公司 基于b+树的读写冲突解决方法、装置及存储介质

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1619600A2 (fr) * 2004-07-19 2006-01-25 Microsoft Corporation Actualisation à distance de fichiers par moyen d'un protocole à distance
CN103049539A (zh) * 2012-12-25 2013-04-17 华为技术有限公司 一种文件系统中文件数据的存储方法及其装置
CN103440204A (zh) * 2013-08-28 2013-12-11 华为技术有限公司 一种更新文件系统的方法和存储设备

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS62172427A (ja) * 1986-01-24 1987-07-29 Nec Corp 二次索引装置
TWI544334B (zh) * 2012-05-30 2016-08-01 慧榮科技股份有限公司 資料儲存裝置與資料儲存裝置操作方法

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1619600A2 (fr) * 2004-07-19 2006-01-25 Microsoft Corporation Actualisation à distance de fichiers par moyen d'un protocole à distance
CN103049539A (zh) * 2012-12-25 2013-04-17 华为技术有限公司 一种文件系统中文件数据的存储方法及其装置
CN103440204A (zh) * 2013-08-28 2013-12-11 华为技术有限公司 一种更新文件系统的方法和存储设备

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20220226735A1 (en) * 2019-05-31 2022-07-21 Sony Interactive Entertainment Inc. Information processing device

Also Published As

Publication number Publication date
CN107430546B (zh) 2020-04-21
CN107430546A (zh) 2017-12-01

Similar Documents

Publication Publication Date Title
US9996542B2 (en) Cache management in a computerized system
US10983955B2 (en) Data unit cloning in memory-based file systems
US11301379B2 (en) Access request processing method and apparatus, and computer device
US11580162B2 (en) Key value append
US20140095555A1 (en) File management device and method for storage system
US20150113230A1 (en) Directory storage method and query method, and node controller
CN107329704B (zh) 一种缓存镜像方法及控制器
US9430492B1 (en) Efficient scavenging of data and metadata file system blocks
US11030092B2 (en) Access request processing method and apparatus, and computer system
AU2013403132A1 (en) Data storage method, data storage apparatus, and storage device
WO2018076633A1 (fr) Procédé de duplication de données à distance, dispositif de stockage et système de stockage
WO2016206070A1 (fr) Procédé de mise à jour de fichier et dispositif de mémorisation
TW201830249A (zh) 最大化可去重複記憶體的方法、記憶體系統和產品
US9524236B1 (en) Systems and methods for performing memory management based on data access properties
US10768829B2 (en) Opportunistic use of streams for storing data on a solid state device
US9569113B2 (en) Data storage device and operating method thereof
CN108958657B (zh) 一种数据存储方法、存储设备及存储系统
CN105264497B (zh) 一种文件管理方法及文件系统
CN109508140B (zh) 存储资源管理方法、装置、电子设备及电子设备、系统
US20150261436A1 (en) Flexible storage block for a solid state drive (ssd)-based file system
CN111625477B (zh) 访问擦除块的读请求的处理方法与装置
US11586353B2 (en) Optimized access to high-speed storage device
EP4220414A1 (fr) Contrôleur de stockage gérant différents types de blocs, son procédé de fonctionnement et procédé de fonctionnement de dispositif de stockage le comprenant
WO2022021280A1 (fr) Contrôleur de stockage, procédé de contrôle de stockage, disque à semi-conducteurs et système de stockage
US11748259B2 (en) System and method to conserve device lifetime for snapshot generation

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 15895970

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 15895970

Country of ref document: EP

Kind code of ref document: A1