Metadata rebuild in a flash memory controller following a loss of power
First Claim
Patent Images
1. A method of rebuilding metadata used in a flash memory controller following a loss of power, comprising:
- copying metadata information from flash memory to volatile memory, the metadata information including metadata regarding a first block in flash memory and logical addresses for a sequence of physical locations in flash memory;
in accordance with the copied metadata information, storing a plurality of metadata tables in the volatile memory, the plurality of metadata tables including;
a first table containing metadata concerning one or more respective blocks, including the first block, and logical addresses for the sequence of physical locations in flash memory, anda second table containing metadata that includes physical location information in flash memory for each of a sequence of logical addresses;
in accordance with metadata in the first table, determining whether the first block in flash memory was closed when the power loss occurred; and
in accordance with a determination that the first block was closed when the power loss occurred;
reading from the first table a logical address for the first block;
determining from the second table whether the logical address corresponds to a second block that is a different block than the first block;
in accordance with a determination that the logical address corresponds to a second block that is a different block than the first block, comparing time stamps related, respectively, to the first block and the second block;
in accordance with a determination, based on the comparison, that data in the first block was written earlier than data in the second block, setting a first valid bit in the plurality of metadata tables to a state indicating that the data in the first block is invalid, andin accordance with a determination, based on the comparison, that the data in the first block was written later than data in the second block, setting a second valid bit in volatile memory to a state indicating that data in the second block is invalid.
2 Assignments
0 Petitions
Accused Products
Abstract
A method of rebuilding metadata in a flash memory controller following a loss of power is provided. The method includes reading logical address information associated with an area of flash memory, and using time stamp information to determine if data stored in the flash memory area are valid.
-
Citations
18 Claims
-
1. A method of rebuilding metadata used in a flash memory controller following a loss of power, comprising:
-
copying metadata information from flash memory to volatile memory, the metadata information including metadata regarding a first block in flash memory and logical addresses for a sequence of physical locations in flash memory; in accordance with the copied metadata information, storing a plurality of metadata tables in the volatile memory, the plurality of metadata tables including; a first table containing metadata concerning one or more respective blocks, including the first block, and logical addresses for the sequence of physical locations in flash memory, and a second table containing metadata that includes physical location information in flash memory for each of a sequence of logical addresses; in accordance with metadata in the first table, determining whether the first block in flash memory was closed when the power loss occurred; and in accordance with a determination that the first block was closed when the power loss occurred; reading from the first table a logical address for the first block; determining from the second table whether the logical address corresponds to a second block that is a different block than the first block; in accordance with a determination that the logical address corresponds to a second block that is a different block than the first block, comparing time stamps related, respectively, to the first block and the second block; in accordance with a determination, based on the comparison, that data in the first block was written earlier than data in the second block, setting a first valid bit in the plurality of metadata tables to a state indicating that the data in the first block is invalid, and in accordance with a determination, based on the comparison, that the data in the first block was written later than data in the second block, setting a second valid bit in volatile memory to a state indicating that data in the second block is invalid. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8, 9)
-
-
10. A memory controller comprising:
-
one or more processors, each including an arithmetic logic unit and control logic that controls operations of the arithmetic logic unit (ALU); memory; instructions, stored in memory and configured to be executed by the one or more processors, that when executed by the one or more processors cause the non-volatile memory controller to; copy metadata information from flash memory to volatile memory, the metadata information including metadata regarding a first block in flash memory and logical addresses for a sequence of physical locations in flash memory; in accordance with the copied metadata information, store a plurality of metadata tables in the volatile memory, the plurality of metadata tables including; a first table containing metadata concerning one or more respective blocks, including the first block, and logical addresses for the sequence of physical locations in flash memory, and a second table containing metadata that includes physical location information in flash memory for each of a sequence of logical addresses; in accordance with metadata in the first table, determine whether the first block in flash memory was closed when the power loss occurred; and in accordance with a determination that the first block was closed when the power loss occurred; read from the first table a logical address for the first block; determine from the second table whether the logical address corresponds to a second block that is a different block than the first block; in accordance with a determination that the logical address corresponds to a second block that is a different block than the first block, compare time stamps related, respectively, to the first block and the second block; in accordance with a determination, based on the comparison, that data in the first block was written earlier than data in the second block, set a first valid bit in the plurality of metadata tables to a state indicating that the data in the first block is invalid, and in accordance with a determination, based on the comparison, that the data in the first block was written later than data in the second block, set a second valid bit in volatile memory to a state indicating that data in the second block is invalid. - View Dependent Claims (11, 12, 13, 14, 15, 16, 17, 18)
-
Specification