Storage system
By implementing the data erase processing function in the controller of the storage system, analyzing the main boot record information, managing the file system and performing physical erase, the shortcomings of the existing storage system in improving performance are solved, and effective data management and performance improvement are achieved.
Patent Information
- Application Number
- CN202110969544.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Priority Date
- 2021-03-24
- Filing Date
- 2021-08-23
- Publication Date
- 2025-06-20
- Estimated Expiration
- 2041-08-23
AI Technical Summary
Existing storage systems have shortcomings in improving performance, especially when managing partitions and file systems in nonvolatile memory, it is difficult to effectively perform logical and physical erasing of data.
A storage system is designed that includes a controller and nonvolatile memory. The controller has data erase processing function, determines the partition form by analyzing the main boot record information, manages the file system, and performs physical erase when a logical erase of the data is detected.
Through active data erasing processing, blocks containing invalid data can be effectively released, the performance of the storage system can be improved, and the storage area can be avoided from wasting use of invalid data.
Smart Images

Figure CN115129238B_ABST
Abstract
Description
[0001] Related Application
[0002] This application claims priority based on Japanese Patent Application No. 2021-49374 (filing date: March 24, 2021). This application incorporates the entire contents of the base application by reference thereto. Technical Field
[0003] Embodiments of the present invention relate to a technique for controlling a non-volatile memory and a storage system. Background Art
[0004] In recent years, storage systems equipped with non-volatile memories have been widely popularized. As one such storage system, a solid-state drive (SSD) using a NAND flash memory is known.
[0005] The SSD is used as a storage device for various host computer systems such as servers in a data center.
[0006] In the storage device of the host computer system, improvement in its performance is pursued. Summary of the Invention
[0007] A problem to be solved by one embodiment of the present invention is to provide a storage system capable of improving performance.
[0008] According to one embodiment, there is provided a storage system capable of being connected to a host, wherein the storage system includes a non-volatile memory and a controller that is electrically connected to the non-volatile memory and configured to control the non-volatile memory. The controller has the following data erasure processing function: determining a partition format of a predetermined partition included in the non-volatile memory based on master boot record information stored in the non-volatile memory, determining a first sector and a second sector of the predetermined partition based on the determined partition format, determining a file system for managing the predetermined partition based on first information included in the first sector and second information included in the second sector, and when logical erasure of data in the predetermined partition is detected by a method according to the determined file system, determining first data that has been logically erased and performing physical erasure of the first data. Brief Description of the Drawings
[0009] Figure 1 It is a block diagram showing a configuration example of a storage system according to one embodiment.
[0010] Figure 2 It is a diagram showing the structure of a NAND type flash memory.
[0011] Figure 3This is a diagram showing the structure of a NAND flash memory.
[0012] Figure 4 This is a flowchart showing the process of determining the form of partitions included in a NAND flash memory.
[0013] Figure 5 This is a flowchart showing the process of determining the form of partitions included in a NAND flash memory.
[0014] Figure 6 This is a flowchart showing the process of determining the form of partitions included in a NAND flash memory.
[0015] Figure 7 This is a flowchart showing the process of determining the form of partitions included in a NAND flash memory.
[0016] Figure 8 This is a flowchart showing the process of determining the type of file system for managing partitions.
[0017] Figure 9 This is a flowchart showing the process of determining the type of file system for managing partitions.
[0018] Figure 10 This is a flowchart showing the process of determining the type of file system for managing partitions.
[0019] Figure 11 This is a flowchart showing the process of determining the type of file system for managing partitions.
[0020] Figure 12 This is a diagram showing the layout of the EXT4 file system.
[0021] Figure 13 This is a flowchart showing the process executed to erase data when the file system for managing partitions is EXT4.
[0022] Figure 14 This is a diagram showing the layout of the F2FS file system.
[0023] Figure 15 This is a flowchart showing the process executed to erase data when the file system for managing partitions is F2FS.
[0024] Figure 16 This is a diagram showing the layout of the exFAT file system.
[0025] Figure 17 This is a flowchart showing the process executed to erase data when the file system for managing partitions is exFAT.
[0026] Figure 18It is a diagram showing the layout of the FAT32 file system.
[0027] Figure 19 It is a flowchart showing the process executed for erasing data when the file system for managing the partition is FAT32.
[0028] Figure 20 It is a flowchart showing the process executed when an erase request is received from the host.
[0029] Reference Numeral Explanation
[0030] 2…Host, 3…SSD, 4…Controller, 5…NAND type flash memory, 6…DRAM, 23…Erase control unit, 31…L2P table. Detailed Description of the Embodiment
[0031] Hereinafter, the embodiment will be described with reference to the drawings.
[0032] Figure 1 It is a block diagram showing a configuration example of the information processing system 1 including a storage system according to an embodiment.
[0033] This storage system is a semiconductor storage device configured to write data to a non-volatile memory and read data from the non-volatile memory. This storage system is implemented as a solid state drive (SSD) 3 using a NAND flash memory.
[0034] The information processing system 1 includes a host (main device) 2 and an SSD 3. The host 2 is implemented by an information processing device configured to use the SSD 3 as a storage device. This information processing device can be a computer such as a personal computer or a server computer, a portable terminal such as a tablet or a smart phone, or an in-vehicle terminal such as a car navigation system.
[0035] The SSD 3 can be used as an external storage device of an information processing device that functions as the host 2. The SSD 3 can be built in the information processing device or connected to the information processing device via a cable, a network, etc.
[0036] As an interface for connecting the host 2 and the SSD 3 to each other, although not limited thereto, PCI Express (PCIe) (registered trademark), NVM Express (NVMe) (registered trademark), Ethernet (registered trademark), NVMe over Fabrics (NVMeOF), etc. can be used.
[0037] The SSD 3 includes a controller 4 and a non-volatile memory (NAND type flash memory) 5. The SSD 3 can also include a random access memory, for example, DRAM 6.
[0038] The NAND flash memory 5 includes a memory cell array including a plurality of memory cells arranged in a matrix. The NAND flash memory 5 can be a two-dimensional NAND flash memory or a three-dimensional NAND flash memory.
[0039] The memory cell array of the NAND flash memory 5 includes a plurality of blocks BLK0 to BLKm-1. Each of the blocks BLK0 to BLKm-1 includes a plurality of pages (here, pages P0 to Pn-1). Each of the blocks BLK0 to BLKm-1 is a unit for erasing data. A block is sometimes referred to as an "erase block", a "physical block", or a "physical erase block". Each of the pages P0 to Pn-1 is a unit for writing and reading data. A page is sometimes referred to as a "data block" or a "sector".
[0040] The controller 4 is electrically connected to the NAND flash memory 5 as a non-volatile memory via a NAND interface 13 such as a Toggle NAND flash interface or an Open NAND Flash Interface (ONFI). The controller 4 operates as a memory controller configured to control the NAND flash memory 5. The controller 4 can also be implemented by a circuit such as a System-on-a-chip (SoC).
[0041] The NAND flash memory 5 may also include a plurality of NAND flash memory chips (NAND flash memory dies). In this case, the NAND interface 13 may be connected to the plurality of NAND flash memory chips via a plurality of channels Ch, respectively.
[0042] The controller 4 can function as a flash translation layer (FTL) configured to perform data management and block management of the NAND flash memory 5. In the data management performed by the FTL, it includes (1) management of mapping information indicating the correspondence between each of the logical addresses and each of the physical addresses of the NAND flash memory 5, (2) processing for encapsulating the restrictions of the NAND flash memory 5 (for example, read / write operations in page units and erase operations in block units), etc. The logical address is an address used by the host 2 to specify a position within the logical address space of the SSD 3. As this logical address, generally, a logical block address (LBA) can be used.
[0043] The management of the mapping between each of the logical addresses used by the host 2 to access the SSD 3 and each of the physical addresses of the NAND flash memory 5 is performed using an address translation table (logical-physical address translation table: L2P table) 31. The controller 4 uses the L2P table 31 to manage the mapping between each of the logical addresses and each of the physical addresses in units of a predetermined management size. The physical address corresponding to a certain logical address indicates the latest physical storage location in the NAND flash memory 5 where the data corresponding to the logical address is written. The L2P table 31 can also be loaded from the NAND flash memory 5 into the DRAM 6 when the power of the SSD 3 is turned on. In the DRAM 6, either the entire L2P table 31 can be loaded when the power of the SSD 3 is turned on, or only the necessary part of the L2P table 31 can be loaded each time during the operation of the SSD 3.
[0044] In the NAND flash memory 5, data writing to a page can be performed only once per erase cycle. That is, it is not possible to directly overwrite new data to a page (data block) where data has already been written. Therefore, when updating (changing) the written data, the controller 4 writes new data (update data) to an unused area (unwritten area) in the block (or another block) containing the data, and treats the previous data as invalid data. In other words, the controller 4 writes the update data corresponding to a certain logical address not to the physical storage location where the previous data corresponding to the logical address is stored, but to another physical storage location. Then, the controller 4 updates the L2P table 31 to associate the logical address with the other physical storage location, and invalidates the previous data.
[0045] In block management, for example, it includes garbage collection (GC), etc. GC is sometimes called "compression". GC is an operation for increasing the number of free blocks. A free block means a block that does not contain valid data and invalid data. In GC, the controller 4 moves the valid data in the block where valid data and invalid data are mixed to another block (for example, a free block). Then, the controller 4 updates the L2P table 31 to map the physical address of the movement destination to the logical address of the moved valid data. The controller 4 performs a physical erasure on the block that has become only invalid data due to the movement of the valid data to another block. As a result, the block that has been physically erased is released as a free block and can be reused for data writing.
[0046] Here, valid data means data associated with a certain logical address. For example, the data referred to from the L2P table 31 (i.e., the data associated with the logical address as the latest data) is valid data and there is a possibility of being read out from the host 2 later. Invalid data is data that is not associated with any logical address and means data that has been logically erased. Data that is not associated with any logical address is data that no longer has the possibility of being read out from the host 2.
[0047] The controller 4 includes a host interface 11, a CPU 12, a NAND interface 13, a DRAM interface 14, a direct memory access controller (DMAC) 15, an internal buffer 16, an ECC encoding / decoding unit 17, etc. These host interface 11, CPU 12, NAND interface 13, DRAM interface 14, direct memory access controller (DMAC) 15, internal buffer 16, and ECC encoding / decoding unit 17 are interconnected via a bus 10.
[0048] The host interface 11 is a host interface circuit configured to perform communication with the host 2. This host interface 11 can be, for example, a PCIe controller (NVMe controller). Alternatively, in a configuration where the SSD 3 is connected to the host 2 via Ethernet (registered trademark), the host interface 11 can also be an NVMe over Fabrics (NVMeOF) controller.
[0049] The host interface 11 receives various commands from the host 2. Among these commands, there are write commands (write requests, write-in requests), read commands (read requests, read-out requests), and various other commands.
[0050] A write command is a command (write request, write-in request) for writing data to be written (write data) to the SSD 3, and includes the logical address (starting LBA) of the write data, the length of the write data, a data pointer (buffer address) indicating the position in the write buffer in the memory of the host 2 where the write data is stored, etc.
[0051] A read command is a command (read request, read-out request) for reading data from the SSD 3, and includes the logical address (starting LBA) of the data to be read, the length of the data, a data pointer (buffer address) indicating the position in the read buffer in the memory of the host 2 to which the data should be transferred, etc.
[0052] The CPU 12 is a processor configured to control the host interface 11, the NAND interface 13, and the DRAM interface 14. In response to the power-on of the SSD 3, the CPU 12 loads a control program (firmware) from the NAND flash memory 5 or a ROM (not shown) into the DRAM 6, and then performs various processes by executing this firmware. In addition, the firmware can also be loaded onto a SRAM (not shown) within the controller 4. The CPU 12 can execute command processing and the like for processing various commands from the host 2. The operation of the CPU 12 is controlled by the above-described firmware. In addition, part or all of the command processing can also be executed by dedicated hardware within the controller 4.
[0053] In the controller 4, as components for implementing the FTL, there are a write control unit 21, a read control unit 22, and an erase control unit 23. These write control unit 21, read control unit 22, and erase control unit 23 can be implemented by the above-described firmware executed by the CPU 12. In addition, part or all of each of these write control unit 21, read control unit 22, and erase control unit 23 can also be implemented by dedicated hardware within the controller 4.
[0054] The write control unit 21 executes a process for writing write data associated with a write command to the NAND flash memory 5 according to the write command (write request) received from the host 2. The read control unit 22 receives a read command from the host 2 and reads out the data specified by the received read command from the NAND flash memory 5. In addition, the erase control unit 23 will be described later, so its detailed description is omitted here.
[0055] The NAND interface 13 is a memory control circuit configured to control the NAND flash memory 5 under the control of the CPU 12.
[0056] The DRAM interface 14 is a DRAM control circuit configured to control the DRAM 6 under the control of the CPU 12. A part of the storage area of the DRAM 6 can also be used as a storage area for the L2P table 31.
[0057] The DMAC 15 performs data transfer between the memory of the host 2 and the internal buffer 16 under the control of the CPU 12. When write data should be transferred from the write buffer in the memory of the host 2 to the internal buffer 16, the CPU 12 specifies the transfer source address indicating the position on the write buffer in the memory of the host 2, the data size, and the transfer destination address indicating the position on the internal buffer 16 to the DMAC 15.
[0058] When data is to be written to the NAND flash memory 5, the ECC encoding / decoding unit 17 appends an error correction code (ECC) as a redundant code to the data (the data to be written) by encoding the data (ECC encoding). When data is read from the NAND flash memory 5, the ECC encoding / decoding unit 17 uses the ECC appended to the read data to perform error correction (ECC decoding) on the data.
[0059] If only the logical erasure of a certain data is performed as described above and the data is invalidated, the block containing the invalidated data is not released as a free block. That is, since the storage area of the NAND flash memory 5 is not released, a situation may occur where the storage area is wastedly used by invalid data. This situation can be eliminated by the above-described GC or the like, but GC is mainly executed when the unused area in the NAND flash memory 5 becomes less than a predetermined value or when an instruction is received from the host 2, so the above situation cannot be always eliminated.
[0060] The erasure control unit 23 of the present embodiment actively executes the following data erasure process: monitors the state of the NAND flash memory 5, and when an increase in invalid data is detected (that is, when logical erasure of data is detected), physically erases the invalid data and releases the block containing the invalid data as a free block. The on / off of the function (data erasure process function) of the erasure control unit 23 is controlled by the host 2 or the controller 4, and as long as this function is on, the erasure control unit 23 actively executes the data erasure process (for example, every time a predetermined period elapses).
[0061] Hereinafter, after explaining the structure of the NAND flash memory 5, the data erasure process executed by the above-described erasure control unit 23 will be described in detail.
[0062] Figure 2 FIG. is a diagram showing the structure of the NAND flash memory 5. The NAND flash memory 5 is divided into a plurality of partitions. In Figure 2 it shows a case where the form of partitioning the NAND flash memory 5 is the MBR form. Therefore, the NAND flash memory 5 includes a maximum of four partitions 101 (the first partition to the fourth partition).
[0063] The master boot record (MBR) 100 is configured in the start sector of the NAND flash memory 5. The MBR 100 includes a master bootstrap loader 102. The master bootstrap loader 102 performs the following processing: find the active partition from the partitions included in the NAND flash memory 5, load the boot loader included in the partition, and transfer control to it. In addition to the master bootstrap loader 102, the MBR 100 also includes a partition table 103 (the first partition table to the fourth partition table) corresponding to the partitions included in the NAND flash memory 5 and a signature 104. The signature 104 is an identifier for determining whether the MBR 100 including the signature 104 is valid, and the value "0xAA55" is set when the MBR 100 is valid.
[0064] The partition table 103 respectively includes the composition information of the corresponding partition. Specifically, the partition table 103 respectively includes a boot flag 105, a partition start position 106, a partition type 107, a partition end position 108, a partition start position 109, and a total number of sectors in the partition 110.
[0065] The boot flag 105 is an identifier for determining whether the corresponding partition is an active partition, and the value "0x80" is set when it is an active partition. The partition start position 106 represents the start position of the corresponding partition in the CHS format (that is, the first (earliest) sector of the corresponding partition). The partition type 107 represents the type of the OS or the type of the file system using the corresponding partition. The partition end position 108 represents the end position of the corresponding partition in the CHS format (that is, the last sector of the corresponding partition). The partition start position 109 represents the start position of the corresponding partition in the LBA format (that is, the sector number of the first sector of the corresponding partition). The total number of sectors in the partition 110 represents the total number of sectors included in the corresponding partition in the LBA format.
[0066] Figure 3 It is a diagram showing the structure of the NAND flash memory 5. The NAND flash memory 5 is divided into multiple partitions. In Figure 3 it shows the case where the form of partitioning the NAND flash memory 5 is the GPT (GUID Partition Table) form. Therefore, the NAND flash memory 5 includes a maximum of 128 partitions 123 (the first partition to the 128th partition).
[0067] A protective master boot record (PMBR) 120 is configured in the starting sector of the NAND flash memory 5. The PMBR 120 contains dummy partition information for protecting partitions in the GPT format, and is recorded in the same form as the MBR 100. In addition to the PMBR 120 and the partition 123, the NAND flash memory 5 further includes a first GPT header 121, a first GPT entry array 122, a second GPT entry array 124, and a second GPT header 125.
[0068] The first GPT header 121 defines the number and size of the partition entries. The first GPT header 121 includes a signature, a GUID of the disk, its own size and location, the size and location of the second GPT header 125, a CRC32 checksum, etc.
[0069] The first GPT entry array 122 contains partition entries (first partition entry to 128th partition entry) corresponding to the partitions included in the NAND flash memory 5.
[0070] Each partition entry contains the composition information of the corresponding partition. Specifically, each partition entry contains a partition type GUID 126, a partition GUID 127, a first sector 128, a last sector 129, a flag 130, and a partition name 131.
[0071] The partition type GUID 126 is a GUID indicating the type of OS or file system using the corresponding partition. The partition GUID 127 is a GUID indicating the corresponding partition. The first sector 128 represents the sector number of the first sector of the corresponding partition in the LBA format. The last sector 129 represents the sector number of the last sector of the corresponding partition in the LBA format. The flag 130 indicates the attribute of the corresponding partition. The partition name 131 represents the name set for the corresponding partition.
[0072] The second GPT entry array 124 contains a copy (backup) of the first GPT entry array 122. The second GPT header 125 contains a copy (backup) of the first GPT header 121.
[0073] In addition, sometimes the Figure 2 and Figure 3 information contained in the MBR 100 and PMBR 120 shown is summarized and referred to as MBR information.
[0074] Hereinafter, the data erasure process executed by the erasure control unit 23 will be described in detail. The data erasure process executed by the erasure control unit 23 includes (1) a process of determining the form of the partitions included in the NAND flash memory 5, (2) a process of determining the type of the file system that manages the partitions, (3) a process of detecting whether logical erasure of data has been performed and, in the case where logical erasure of data has been detected, performing physical erasure of the data, and so on.
[0075] First, with reference to Figures 4 - 7 the flowchart, the above-mentioned process (1) of determining the form of the partitions included in the NAND flash memory 5 will be described in detail. Figures 4 - 7 The flowcharts are all examples showing the order of processes executed by the erasure control unit 23 to determine the form of the partitions included in the NAND flash memory 5.
[0076] In Figure 4 it mainly describes the process of determining whether the form of the partition is the MBR form or the GPT form.
[0077] First, the erasure control unit 23 reads the first sector of the NAND flash memory 5 to obtain MBR information (step S1), and refers to a predetermined partition table constituting the MBR information included in the read first sector to confirm the partition type (step S2).
[0078] Next, the erasure control unit 23 determines whether the value of the confirmed partition type is "0xEE" indicating the GPT PMBR (step S3). In the case where it is determined in the process of step S3 that the value of the confirmed partition type is not "0xEE" (No in step S3), the erasure control unit 23 determines that the form of the partitions included in the NAND flash memory 5 is the MBR form, and executes the process of step S11 shown in Figure 5 below.
[0079] On the other hand, in the case where it is determined in the process of step S3 that the value of the confirmed partition type is "0xEE" (Yes in step S3), the erasure control unit 23 refers to the partition table referred to in step S2 again to confirm the partition start position and end position represented in the CHS format and the total number of sectors of the partition represented in the LBA format (step S4).
[0080] The erasure control unit 23 calculates the total number of sectors of the partition represented in the LBA format based on the confirmed partition start position and end position represented in the CHS format (step S5), and determines whether the calculated total number of sectors of the partition is the same as the total number of sectors of the partition confirmed in the process of step S4 (step S6).
[0081] In the case where it is determined in the process of step S6 that the total number of sectors of the calculated partition is the same as the total number of sectors of the confirmed partition (Yes in step S6), the erasure control unit 23 determines that the form of the partition included in the NAND flash memory 5 is the GPT form, and executes the process of step S31 described below. Figure 7 The process shown in step S31.
[0082] On the other hand, in the case where it is determined in the process of step S6 that the total number of sectors of the calculated partition is not the same as the total number of sectors of the confirmed partition (No in step S6), the erasure control unit 23 considers that a contradiction has occurred, and determines that the form of the partition included in the NAND flash memory 5 is an unknown form (that is, it is determined that the partition form is neither the MBR form nor the GPT form) (step S7), and ends this series of processes here.
[0083] Next, the Figure 5 flowchart will be described. In Figure 5 , the process of determining whether the partition is a primary area or an extended area and the process executed when the partition is a primary area will be mainly described.
[0084] In Figure 4 the process of step S3 shown, in the case where it is determined that the value of the confirmed partition type is not "0xEE" (No in step S3), the erasure control unit 23 determines whether the value of the confirmed partition type is "0x05" indicating an extended DOS area (step S11). In the process of step S11, in the case where it is determined that the value of the confirmed partition type is "0x05" (Yes in step S11), the erasure control unit 23 determines that the form of the partition included in the NAND flash memory 5 is the MBR form and the partition that has become the object of this process is an extended area, and executes the Figure 6 The process of step S21 described below.
[0085] On the other hand, in the case where it is determined in the process of step S11 that the value of the confirmed partition type is not "0x05" (No in step S11), the erasure control unit 23 determines that the form of the partition included in the NAND flash memory 5 is the MBR form and the partition that has become the object of this process is a primary area. Then, the erasure control unit 23 refers to the partition table corresponding to the partition that is the object of this process again to confirm the partition start position (sector number of the first sector) represented in the LBA method (step S12), and associates the partition that is the object of this process with the confirmed first sector number and adds it to the list representing the first sector of the partition included in the NAND flash memory 5 (step S13).
[0086] After that, the erasure control unit 23 determines whether there is a partition in the NAND flash memory 5 that has not yet become a processing target (step S14). If it is determined that there is a partition that has not yet become a processing target (Yes in step S14), the erasure control unit 23 sets the partition that has not yet become a processing target as the object and executes Figure 4 the process of step S2. On the other hand, if it is determined in the process of step S14 that there is no partition that has not yet become a processing target (No in step S14), the erasure control unit 23 ends this series of processes here.
[0087] Next, Figure 6 the flowchart of Figure 6 will be described. In
[0088] In Figure 5 if it is determined in the process of step S11 shown that the value of the confirmed partition type is "0x05" (Yes in step S11), based on the determination that the form of the partition included in the NAND flash memory 5 is the MBR form and the partition that has become the object of this processing is the extended area, the erasure control unit 23 reads the extended boot record (EBR) included in the first sector of the partition that is the object of this processing (step S21). In addition, the EBR has the same data structure as the MBR 100 and includes its own logical area and information on the next extended area. Two of the four partition tables included in the EBR are used, and the remaining two partition tables are not used. In one of the used partition tables, information related to the logical area of the partition containing this EBR is shown, and in the other partition table, information indicating the position of the next EBR is shown. However, if there is no next EBR, the other partition table is not used in the same way as the above-mentioned remaining two partition tables.
[0089] The erasure control unit 23 refers to the predetermined partition table included in the read EBR to confirm the partition start position represented in the LBA format (the sector number of the first sector in the logical area) (step S22), associates the partition that is the object of this processing with the confirmed sector number of the first sector in the logical area, and adds it to the list representing the first sector of the partition included in the NAND flash memory 5 (step S23).
[0090] Next, the erasure control unit 23 determines whether the read EBR contains information indicating the next EBR (step S24). If it is determined in the process of step S24 that the read EBR contains information indicating the next EBR (Yes in step S24), the erasure control unit 23 executes the process of step S21 to read this next EBR.
[0091] On the other hand, in the case where it is determined in the process of step S24 that the read EBR does not contain information indicating the next EBR (No in step S24), it is determined whether there is a partition in the NAND flash memory 5 that has not yet become a processing target (step S25). In the case where it is determined that there is a partition that has not yet become a processing target (Yes in step S25), the erasure control unit 23 sets the partition that has not yet become a processing target as the object and executes Figure 4 the process of step S2. On the other hand, in the case where it is determined in the process of step S25 that there is no partition that has not yet become a processing target (No in step S25), the erasure control unit 23 ends the series of processes here.
[0092] Further, Figure 7 the flowchart of Figure 7 will be described. In
[0093] In Figure 4 in the process of step S6 shown, in the case where it is determined that the total number of sectors of the calculated partition is the same as the total number of sectors of the confirmed partition (Yes in step S6), based on the determination that the form of the partition included in the NAND flash memory 5 is the GPT form, the erasure control unit 23 reads the first GPT header and confirms the signature included in the read first GPT header (step S31).
[0094] The erasure control unit 23 determines whether the value of the confirmed signature is "0x5452415020494645" indicating GPT (step S32). In the case where it is determined in the process of step S32 that the value of the confirmed signature is not "0x5452415020494645" (No in step S32), the erasure control unit 23 considers that a contradiction has occurred and determines that the form of the partition included in the NAND flash memory 5 is an unknown form (step S33), and ends the series of processes here.
[0095] On the other hand, in the case where it is determined in the process of step S32 that the value of the confirmed signature is "0x5452415020494645" (Yes in step S32), the erasure control unit 23 reads a predetermined partition entry following the first GPT header (step S34). The erasure control unit 23 refers to the read partition entry to confirm the first sector number and the last sector number (step S35), and associates the partition to be processed with the confirmed first sector number and the last sector number and adds them to the list indicating the first sector and the last sector of the partition included in the NAND flash memory 5 (step S36).
[0096] After that, the erasure control unit 23 determines whether there is a partition in the NAND flash memory 5 that has not yet become a processing target (step S37). If it is determined that there is a partition that has not yet become a processing target (Yes in step S37), the erasure control unit 23 sets the partition that has not yet become a processing target as the object and executes the processing of step S34. On the other hand, if it is determined in the processing of step S37 that there is no partition that has not yet become a processing target (No in step S37), the erasure control unit 23 ends the series of processing here.
[0097] Next, with reference to Figures 8 - 11 the flowchart of, the process of determining the type of the file system for managing the partition in (2) above will be described in detail. Figures 8 - 11 These are all flowcharts showing an example of the processing order executed by the erasure control unit 23 to determine the type of the file system for managing the partition.
[0098] In Figure 8 the process of discriminating (determining) whether the file system is EXT4 (the first file system) will be described.
[0099] First, the erasure control unit 23 reads out the first sector number associated with a predetermined partition from the list (step S41). Next, the erasure control unit 23 refers to the read first sector number to confirm the sector number of the next sector (the second sector number) of the first sector of the predetermined partition, and reads out the superblock from the next sector (step S42), and reads out the magic number set at the offset 0x38 of the read superblock (step S43).
[0100] The erasure control unit 23 determines whether the read magic number is "0xEF53" indicating EXT4 (step S44). If it is determined in the processing of step S44 that the read magic number is not "0xEF53" (No in step S44), the erasure control unit 23 executes the processing of step S51 shown in Figure 9 described later.
[0101] On the other hand, if it is determined in the processing of step S44 that the read magic number is "0xEF53" (Yes in step S44), the erasure control unit 23 determines that the file system for managing the processing target partition is EXT4 (step S45), and executes the processing of step S81 shown in Figure 13 described later.
[0102] Next, the flowchart of Figure 9 will be described. In Figure 9 the process of discriminating (determining) whether the file system is F2FS (the second file system) will be described.
[0103] InFigure 8 In the process of step S44, when it is determined that the magic number read out is not "0xEF53" (No in step S44), the erasure control unit 23 reads out the magic number at offset 0x00 of the superblock read out in the process of step S42 (step S51).
[0104] The erasure control unit 23 determines whether the read magic number is "0xF2F52010" indicating F2FS (step S52). When it is determined in the process of step S52 that the read magic number is not "0xF2F52010" (No in step S52), the erasure control unit 23 executes the Figure 10 processing of step S61 shown below.
[0105] On the other hand, when it is determined in the process of step S52 that the read magic number is "0xF2F52010" (Yes in step S52), the erasure control unit 23 determines that the file system of the partition to be managed is F2FS (step S53), and executes the Figure 15 processing of step S91 shown below.
[0106] Next, an explanation will be given of the Figure 10 flowchart. In the Figure 10 flowchart, an explanation will be given of the process of discriminating (determining) whether the file system is exFAT (the third file system).
[0107] In the Figure 9 process of step S52, when it is determined that the read magic number is not "0xF2F52010" (No in step S52), the erasure control unit 23 reads out the first sector of a predetermined partition with reference to the first sector number read out in the process of step S41 (step S61). The erasure control unit 23 reads out the file system name set at offset 0x03 of the read first sector (step S62).
[0108] The erasure control unit 23 determines whether the read file system name is "exFAT" (step S63). When it is determined in the process of step S63 that the read file system name is not "exFAT" (No in step S63), the erasure control unit 23 executes the Figure 11 processing of step S71 shown below.
[0109] On the other hand, when it is determined in step S63 that the read file system name is "exFAT" (Yes in step S63), the erasure control unit 23 determines that the file system of the partition to be managed is exFAT (step S64), and executes the Figure 17 processing of step S111 shown below.
[0110] Furthermore, an explanation will be given of theFigure 11 will be described with reference to the flowchart. In Figure 11 , a process of determining whether the file system is FAT32 (the fourth file system) will be described.
[0111] In Figure 10 If it is determined in the process of step S63 shown that the read file system name is not "exFAT" (No in step S63), the erasure control unit 23 reads the extended BPB (BIOS Parameter Block) included in the first sector read in the process of step S61 (step S71). The erasure control unit 23 reads the file system type set at an offset of 0x52 from the read extended BPB (step S72).
[0112] The erasure control unit 23 determines whether the read file system type is "FAT32" (step S73). If it is determined in the process of step S73 that the read file system type is "FAT32" (Yes in step S73), the erasure control unit 23 determines that the file system of the partition to be managed is FAT32 (step S74), and executes the process of step S121 shown below. Figure 19 shown.
[0113] On the other hand, if it is determined in the process of step S73 that the read file system type is not "FAT32" (No in step S73), the erasure control unit 23 determines that the file system of the partition to be managed is an unknown file system (step S75).
[0114] After that, the erasure control unit 23 determines whether the file systems of all partitions in the list have been determined (step S76). If it is determined that the file systems of all partitions in the list have not been determined yet (No in step S76), the other partition in the list is set as the processing object to execute Figure 8 the process of step S41. On the other hand, if it is determined in the process of step S76 that the file systems of all partitions in the list have been determined (Yes in step S76), the erasure control unit 23 ends a series of data erasure processes.
[0115] Next, with reference to Figures 12 - 19 the above-mentioned process (3) of detecting whether logical erasure of data has been performed and performing physical erasure of the data in the case where logical erasure of the data is detected will be described in detail.
[0116] Figure 12 is a diagram showing the layout of the file system EXT4.
[0117] As Figure 12As shown, the file system EXT4 includes a boot block 140 configured as the initial sector and a plurality of block groups 141 (block group 0 to block group n). The boot block 140 contains a boot loader. The block group 141 contains a plurality of blocks, and each block contains a plurality of data blocks 148.
[0118] Each block group 141 includes a superblock 142, a group descriptor table (GDT) 143, a reserved GDT 144, a data block bitmap 145, an inode bitmap 146, an inode table 147, and data blocks 148.
[0119] The superblock 142 represents information (metadata) related to the file system. Specifically, the superblock 142 represents the total number of inodes, the number of free inodes, the number of free blocks, etc. The GDT 143 is an aggregate of group descriptors that represent the address of the data block bitmap 145, the address of the inode bitmap 146, the address of the inode table 147, etc. as information related to the block group 141. The reserved GDT 144 is a reserved area for extending the GDT 143 when the block group 141 is increased due to the extension of the file system. The data block bitmap 145 represents the usage status of data blocks. The inode bitmap 146 represents the usage status of inodes. The inode table 147 is an area for storing inodes for files, directories, etc. The data blocks 148 are areas for storing data.
[0120] Figure 13 is a flowchart showing an example of the processing sequence executed when the file system for managing the partition is EXT4.
[0121] If it is determined in the processing of step S45 shown in Figure 8 that the file system of the partition to be managed is EXT4, the erasure control unit 23 reads the superblock 142 included in the block group 141 (step S81). Next, the erasure control unit 23 reads the number of free inodes and the number of free blocks from the read superblock 142 (step S82), and determines whether the read number of free inodes and the number of free blocks have increased compared to the previous data erasure process (previous value) (step S83). In addition, the previous value is stored in an arbitrary temporary storage area such as the internal buffer 16 of the controller 4.
[0122] In addition, the number of free inodes and the number of free blocks read from the superblock 142 represent logical free rather than physical free. That is, the number of free inodes represents the sum of the number of unused inodes and the number of inodes allocated to invalid data. The number of free blocks represents the sum of the number of unused data blocks and the number of data blocks containing invalid data.
[0123] In the case where it is determined in the process of step S83 that the number of free inodes and the number of free blocks read out have increased compared to the previous data erasure process (Yes in step S83), the erasure control unit 23 reads out the GDT 143 included in the block group 141, and determines in which block group 141 the logical erasure of data has been performed by sequentially checking whether the number of free blocks in each block group 141 has increased compared to the previous value (step S84).
[0124] The erasure control unit 23 reads out the address of the data block bitmap 145 from the group descriptor corresponding to the determined block group 141, and reads out the data block bitmap 145 with reference to this address (step S85). The erasure control unit 23 determines the data block 148 that has been logically erased of data (that is, the data block 148 containing invalid data) with reference to the read data block bitmap 145 (step S86).
[0125] The erasure control unit 23 moves the valid data in the block containing the determined data block 148 to another block, updates the L2P table 31, maps the physical address of the movement destination to the logical address of the moved valid data, and then performs physical erasure of the data in the block containing the determined data block 148 (step S87). Thus, the block containing the data block 148 determined in the process of step S86 can be released as a free block.
[0126] After that, the erasure control unit 23 determines whether the file systems of all the partitions in the list have been determined (step S88). In the case where it is determined that the file systems of all the partitions in the list have not been determined yet (No in step S88), the process of step S41 is executed for another partition in the list. Figure 8 of step S41.
[0127] On the other hand, in the case where it is determined that the file systems of all the partitions in the list have been determined (Yes in step S88), the erasure control unit 23 ends a series of data erasure processes.
[0128] Figure 14 is a diagram showing the layout of the file system F2FS.
[0129] As Figure 14 shown, the file system F2FS is divided into two areas: a metadata area 150 for storing metadata and a main area 151 for storing data blocks and node blocks. The metadata area 150 is further divided into five areas: a super block area (SB area) 152, a checkpoint area (CP area) 153, a segment information table area (SIT area) 154, a node address table area (NAT area) 155, and a segment summary area (SSA area) 156.
[0130] The boot block and the super block are stored in the SB area 152. The super block represents basic information for managing partitions. Specifically, the super block represents block addresses and the like for indicating the start positions of the respective areas 151 to 156. Information related to the file system such as the number of valid inodes, the number of valid nodes, and the number of valid blocks is periodically stored in the CP area 153. The number of valid blocks and the SIT representing the bitmap of all valid blocks are stored in the SIT area 154. The NAT representing the address of the node block is stored in the NAT area 155. The attribute information of the main area and the node block is stored in the SSA area 156.
[0131] Figure 15 FIG. is a flowchart showing an example of the processing sequence executed when the file system for managing partitions is F2FS.
[0132] If it is determined in the processing of step S53 shown in Figure 9 that the file system of the partition to be managed is F2FS, the erase control unit 23 reads the super block from the SB area 152 (step S91). Next, the erase control unit 23 reads the block address (CP address) indicating the start position of the CP area 153 set at the offset 0x50 of the read super block (step S92). The erase control unit 23 reads the block address (SIT address) indicating the start position of the SIT area 154 set at the offset 0x54 of the read super block (step S93).
[0133] The erase control unit 23 determines the CP area 153 with reference to the read CP address, and reads the number of valid inodes, the number of valid nodes, and the number of valid blocks from the CP area 153 (step S94). In addition, the number of valid inodes, the number of valid nodes, and the number of valid blocks represent the number of available inodes, the number of available nodes, and the number of available blocks.
[0134] The erase control unit 23 determines whether the number of valid inodes read from the CP area 153 is less than that at the time of the previous data erase process (previous value) (step S95). In addition, the previous value is stored in an arbitrary temporary storage area such as the internal buffer 16 of the controller 4.
[0135] If it is determined in the processing of step S95 that the number of valid inodes read is not less than that at the time of the previous data erase process (No in step S95), the erase control unit 23 determines that no logical data erasure has been performed since the previous data erase process, and executes the processing of step S102 described later.
[0136] On the other hand, if it is determined in the processing of step S95 that the number of valid inodes read is less than that at the time of the previous data erase process (Yes in step S95), the erase control unit 23 determines whether the number of valid nodes read from the CP area 153 is less than that at the time of the previous data erase process (step S96).
[0137] In the case where it is determined in the process of step S96 that the number of valid nodes read out has not decreased compared to the previous data erasure process (No in step S96), the erasure control unit 23 determines that no logical erasure of data has been performed since the previous data erasure process, and executes the process of step S102 described later.
[0138] On the other hand, in the case where it is determined in the process of step S96 that the number of valid nodes read out has decreased compared to the previous data erasure process (Yes in step S96), the erasure control unit 23 determines whether the number of valid blocks read out from the CP area 153 has decreased compared to the previous data erasure process (step S97).
[0139] In the case where it is determined in the process of step S97 that the number of valid blocks read out has not decreased compared to the previous data erasure process (No in step S97), the erasure control unit 23 determines that no logical erasure of data has been performed since the previous data erasure process, and executes the process of step S102 described later.
[0140] On the other hand, in the case where it is determined in the process of step S97 that the number of valid blocks read out has decreased compared to the previous data erasure process (Yes in step S97), the erasure control unit 23 refers to the read SIT address to determine the SIT area 154, and reads out the number of valid blocks from the SIT area 154 (step S98).
[0141] The erasure control unit 23 determines whether the number of valid blocks read out from the SIT area 154 has decreased compared to the previous data erasure process (step S99).
[0142] In the case where it is determined in the process of step S99 that the number of valid blocks read out has not decreased compared to the previous data erasure process (No in step S99), the erasure control unit 23 determines that no logical erasure of data has been performed since the previous data erasure process, and executes the process of step S102 described later.
[0143] On the other hand, in the case where it is determined in the process of step S99 that the number of valid blocks read out has decreased compared to the previous data erasure process (Yes in step S99), the erasure control unit 23 reads out the valid bitmap from the SIT area 154, compares the read valid bitmap with the valid bitmap at the time of the previous data erasure process, and determines the data blocks that have been logically erased (step S100).
[0144] The erasure control unit 23 moves the valid data within the block including the determined data block to another block, updates the L2P table 31 to map the physical address of the movement destination to the logical address of the moved valid data, and then performs a physical erasure of the data of the block including the determined data block (step S101). Thereby, the block including the data block determined in the process of step S100 can be released as a free block.
[0145] After that, the erasure control unit 23 determines whether the file systems of all partitions in the list have been determined (step S102). If it is determined that the file systems of all partitions in the list have not been determined yet (No in step S102), the erasure control unit 23 sets another partition in the list as the object and executes Figure 8 the process of step S41.
[0146] On the other hand, if it is determined that the file systems of all partitions in the list have been determined (Yes in step S102), the erasure control unit 23 ends the series of data erasure processes.
[0147] Figure 16 FIG. is a diagram showing the layout of the exFAT file system.
[0148] As Figure 16 shown, the exFAT file system is divided into three areas: a boot area 160, a file allocation table area (FAT area) 161, and a data area 162. The boot area 160 stores a boot sector and the like. The boot sector indicates, for example, the start cluster number of the root directory. The FAT representing the configuration in the data area 162 of the file is stored in the FAT area 161. In the data area 162, data is managed in units of clusters (clusts) composed of multiple sectors. The allocation bitmap indicating the usage status of the clusters is stored in the data area 162.
[0149] Figure 17 FIG. is a flowchart showing an example of the processing sequence executed when the file system for managing partitions is exFAT.
[0150] If it is determined in the process of step S64 Figure 10 shown that the file system of the partition to be managed is exFAT, the erasure control unit 23 reads the first sector from the boot area 160 (step S111). Then, the erasure control unit 23 reads the start cluster number of the root directory from the read first sector, and reads the root directory from the data area 162 with reference to the read start cluster number (step S112).
[0151] The erasure control unit 23 reads the allocation bitmap directory entry from the read root directory, and reads the allocation bitmap from the data area 162 with reference to the read allocation bitmap directory entry (step S113).
[0152] The erasure control unit 23 compares the read allocation bitmap with the allocation bitmap during the previous data erasure process, and determines whether there is a part where the bit corresponding to the cluster in the allocation bitmap has changed from 1 to 0 from the previous time to the present (step S114). When it is determined in the process of step S114 that there is no part that has changed from the previous time to the current time (No in step S114), the erasure control unit 23 determines that no logical erasure of data has been performed since the previous data erasure process, and executes the process of step S117 described later.
[0153] On the other hand, when it is determined in the process of step S114 that there is a part that has changed from the previous time to the current time (Yes in step S114), the erasure control unit 23 determines the cluster whose bit has changed from 1 to 0 as an invalid cluster that has undergone logical erasure of data (step S115). In addition, the allocation bitmap during the previous data erasure process is stored in an arbitrary temporary storage area such as the internal buffer 16 of the controller 4.
[0154] The erasure control unit 23 moves the valid clusters within the block including the determined invalid clusters to other blocks, updates the L2P table 31 to map the physical address of the movement destination to the logical addresses of the multiple valid data constituting the moved valid clusters, and then performs physical erasure of the data in the block including the determined invalid clusters (step S116). Thus, the block including the invalid clusters determined in the process of step S115 can be released as a free block.
[0155] After that, the erasure control unit 23 determines whether the file systems of all partitions in the list have been determined (step S117). When it is determined that the file systems of all partitions in the list have not been determined yet (No in step S117), the erasure control unit 23 sets another partition in the list as the object and executes Figure 8 the process of step S41.
[0156] On the other hand, when it is determined that the file systems of all partitions in the list have been determined (Yes in step S117), the erasure control unit 23 ends a series of data erasure processes.
[0157] Figure 18 is a diagram showing the layout of the file system FAT32.
[0158] As Figure 18 shown, the file system FAT32 is divided into three areas: a reserved area 170, a file allocation table area (FAT area) 171, and a data area 172. The boot sector and reserved sectors are stored in the reserved area 170. The reserved sectors indicate the number of sectors in the reserved area 170. The FAT indicating the configuration of the data area 172 of the file is stored in the FAT area 171. In the data area 172, data is managed in units of clusters composed of multiple sectors.
[0159] Figure 19 This is a flowchart showing an example of the processing sequence executed when the file system in the management partition is FAT32.
[0160] If it is determined in the processing of step S74 shown in Figure 11 that the file system of the partition to be managed is FAT32, the erasure control unit 23 reads the reservation sector from the reservation area 170 (step S121). Next, the erasure control unit 23 determines the start position of the FAT area 171 based on the number of sectors of the reservation area 170 indicated by the read reservation sector, and reads the FAT from the FAT area 171 (step S122).
[0161] The erasure control unit 23 compares the read FAT with the FAT at the time of the previous data erasure process, and determines whether there is a part that has changed from the previous time to the current time (step S123). If it is determined in the processing of step S123 that there is no part that has changed from the previous time to the current time (No in step S123), the erasure control unit 23 determines that no logical erasure of data has been performed since the previous data erasure process, and executes the processing of step S128 described later. In addition, the FAT at the time of the previous data erasure process is stored in an arbitrary temporary storage area such as the internal buffer 16 of the controller 4.
[0162] On the other hand, if it is determined in the processing of step S123 that there is a part that has changed from the previous time to the current time (Yes in step S123), the erasure control unit 23 reads the cluster chain from the read FAT (step S124), compares the read cluster chain with the cluster chain read from the FAT at the time of the previous data erasure process, and determines whether there is a part that has changed from 1 to 0 from the previous time to the current time, and determines whether there is an invalid cluster (step S125). If it is determined in the processing of step S125 that there is no invalid cluster (No in step S125), the erasure control unit 23 determines that no logical erasure of data has been performed since the previous data erasure process, and executes the processing of step S128 described later.
[0163] On the other hand, if it is determined in the processing of step S125 that there is an invalid cluster (Yes in step S125), the erasure control unit 23 moves the valid clusters in the block containing the invalid cluster to another block, updates the L2P table 31 to map the physical address of the movement destination to the logical addresses of the multiple valid data constituting the moved valid clusters, and then performs physical erasure of the data of the block containing the invalid cluster (step S126). Thereby, the block containing the invalid cluster determined in the processing of step S125 can be released as a free block.
[0164] The erasure control unit 23 saves the new FAT updated along with the physical erasure of data to the FAT area 171 (step S127).
[0165] After that, the erasure control unit 23 determines whether the file systems of all the partitions in the list have been determined (step S128). If it is determined that the file systems of all the partitions in the list have not been determined (No in step S128), the other partition in the list is set as the object and the Figure 8 processing of step S41 is executed.
[0166] On the other hand, if it is determined that the file systems of all the partitions in the list have been determined (Yes in step S128), the erasure control unit 23 ends the series of data erasure processes.
[0167] Here, the processing executed when an erasure request from the host 2 is received will be described with reference to Figure 20 the flowchart. The erasure request from the host 2 is a request including any one of the Discard command, the Trim command, and the Erase command. The erasure request includes at least a command code indicating that it is an erasure request and information on the block for physically erasing data (that is, information on the block to be released as a free block).
[0168] First, when the controller 4 of the SSD 3 receives an erasure request from the host 2 via the host interface 11 (step S131), it confirms whether the data erasure processing function of the erasure control unit 23 is enabled (step S132).
[0169] If it is confirmed in the processing of step S132 that the data erasure processing function of the erasure control unit 23 is not enabled (that is, is disabled) (No in step S132), the controller 4 physically erases the data of the block indicated by the information included in the received erasure request (step S133), and ends the processing here.
[0170] On the other hand, if it is confirmed in the processing of step S132 that the data erasure processing function of the erasure control unit 23 is enabled (Yes in step S132), the controller 4 uses the data erasure processing function of the erasure control unit 23 to determine the form of the partitions included in the NAND flash memory 5 and determine the type of the file system for managing the partitions, and then confirms the number of logically erased data from the last data erasure processing to the current time by the method according to the determined file system (step S134).
[0171] The controller 4 determines whether the number of logically erased data has exceeded a preset upper limit value (step S135). When it is determined in the process of step S135 that the number of logically erased data has exceeded the upper limit value (Yes in step S135), the controller 4 changes the data erasure processing function of the erasure control unit 23 from on to off (step S136), and then executes the process of step S133.
[0172] On the other hand, when it is determined in the process of step S135 that the number of logically erased data has not exceeded the upper limit value (No in step S135), the controller 4 does not perform physical erasure of the logically erased data at the next data erasure process of the erasure control unit 23 according to the erasure request from the host 2 (step S137), and ends the process here.
[0173] According to Figure 20 the processing shown, when the number of logically erased data exceeds the upper limit value, it can be considered that the physical erasure of data based on the data erasure processing function of the erasure control unit 23 takes time, and the physical erasure of data according to the erasure request from the host 2 is preferentially executed. On the other hand, when the number of logically erased data does not exceed the upper limit value, the physical erasure of data based on the data erasure processing function of the erasure control unit 23 is continued without following the erasure request from the host 2.
[0174] In addition, when performing physical erasure of data according to the erasure request from the host 2, the controller 4 turns off the data erasure processing function of the erasure control unit 23 and then performs physical erasure of data according to the erasure request from the host 2, so that the physical erasure of data can be executed without conflicting the erasure request from the host 2 and the data erasure processing function of the erasure control unit 23.
[0175] According to an embodiment described above, the erasure control unit 23 can monitor the state of the NAND flash memory 5 by determining the form of the partitions included in the NAND flash memory 5 and determining the type of the file system for managing the partitions. In addition, when the erasure control unit 23 detects logical erasure of data by monitoring the state of the NAND flash memory 5, it can determine where the logically erased data (invalid data) is stored by the method according to the determined file system, and perform physical erasure of the data.
[0176] Accordingly, even without an instruction from the host 2 and even if it is not the timing for performing GC, the SSD 3 can actively perform physical erasure of data, and thus can always suppress the occurrence of a situation where the storage area of the NAND flash memory 5 is wasted by invalid data and the storage area becomes insufficient. That is, the performance of the SSD 3 can be improved.
[0177] In addition, in the present embodiment, a NAND flash memory is exemplified as the non-volatile memory. However, the functions of the present embodiment can also be applied to various other non-volatile memories such as MRAM (Magnetoresistive Random Access Memory), PRAM (Phase change Random Access Memory), ReRAM (Resistive Random Access Memory), or FeRAM (Ferroelectric Random Access Memory).
[0178] Although some embodiments of the present invention have been described, these embodiments are presented by way of example and are not intended to limit the scope of the invention. These new embodiments can be implemented in various other ways, and various omissions, substitutions, and changes can be made without departing from the gist of the invention. These embodiments and their modifications are included in the scope and gist of the invention, and are included in the invention described in the claims and its equivalent scope.
Claims
1. A storage system capable of connecting to a host, wherein, Comprising: A non-volatile memory; And A controller, electrically connected to the non-volatile memory, configured to control the non-volatile memory, The controller has the following data erasure processing function: Based on the master boot record information stored in the non-volatile memory, determine the partition form of a predetermined partition included in the non-volatile memory, Based on the determined partition form, determine the first sector and the second sector of the predetermined partition, Based on the first information included in the first sector and the second information included in the second sector, determine the file system that manages the predetermined partition, In the case where logical erasure of data in the predetermined partition is detected by the method according to the determined file system, determine the first data that has been logically erased, and perform physical erasure of the first data, The controller reads out the superblock included in the second sector as the second information, and in the case where the magic number set at the first offset of the superblock represents the first value, determine the file system as the first file system, The first offset is 0x38, The first value is 0xEF53.
2. The storage system according to claim 1, wherein the controller reads out the extended BIOS parameter block included in the initial sector as the first information, and when the file system type set at the 4th offset of the extended BIOS parameter block indicates the fourth file system, determines the file system as the fourth file system.
3. The storage system according to claim 2, The 4th offset is 0x52.
4. The storage system according to claim 2, wherein if the controller determines that the file system is the fourth file system, it compares the current file allocation table with the previous file allocation table, and when there is a part that has changed from the previous to the current, detects the logical erasure of the data in the predetermined partition and performs the physical erasure of the first data.
5. The storage system according to claim 1, The controller can control the enabling and disabling of the data erasure processing function, When the controller receives an erasure request from the host and the data erasure processing function is enabled, it confirms the quantity of the first data logically erased in the predetermined partition from the previous data erasure processing to the current according to the method of the file system determined by the data erasure processing function, When the quantity of the first data exceeds a preset upper limit value, the controller controls the data erasure processing function from enabled to disabled and then performs the physical erasure of the first data according to the erasure request from the host. When the quantity of the first data does not exceed the upper limit value, the controller does not perform the erasure according to the erasure request from the host, but performs the physical erasure of the first data based on the data erasure processing function during the next data erasure process.
6. A storage system capable of being connected to a host, wherein, Comprising: A non-volatile memory; And A controller, electrically connected to the non-volatile memory, configured to control the non-volatile memory, The controller has the following data erasure processing function: Based on the master boot record information stored in the non-volatile memory, determine the partition form of a predetermined partition included in the non-volatile memory, Based on the determined partition form, determine the first sector and the second sector of the predetermined partition, Based on the first information included in the first sector and the second information included in the second sector, determine the file system that manages the predetermined partition, In the case where logical erasure of data in the predetermined partition is detected by the method according to the determined file system, determine the first data that has been logically erased, and perform physical erasure of the first data, The controller reads out the superblock included in the second sector as the second information, and in the case where the magic number set at the first offset of the superblock represents the first value, determine the file system as the first file system, If the controller determines that the file system is the first file system, determine the current number of free inodes and the number of free blocks, and in the case where their values increase compared to the previous values, detect logical erasure of data in the predetermined partition, and perform physical erasure of the first data.
7. A storage system capable of being connected to a host, wherein, Comprising: A non-volatile memory; And A controller, electrically connected to the non-volatile memory, configured to control the non-volatile memory, The controller has the following data erasure processing function: Based on the master boot record information stored in the non-volatile memory, determine the partition form of a predetermined partition included in the non-volatile memory, Based on the determined partition form, determine the first sector and the second sector of the predetermined partition, Determine the file system for managing the predetermined partition based on the first information included in the initial sector and the second information included in the second sector. In the case where logical erasure of data in the predetermined partition is detected by the method of the determined file system, determine the first data that has been logically erased and perform physical erasure of the first data. The controller reads the superblock included in the second sector as the second information. In the case where the magic number set at the second offset of the superblock represents a second value, determine the file system as the second file system. If the controller determines that the file system is the second file system, determine the current number of valid inodes, valid nodes, and valid blocks. In the case where their values are less than the previous values, detect logical erasure of data in the predetermined partition and perform physical erasure of the first data.
8. A storage system capable of being connected to a host, wherein, Comprising: A non-volatile memory; And A controller, electrically connected to the non-volatile memory and configured to control the non-volatile memory. The controller has the following data erasure processing function: Determine the partition form of a predetermined partition included in the non-volatile memory based on the master boot record information stored in the non-volatile memory. Determine the initial sector and the second sector of the predetermined partition based on the determined partition form. Determine the file system for managing the predetermined partition based on the first information included in the initial sector and the second information included in the second sector. In the case where logical erasure of data in the predetermined partition is detected by the method of the determined file system, determine the first data that has been logically erased and perform physical erasure of the first data. The controller reads the file system name set at the third offset of the initial sector as the first information. In the case where the file system name represents the third file system, determine the file system as the third file system. The third offset is 0x03.
9. The storage system according to claim 8, If the controller determines that the file system is the third file system, it compares the current allocation bitmap with the previous allocation bitmap. When there is a part where the bit corresponding to the cluster changes from 1 to 0 from the previous time to the current time, it detects the logical erasure of the data in the predetermined partition and performs the physical erasure of the first data.
10. A storage system capable of being connected to a host, wherein, Comprising: A non-volatile memory; And A controller, electrically connected to the non-volatile memory and configured to control the non-volatile memory. The controller has the following data erasure processing function: Determine the partition form of a predetermined partition included in the non-volatile memory based on the master boot record information stored in the non-volatile memory. Determine the initial sector and the second sector of the predetermined partition based on the determined partition form. Determine the file system for managing the predetermined partition based on the first information included in the initial sector and the second information included in the second sector. In the case where logical erasure of data in the predetermined partition is detected by the method of the determined file system, determine the first data that has been logically erased and perform physical erasure of the first data. The controller reads out the superblock included in the second sector as the second information, and determines the file system as the second file system when the magic number set at the second offset of the superblock represents the second value. The second offset is 0x00. The second value is 0xF2F52010.
Citation Information
Patent Citations
Game machine
JP2021049374A
File system
CN101529395A
Memory device and computer system
CN110321065A