Flash memory file system
AssigneeSamsung Electronics Co., Ltd.
InventorHo-sung Hwang
Life of this patent
Estimating the term…
Abstract
Provided is a file system for effectively using a flash memory. The file system includes a meta block for storing various file information, a data block where data is really stored, and an info block for storing information on the data block. Unlike the conventional method, the file system is designed not to allow one file to use a particular memory region, therefore it prevents a particular block in the flash memory from wearing at a faster rate than the other blocks. Further, the file system provides an effect of wear leveling of all blocks in the flash memory by using the entire memory region uniformly.
Claims16
A method for storing files in a flash memory, the method comprising;
- (a) receiving a file name of an input file, contents of the input file which will be stored in the flash memory and a file storing command which will be stored in the flash memory;
- (b) outputting file management information used in managing the input file, and allocating a meta block for storing the file management information;
- (c) storing the file management information in the allocated meta block;
- (d) allocating an info block which corresponds to the allocated meta block, the info block for storing data block management information for managing the data block wherein the input contents of the file are stored;
- and
- (e) storing the input contents of the input file in the data block corresponding to the info block.
A method for reading files in a flash memory, the method comprising:
- (a) receiving file management information including file name information of the files read from files stored in a flash memory;
- (b) searching a meta block where file management information on the stored files is recorded using the file names, and an info block containing file management information on the stored files in connection with position information on the data block where data is stored, and detecting file management information on a file to be read and position information on the data block where data of the file to be read is stored;
- and
- (c) outputting data of the file to be read from the data block corresponding to the position information.
A method for replacing blocks in a flash file system, the method comprising:
- (a) receiving a name and contents of a file to be corrected along with a command for correcting the contents of the file;
- (b) allocating a meta block where file name information on an input file, file size information, file logical address information, information on whether a meta block is in use, and information indicating if the meta block is invalid, a data block where the contents of a file is to be actually stored, and an info block where position information on the data block is stored;
- (c) recording the information indicating that the meta block corresponding to the received file name is invalid, and the information indicating that the data block corresponding to the meta block is invalid;
- and
- (d) storing contents and management information on input files in a newly allocated meta block, data block, and info block.
A method for garbage collection in a flash file system, the method comprising:
- (a) reading and storing the contents of a currently used meta block and a data block in a temporary storing place if there exist no more meta blocks and data blocks to be allocated, while a meta block for storing file name information on a file to be stored, file size information, file logic address information, information of whether a meta block is in use or not, and information that the meta block is invalid, and a data block in which contents of a file are actually stored;
- (b) deleting invalid contents in a meta block and a data block by reading an info block having information that the meta block is invalid and the data block is no longer effective;
- and
- (c) reading data stored in the temporary storing place and rewriting the data in the deleted meta block and the deleted data block.
A recording medium for storing the a computer-readable program for enabling a computer to perform a process of storing files in a flash memory, the process comprising:
- (a) receiving a file name of an input file, contents of the input file which will be stored in the flash memory and a file storing command which will be stored in the flash memory;
- (b) outputting file management information used in managing the input file, and allocating a meta block for storing the file management information;
- (c) storing the file management information in the allocated meta block;
- (d) allocating an info block which corresponds to the allocated meta block, the info block for storing data block management information for managing the data block wherein the input contents of the file are stored;
- and
- (e) storing the input contents of the input file in the data block corresponding to the info block.
A flash file system management device comprising:
- a block searching unit for searching a meta block containing file name information on a file to be stored, file size information, file logical addresses information, information on whether a meta block is in use, and information indicating if a meta block is invalid, and for searching a data block where the contents of a file are to be actually stored;
- a block allocation unit for searching and allocating a meta block and a data block which can be used according to the searching results of the searching unit, the searched and allocated meta block corresponding to an info block which stores information of the searched data block;
- a reading function performer for searching a meta block where the file name information read in the searching unit is stored, reading an info block corresponding to the meta block, and reading the contents from a physical block where data is actually stored;
- a writing function performer for performing write operations of the file to be stored in the meta block, the info block and the data block allocated by the block allocation unit;
- a block replacement function performer for exchanging the meta block and the data block where the contents of a file to be corrected are written with a new meta block and a new data block in a case that a file correction command is performed in the write function performer;
- and
- a garbage collection performer for deleting all invalid contents of the meta block, the data block, and the info block, if there does not exist availability to allocate the new meta block and the new data block by the block allocation unit.
A flash file system data structure comprising:
- a meta block for storing file management information which is information for managing files recorded in a flash memory;
- an info block which corresponds to the file management information and stores management information on a block where the contents of a file is stored;
- and
- a data block which corresponds to the management information stored in the info block and stores the contents of the file.
Dependencies are inferred from the claim text.