CN101789004B - Rapid-start method and device of Flash file system - Google Patents
Rapid-start method and device of Flash file system Download PDFInfo
- Publication number
- CN101789004B CN101789004B CN2010101005235A CN201010100523A CN101789004B CN 101789004 B CN101789004 B CN 101789004B CN 2010101005235 A CN2010101005235 A CN 2010101005235A CN 201010100523 A CN201010100523 A CN 201010100523A CN 101789004 B CN101789004 B CN 101789004B
- Authority
- CN
- China
- Prior art keywords
- file system
- piece
- flash file
- data
- snapshot
- Prior art date
- Legal status (The legal status 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 status listed.)
- Expired - Fee Related
Links
- 238000000034 method Methods 0.000 title claims abstract description 38
- 230000006870 function Effects 0.000 claims description 6
- 239000007858 starting material Substances 0.000 claims description 2
- 238000010586 diagram Methods 0.000 description 4
- 230000008569 process Effects 0.000 description 4
- 230000007246 mechanism Effects 0.000 description 3
- 230000001133 acceleration Effects 0.000 description 2
- 230000008901 benefit Effects 0.000 description 2
- 238000000151 deposition Methods 0.000 description 2
- 238000005516 engineering process Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 238000004364 calculation method Methods 0.000 description 1
- 238000006243 chemical reaction Methods 0.000 description 1
- 238000005457 optimization Methods 0.000 description 1
- 230000008520 organization Effects 0.000 description 1
- 238000012797 qualification Methods 0.000 description 1
- 238000011084 recovery Methods 0.000 description 1
Images
Landscapes
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
- Techniques For Improving Reliability Of Storages (AREA)
- Memory System Of A Hierarchy Structure (AREA)
- Retry When Errors Occur (AREA)
Abstract
The invention discloses a rapid-start method and device of a Flash file system. The method comprises a journal recording step, a snapshot storing step and a starting step, wherein the journal recording step is to perform journal recording using block as unit in the Flash file system; the snapshot storing step is to store snapshot data in an independent block so as to separate snapshot data from the data of the file system; and the starting step is to directly read snapshot and build the related information of the file system in system internal storage when effective snapshot exists in the file system and to read journal in each block and build the related information of the file system in system internal storage when effective snapshot does not exist in the file system.
Description
Technical field
The present invention relates to Flash storage system field, particularly relate to a kind of quick start method and device of Flash File System.
Background technology
Flash also claims flash memory, is the form that a kind of electronic type can be wiped programmable read-only memory, allows in operation by the storer of repeatedly wiping or writing.Since coming out, Flash obtains extensive concern with characteristics such as its low-power consumption, non-volatile and anti-vibration resistances, and is applied in large quantities in embedded and the mobile unit.Moreover owing to technology progress, cost descend, Flash has much the trend that replaces traditional magnetic disk in many instances.A lot of Flash of employing make up the scheme of High Performance Cache and Memory System and corresponding being suggested of method of file system design and optimization.
Than disk, Flash has following outstanding feature.The first, Flash is made up of several pieces, and several pages or leaves are arranged again in each piece; The second, Flash has reading and writing and wipes three kinds of basic operations, and before rewriteeing, must wipe earlier, and writing in addition is to be unit with the page or leaf, and wiping then is to be unit with the piece; The 3rd, but being maximum erasing times by its piece, determines in the life-span of Flash, wipe above the piece of this number of times and can not use again, so need consider the loss balancing problem, promptly erase operation is balanced in each piece as far as possible.
Since these characteristics of Flash self, the feasible existing advantage that can not bring into play Flash based on the file system of disk well.Current Flash File System solution generally has two kinds: adopt conversion layer that Flash is modeled to block device, adapted is with traditional file systems again; Another kind of scheme is the design special Flash File System.Being in the system of secondary storage devices with Flash, use special-purpose Flash File System usually.Flash File System does not have stated among this paper, all refers to special-purpose Flash File System.Flash File System adopts log-structured file system usually, realizes the strange land update strategy.During system start-up, must scan the content on the Flash, in internal memory, set up index of metadata information.Along with the increase of Flash capacity, the content scanning process becomes the principal element of system start-up performance.Thus, two kinds of solutions of snapshot and daily record are suggested, and the independent application of these two kinds of strategies all can accelerating system start, but still has some limitation.
As shown in Figure 1, several pieces (block) are arranged among the Flash, each piece is made up of several pages or leaves (page) again; Owing to must wipe earlier before rewriteeing; And write is to be unit with the page or leaf; Wiping is to be unit with the piece, so the Flash dedicated file system is generally realized the strange land update strategy, promptly elder generation does not wipe the page or leaf that will upgrade but distributes a blank page to write data in addition when data need be upgraded; And the footers of correspondence was inefficacy (Invalid) originally, and the I that promptly page or leaf is remembered before among Fig. 1 indicates.
Daily record and snapshot are the strategies commonly used that is used for system recovery, and these data do not belong to file system itself, just help when system start-up, in internal memory, to set up fileinfo fast, are referred to as log-on message.Wherein snapshot is meant the file system organization structural information is directly left on the memory device, when file system normally unloads, when having effective snapshot, can be only reads just load document system effectively of snapshot through the I/O operation.But when system because accident power-off, when not having effective snapshot, must set up fileinfo in scanning entire flash space during system restart.Though existing daily record strategy can effectively solve the accident power-off problem, all lastest imformations in the log tracks register system under any circumstance start and all need read daily record also could be set up file system through calculation process organizational information earlier.Therefore for the situation of the normal unloading of system, the performance of daily record strategy is slightly poorer than snapshot policy.
Further, log-on message is to leave concentratedly in some specific piece mostly in existing strategy, and this can cause loss unbalanced.Even existing some algorithm can leave log-on message on any page or leaf among the Flash in; But because these log-on messages do not have consistent validity with the file system data of being deposited in same, just easy wiping because of needs realization piece caused repeatedly invalid moving.
Summary of the invention
Technical matters to be solved by this invention is, a kind of quick start method and device of Flash File System is provided, and can accelerate the toggle speed of Flash File System, can realize the loss balancing of Flash again.
For achieving the above object, the quick start method of Flash File System of the present invention comprises:
The log record step, being used at said Flash File System is that unit carries out log record with the piece;
Snapshot is deposited step, is used for leaving snapshot data in independently piece, so that snapshot data separates with file system data;
Setting up procedure is used for when there is effective snapshot in said file system, directly reading snapshot, in Installed System Memory, makes up the relevant information of file system; When not having effective snapshot in the file system, from each piece, read daily record, in Installed System Memory, make up the relevant information of said file system.
The quick start method of above-mentioned Flash File System; It is characterized in that; In the said log record step; With the piece be unit to carry out log record be to deposit said file system data through some pages or leaves of getting in the piece, remaining some page or leaf is deposited lastest imformations of the file system data of this page in this piece.
The quick start method of above-mentioned Flash File System; It is characterized in that, also comprise one when piece is carried out write operation, in Installed System Memory, distribute the step of a block cache; Be used for when carrying out write operation said; Earlier its log record is buffered in the internal memory, after having upgraded, again the daily record in the buffer memory is write back in this piece.
The quick start method of above-mentioned Flash File System is characterized in that, said is unit when carrying out log record with the piece, deposits the size decision by this piece of ratio that the page or leaf of daily record belongs in this piece.
The quick start method of above-mentioned Flash File System is characterized in that, Data Update is arranged in piece, and in the time of need wiping a piece, the log record in this piece will become invalid page, does not carry out copy function; After effective page in this piece is moved new data block, with the lastest imformation that generates new log record file system.
The quick start method of above-mentioned Flash File System is characterized in that, said snapshot is independently deposited in the step, and the shared piece of snapshot data is the optional position among the Flash.
The quick start method of above-mentioned Flash File System is characterized in that, when said file system normally unloads, preserves the snapshot data of this document system.
Further, the present invention also provides a kind of starter gear of realizing the quick start method of above-mentioned Flash File System, comprising:
Logger module, being used at said Flash File System is that unit carries out log record with the piece;
The snapshot storage module is used for leaving snapshot data in independently piece, so that snapshot data separates with file system data;
Start module, be used for when there is effective snapshot in said file system, directly reading snapshot, in Installed System Memory, make up the relevant information of file system; When not having effective snapshot in the file system, from each piece, read daily record, in Installed System Memory, make up the relevant information of said file system.
The device for rapidly starting of above-mentioned Flash File System; It is characterized in that; In the said logger module; With the piece be unit to carry out log record be to deposit said file system data through some pages or leaves of getting in the piece, remaining some page or leaf is deposited lastest imformations of the file system data of this page in this piece.
The device for rapidly starting of above-mentioned Flash File System is characterized in that, when leaving in independently snapshot data in the piece, the shared piece of snapshot data is the optional position among the Flash.
Compared with prior art, strategy of the present invention can be applied on existing multiple Flash File System basis, not only can start Flash File System fast, and can effectively realize loss balancing.It has following characteristics with respect to prior art:
1) in file system, preserves snapshot, the quick startup after guaranteeing normally to unload;
2) application log mechanism in file system, the quick startup behind the realization system accident power-off;
3) make each block balance storage log-on data, to realize the loss balancing of Flash as far as possible.
Description of drawings
Fig. 1 is the basic memory model of Flash;
Fig. 2 is the process flow diagram of the quick start method of Flash File System of the present invention;
Fig. 3 is for realizing the memory model of Flash File System of the present invention;
Fig. 4 is for being the log recording method synoptic diagram of unit with the piece among the present invention;
Fig. 5 is the deposit method synoptic diagram of snapshot among the present invention;
Fig. 6 is the structured flowchart of the device for rapidly starting of Flash File System of the present invention.
Embodiment
Describe the present invention below in conjunction with accompanying drawing and specific embodiment, with further understanding the present invention's purpose, scheme and effect, but not as to qualification of the present invention.
The quick start method of Flash File System of the present invention has combined the advantage of existing daily record strategy and snapshot policy, realizes under the situation such as normal unloading of file system or accident power-off, all the effective start-up course of accelerating system.
Fig. 2 is the process flow diagram of the quick start method of Flash File System of the present invention, and with reference to figure 2, the quick start method of Flash File System of the present invention comprises:
Step S10: in Flash File System, be that unit carries out log record with the piece;
Step S20: snapshot data is left in independently in the piece, deposit so that snapshot data separates with file system data;
Step S30: when having effective snapshot in the said file system, directly read snapshot, in Installed System Memory, make up the relevant information of file system; When not having effective snapshot in the file system, from each piece, read daily record, in Installed System Memory, make up the relevant information of said file system.
In above-mentioned steps S10, during the lastest imformation of log file system, distribute a block cache in the internal memory, buffer memory is to the modification information of piece file system, and renewal writes back the daily record data in the buffer memory among the Flash after accomplishing, to reduce the renewal operation to Flash.Using of the present invention is the log record mode of unit with the piece; Data Update is arranged in piece; In the time of need wiping a piece, the log record in the piece will become invalid page, need not carry out copy function; After effective page in the piece is moved new data block, with the lastest imformation that generates new log record file system.
In above-mentioned steps S20, when the file system of using quick start method of the present invention normally unloads, preserve the snapshot data of file system.
Fig. 3 specifies storage mode in the Flash File System of the present invention for adopting the memory model of Flash File System of the present invention below in conjunction with accompanying drawing.With reference to figure 3; Flash 30 comprises several pieces; Block 301, Block 302, Block 303 only are shown among the figure; Wherein in each piece, get wherein some pages or leaves according to the size of concrete piece and be used for store files system data FS Date, the daily record Log that it is file system data that remaining some page or leaf is deposited this piece file lastest imformation.Snapshot data is independently to exist among the Block 302, and the scope of depositing of snapshot data of the present invention is not set in some specific piece certainly, and the shared piece of snapshot data can be the optional position among the Flash30.
The quick startup strategy of Flash File System of the present invention adopts is that the log recording method of unit is as shown in Figure 4 again with the piece; Several pages or leaves 401 of front are used for store files system data FSDate in the piece 40; Follow-up several page or leaf 402 is deposited the lastest imformations of file data in 401 scopes, 402 in piece 40 proportion by the size decision of piece 40.Among the present invention, when the lastest imformation of log file system, distribute a block cache 403 in the internal memory, when carrying out write operation to 401, its log record is buffered in the internal memory, after having upgraded 401, the daily record in the buffer memory is write back in 402.Described is in the log recording method of unit with the piece, wipes a piece like need, and log record 402 will all become invalid page, need not carry out copy function.After effective page in the piece is moved new data block, generate the lastest imformation of new log record file.This kind is the log recording method of unit with the piece, with realization Flash loss balancing, and avoids unnecessary data to move.
Fig. 5 has further illustrated the present invention to adopt independently snapshot deposit method.As shown in Figure 5; In Flash50, the piece 502 that snapshot data is shared separates with file system data piece 501,503 etc., and snapshot data Snapshot leaves in independently in the piece 502; And this piece 502 of depositing snapshot data can be the optional position among the Flash50, to realize loss balancing.
The present invention further provides a kind of device of realizing said method, and with reference to figure 6, the device for rapidly starting 60 of Flash File System of the present invention comprises: logger module 601, and being used at Flash File System is that unit carries out log record with the piece; Snapshot storage module 602 is used for leaving snapshot data in independently piece, so that snapshot data separates with file system data; Start module 603, be used for when there is effective snapshot in file system, directly read snapshot, in Installed System Memory, make up the relevant information of file system; When not having effective snapshot in the file system, from each piece, read daily record, in Installed System Memory, make up the relevant information of said file system.Above-mentioned logger module 601; When the lastest imformation of log file system, distribute a block cache in the internal memory, buffer memory is to the modification information of piece file system; After upgrading completion the daily record data in the buffer memory is write back among the Flash, to reduce renewal operation Flash.Logger module of the present invention is the log record mode of unit with the piece; Data Update is arranged in piece; In the time of need wiping a piece, the log record in the piece will become invalid page, need not carry out copy function; After effective page in the piece is moved new data block, with the lastest imformation that generates new log record file system.Quote the present invention and start tactful file system fast when normal unloading, above-mentioned snapshot storage module 602 will be preserved the snapshot data of file system.
To sum up, the quick startup strategy of Flash File System of the present invention, the form that adopts snapshot to combine with daily record reduces the startup cost of Flash File System, and adopts and reasonably deposit strategy realization loss balancing.Wherein, adopt snapshot mechanism, guarantee the quick startup when file system normally unloads; Adopt log mechanism, the start-up course behind the acceleration Flash File System accident power-off; To Flash characteristic store data reasonably, realize loss balancing.The present invention has realized the acceleration to start-up course behind normal unloading of Flash File System and the accident power-off, and satisfies the loss balancing demand of Flash File System, and the performance after the system start-up is not had obvious influence.
Though the present invention discloses as above with a preferred embodiment; Right its is not in order to limit the present invention; Under the situation that does not deviate from spirit of the present invention and essence thereof; Those of ordinary skill in the art work as can make various corresponding changes and distortion according to the present invention, but these corresponding changes and distortion all should belong to the protection domain of the appended claim of the present invention.
Claims (6)
1. the quick start method of a Flash File System is characterized in that, comprising:
The log record step; Being used at this Flash File System is that unit carries out log record with the piece; Be that to carry out log record be to deposit the Flash File System data through some pages or leaves of getting in the piece in unit with the piece; The size decision of page ratio shared in this piece of daily record by this piece deposited in the daily record that remaining some page or leaf is deposited the Flash File System data in this piece;
Snapshot is deposited step, is used for leaving snapshot data in independently piece, so that snapshot data and this Flash File System data separating;
Setting up procedure is used for when there is snapshot data in this Flash File System, directly reading snapshot data, in Installed System Memory, makes up the relevant information of this Flash File System; When not having snapshot data in this Flash File System, from each piece, read daily record, in Installed System Memory, make up the relevant information of this Flash File System;
Wherein, Data Update is arranged in piece, in the time of need wiping a piece, the daily record in this piece will become invalid page, not carry out copy function; This Flash File System data-moving in this piece is after new data block, with the lastest imformation that generates new this Flash File System of log record.
2. the quick start method of Flash File System according to claim 1; It is characterized in that, also comprise one when piece is carried out write operation, in Installed System Memory, distribute the step of a block cache; Be used for when carrying out write operation said; Elder generation in internal memory, after having upgraded, writes back to its log buffer in this piece with the daily record in the buffer memory again.
3. the quick start method of Flash File System according to claim 1 is characterized in that, said snapshot is deposited in the step, and the shared piece of snapshot data is the optional position among the Flash.
4. the quick start method of Flash File System according to claim 1 is characterized in that, when said Flash File System normally unloads, preserves the snapshot data of this Flash File System.
5. a starter gear of realizing the quick start method of each described Flash File System in the aforesaid right requirement 1~4 is characterized in that, comprising:
Logger module; Being used at this Flash File System is that unit carries out log record with the piece; Be that to carry out log record be to deposit the Flash File System data through some pages or leaves of getting in the piece in unit with the piece; The size decision of page ratio shared in this piece of daily record by this piece deposited in the daily record that remaining some page or leaf is deposited the Flash File System data in this piece;
The snapshot storage module is used for leaving snapshot data in independently piece, so that snapshot data and this Flash File System data separating;
Start module, be used for when there is snapshot data in this Flash File System, directly reading snapshot data, in Installed System Memory, make up the relevant information of this Flash File System; When not having snapshot data in this Flash File System, from each piece, read daily record, in Installed System Memory, make up the relevant information of this Flash File System;
Wherein, Data Update is arranged in piece, in the time of need wiping a piece, the daily record in this piece will become invalid page, not carry out copy function; This Flash File System data-moving in this piece is after new data block, with the lastest imformation that generates new this Flash File System of log record.
6. the device for rapidly starting of Flash File System according to claim 5 is characterized in that, when leaving in independently snapshot data in the piece, the shared piece of snapshot data is the optional position among the Flash.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN2010101005235A CN101789004B (en) | 2010-01-22 | 2010-01-22 | Rapid-start method and device of Flash file system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN2010101005235A CN101789004B (en) | 2010-01-22 | 2010-01-22 | Rapid-start method and device of Flash file system |
Publications (2)
Publication Number | Publication Date |
---|---|
CN101789004A CN101789004A (en) | 2010-07-28 |
CN101789004B true CN101789004B (en) | 2012-07-18 |
Family
ID=42532220
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN2010101005235A Expired - Fee Related CN101789004B (en) | 2010-01-22 | 2010-01-22 | Rapid-start method and device of Flash file system |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN101789004B (en) |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102053879A (en) * | 2010-12-16 | 2011-05-11 | 国网电力科学研究院 | Self-recovery real-time file system based on FLASH |
CN109189480B (en) * | 2018-07-02 | 2021-11-09 | 新华三技术有限公司成都分公司 | File system starting method and device |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1162782C (en) * | 2001-08-03 | 2004-08-18 | 华为技术有限公司 | Processing method of rapid memory file |
KR20070096429A (en) * | 2006-03-24 | 2007-10-02 | 부산대학교 산학협력단 | Fast mounting for a file system on nand flash memory |
CN101488153A (en) * | 2009-02-12 | 2009-07-22 | 浙江大学 | Method for implementing high-capacity flash memory file system in embedded type Linux |
-
2010
- 2010-01-22 CN CN2010101005235A patent/CN101789004B/en not_active Expired - Fee Related
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1162782C (en) * | 2001-08-03 | 2004-08-18 | 华为技术有限公司 | Processing method of rapid memory file |
KR20070096429A (en) * | 2006-03-24 | 2007-10-02 | 부산대학교 산학협력단 | Fast mounting for a file system on nand flash memory |
CN101488153A (en) * | 2009-02-12 | 2009-07-22 | 浙江大学 | Method for implementing high-capacity flash memory file system in embedded type Linux |
Non-Patent Citations (2)
Title |
---|
彭福石.NAND文件系统的研究.《中国优秀硕士学位论文全文数据库 信息科技辑》.2009,摘要,第14页,第20页,第30-31页,第33-34页. * |
王健 等.JFFS2文件系统存储策略研究.《微计算机信息》.2008,第24卷(第8期),第68-69页,第83页. * |
Also Published As
Publication number | Publication date |
---|---|
CN101789004A (en) | 2010-07-28 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US9940261B2 (en) | Zoning of logical to physical data address translation tables with parallelized log list replay | |
CN103577121B (en) | A kind of highly reliable linear file access method based on Nand Flash | |
CN102622309B (en) | Data security erase method and device | |
CN101923448B (en) | Method for reading and writing conversion layer of NAND flash memory | |
CN103049349B (en) | Based on Snapshot Method and the system of Bedding storage | |
US8650379B2 (en) | Data processing method for nonvolatile memory system | |
US20140006687A1 (en) | Data Cache Apparatus, Data Storage System and Method | |
CN101369252A (en) | Method for static data loss equalization based on NAND flash memory file system | |
CN102567146B (en) | Log backup method and device and smart card | |
CN102521260B (en) | Data preheating method and device | |
CN103106047A (en) | Storage system based on object and storage method thereof | |
CN103034592B (en) | Data processing method and device | |
CN101702139B (en) | Method and device for accessing data of Nand flash memory | |
CN102841851A (en) | Flash memory management method and flash memory device | |
US20180107601A1 (en) | Cache architecture and algorithms for hybrid object storage devices | |
CN103996412A (en) | Power-fail protection method applied to intelligent-card nonvolatile memories | |
CN102902566A (en) | Method and device for installing and starting application software | |
CN110347613A (en) | Method, controller and the multi-tenant solid-state disk of RAID are realized in multi-tenant solid-state disk | |
CN103268291A (en) | Method for delaying persistent indexing metadata in flash memory storage system | |
CN101364437A (en) | Method capable of loss equalization of flash memory and application thereof | |
CN103092849A (en) | File system cluster management method | |
CN104376099A (en) | Flash-memory-based file system implementation method and device | |
CN101789004B (en) | Rapid-start method and device of Flash file system | |
CN101819821B (en) | Dynamic loss balancing method for solid state disk | |
CN101324899B (en) | Method for rapidly writing NAND type FLASH |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
C14 | Grant of patent or utility model | ||
GR01 | Patent grant | ||
C17 | Cessation of patent right | ||
CF01 | Termination of patent right due to non-payment of annual fee |
Granted publication date: 20120718 Termination date: 20140122 |