JP2018037030A - Fat file system and program thereof - Google Patents

Fat file system and program thereof Download PDF

Info

Publication number
JP2018037030A
JP2018037030A JP2016172170A JP2016172170A JP2018037030A JP 2018037030 A JP2018037030 A JP 2018037030A JP 2016172170 A JP2016172170 A JP 2016172170A JP 2016172170 A JP2016172170 A JP 2016172170A JP 2018037030 A JP2018037030 A JP 2018037030A
Authority
JP
Japan
Prior art keywords
file
information
fat
management
area
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.)
Granted
Application number
JP2016172170A
Other languages
Japanese (ja)
Other versions
JP6644427B2 (en
Inventor
征洋 和田
Yukihiro Wada
征洋 和田
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Toshiba Information Systems Japan Corp
Original Assignee
Toshiba Information Systems Japan Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Toshiba Information Systems Japan Corp filed Critical Toshiba Information Systems Japan Corp
Priority to JP2016172170A priority Critical patent/JP6644427B2/en
Publication of JP2018037030A publication Critical patent/JP2018037030A/en
Application granted granted Critical
Publication of JP6644427B2 publication Critical patent/JP6644427B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Retry When Errors Occur (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

PROBLEM TO BE SOLVED: To return a file system in an original state even if power is interrupted when updating a file.SOLUTION: FAT management means 11 performs management of files in a recording medium by using management information provided on a file control area, including a piece of information on head cluster number of each cluster having one file stored, a piece of information on a data cluster chain for the number of clusters concerning clusters each having one file stored and a piece of information on the number of unused cluster. When updating a file, a management information copy set constituted by one piece of information in the latest management information on the file related to updating and its sector address is time-sequentially written in a roll back area. When an update result of the file coincides with the management information in the file control area, completion information indicating completion of updating is written.SELECTED DRAWING: Figure 1

Description

この発明は、記録媒体中に、ファイルを書き込む所定容量のクラスタを複数備える、FATファイルシステム及びそのプログラムに関するものである。   The present invention relates to a FAT file system including a plurality of clusters having a predetermined capacity for writing files in a recording medium and a program thereof.

FATファイルシステムでは、ファイルの管理する際にメタ情報(以下、管理情報)を用いており、この管理情報を用いて1ファイル毎にユーザデータの記憶を行っている。FATファイルシステムに用いられる管理情報には、ファイルアロケーションテーブル(以下、FAT)、ディレクトリエントリ(以下、DE)、未使用のクラスタ数を保持するFSInfoがあり、それぞれは論理的に離れた領域に保持される。   In the FAT file system, meta information (hereinafter, management information) is used when managing files, and user data is stored for each file using this management information. Management information used in the FAT file system includes a file allocation table (hereinafter referred to as FAT), a directory entry (hereinafter referred to as DE), and FSInfo that holds the number of unused clusters, each of which is held in a logically separated area. Is done.

NAND型フラッシュメモリのような特定のサイズ単位(以下、セクタ)でアクセスするストレージデバイス(記録媒体)では、ファイルの作成、更新、削除などにより管理情報に変更が生じる場合、管理情報が論理的に離れた領域に保持されるため、複数回のデータ書き込みが必要になる。また、セクタには他ファイルの管理情報が含まれている。   In a storage device (recording medium) accessed in a specific size unit (hereinafter referred to as a sector) such as a NAND flash memory, when management information changes due to file creation, update, deletion, etc., the management information is logically Since it is held in a distant area, it is necessary to write data multiple times. The sector includes management information of other files.

上記のようなストレージデバイスにおいて電断が発生すると、管理情報の一部だけが更新された状態となる。管理情報の一部だけが更新された状態では、FATファイルシステム全体の整合性がとれていないことがある。FATファイルシステム全体の整合性がとれていない場合、更新しようとしたファイルまたは更新を行っていないファイルが、存在しない、ファイルが読めないなどの問題が発生することがある。   When a power interruption occurs in the storage device as described above, only a part of the management information is updated. When only a part of the management information is updated, consistency of the entire FAT file system may not be achieved. When the consistency of the entire FAT file system is not achieved, there may occur a problem that a file to be updated or a file that has not been updated does not exist or cannot be read.

また、ファイルの既存データを上書き中に電断が発生し、電断復旧後に上書き中の全てデータを更新前に戻すことができない場合、電断復旧後のファイルデータは一部だけが上書きされた状態となる。
この電断復旧方法では、ファイルの上書きが不可分な操作である必要がある場合に、ファイルデータの一部だけが上書きされた不完全な或いは意味のないファイルが残る問題が発生する可能性がある。
In addition, when a power failure occurs while overwriting the existing data in the file, and all data being overwritten cannot be restored before the update after power failure recovery, only part of the file data after power failure recovery was overwritten. It becomes a state.
This power failure recovery method may cause a problem that an incomplete or meaningless file in which only part of the file data is overwritten remains when overwriting the file needs to be an inseparable operation. .

上記に対し、ファイルの更新の途中で電源断などのシステム停止が生じたような場合の対策として、以下のような手法を備えたファイルシステムが知られている。特許文献1には、ファイルとその格納位置を示す位置情報を記録してある第1記録媒体と、第1記録媒体とは異なる第2記録媒体とを備えるファイル更新装置であって、第1記録媒体中のファイルを複数の更新手順を経て更新し、どの更新手順まで実施済みであるかを示す進行情報を第2記録媒体中に記録し、更新前のファイルとは別に、更新後のファイルを第1記録媒体中に記録し、更新後のファイルについての第1記録媒体中の格納位置を示す更新情報を第2記録媒体中に記録し、更新後のファイルについて更新情報が記録された後に、当該更新情報に基づいて、当該ファイルの第1記録媒体中の格納位置を示すように、当該ファイルの更新前の格納位置を示している第1記録媒体中の位置情報を更新することが開示されている。   In contrast to the above, a file system having the following method is known as a countermeasure when a system stop such as a power interruption occurs during the file update. Patent Document 1 discloses a file update apparatus including a first recording medium in which position information indicating a file and a storage position thereof is recorded, and a second recording medium different from the first recording medium. The file in the medium is updated through a plurality of update procedures, progress information indicating which update procedure has been performed is recorded in the second recording medium, and the updated file is recorded separately from the file before the update. After the update information is recorded in the first recording medium, the update information indicating the storage position in the first recording medium for the updated file is recorded in the second recording medium, and the update information is recorded for the updated file, Based on the update information, it is disclosed to update the position information in the first recording medium indicating the storage position of the file before the update so as to indicate the storage position of the file in the first recording medium. ing.

特許文献2には、不揮発メモリ上のFAT、ノード情報テーブルを主記憶装置上にコピーし、FAT及びノード情報テーブルの更新を主記憶装置120上で行うFATファイルシステムが開示されている。このシステムでは、ファイル領域に格納されているファイルの更新時、ファイルの更新箇所に対応するクラスタの内容をそのままにして空きクラスタに更新後の内容を書き込み、ファイルクローズ時、主記憶装置上にコピーし更新したFAT及びノード情報テーブルの内容を、それぞれ不揮発メモリ上のFATエリア及びRDE(ルートディレクトリエントリ)に書き戻すように構成している。   Patent Document 2 discloses a FAT file system that copies a FAT and node information table on a nonvolatile memory to a main storage device and updates the FAT and node information table on the main storage device 120. In this system, when updating a file stored in the file area, the updated contents are written to an empty cluster while leaving the contents of the cluster corresponding to the update location of the file unchanged, and are copied to the main storage device when the file is closed. The contents of the updated FAT and node information table are written back to the FAT area and RDE (root directory entry) on the nonvolatile memory, respectively.

特許文献3には、情報記憶媒体上において所定の最小記憶単位よりも大きい所定容量の領域を管理単位領域とし、この管理単位領域内に主情報たるデータを記憶するためのデータ領域と該データに係る管理情報を記憶するための管理情報領域とを設けてデータ記憶管理するシステムが開示されている。このシステムでは、上記管理情報領域に、データの記憶状況を表す情報を保持するための状態保持部と上記情報記憶媒体上に設定された上記各管理単位領域の系列中において自己が該当する順位に先行する管理単位領域の順位を表す情報を保持するための先行順位保持部とを設定し、上記データ領域に対するデータの書き込み動作が中断されてから復旧させるときには、上記管理情報領域の状態保持部に保持された情報と先行順位保持部に保持された情報とを利用して、書き込みが中断されたデータを復旧させる。   In Patent Document 3, an area having a predetermined capacity larger than a predetermined minimum storage unit on an information storage medium is set as a management unit area, and a data area for storing data as main information in the management unit area and the data are stored in the data storage area. A system for managing and storing data by providing a management information area for storing such management information is disclosed. In this system, in the management information area, the status holding unit for holding information indicating the storage status of data and the order in which the self belongs in the series of the management unit areas set on the information storage medium. When setting a preceding rank holding unit for holding information indicating the rank of the preceding management unit area and restoring the data write operation after the data write operation is interrupted, the state holding part of the management information area Using the held information and the information held in the preceding rank holding unit, the data for which writing has been interrupted is restored.

特開2004−157997号公報JP 2004-157997 A 特開2004−102660号公報JP 2004-102660 A 特開2003−331586号公報JP 2003-331586 A

しかしながら、上記の特許文献1、2の手法では、ファイルの更新完了後にファイル管理情報の最終的な更新が行わなければならない。また、特許文献3の手法では、書き込みが中断されたデータの復旧が煩わしいという問題がある。   However, according to the methods of Patent Documents 1 and 2 described above, the file management information must be finally updated after the file update is completed. In addition, the technique of Patent Document 3 has a problem that it is troublesome to recover data whose writing has been interrupted.

本発明は上記のような問題に鑑みてなされたもので、その目的は、ファイルの更新時に電源断などのシステム停止が起きても元の状態にファイルシステムを戻し、適切なファイルの状態を実現することが可能なFATファイルシステム及びそのプログラムを提供することである。   The present invention has been made in view of the above problems, and its purpose is to restore the file system to the original state even if the system is stopped such as when the power is turned off when updating the file, thereby realizing an appropriate file state. It is to provide a FAT file system and a program for the same.

本発明に係るFATファイルシステムは、記録媒体中に、ファイルを書き込む所定容量のクラスタを複数備え、ファイル制御領域に設けられる、1つのファイルが記憶されたクラスタにおける先頭クラスタ番号情報と、前記1つのファイルが記憶されたクラスタに関するクラスタ数分のデータクラスタチェーン情報と、未使用のクラスタの数情報とを含む管理情報をFAT管理手段が用いて、前記記録媒体中のファイル管理を行うFATファイルシステムにおいて、ロールバック領域に、ファイルの更新の際に、更新に係るファイルのその時点の前記管理情報中の所要の1つとそのセクタアドレスとにより構成される管理情報コピーセットを時系列に書き込むロールバック領域管理手段と、ファイルの更新結果と前記ファイル制御領域の管理情報の整合性がとれた場合に、前記ロールバック領域管理手段により書き込まれた管理情報コピーセットの次に、更新完了を示す完了情報を書き込む更新完了確認手段とを備えることを特徴とする。   The FAT file system according to the present invention includes a plurality of clusters having a predetermined capacity for writing a file in a recording medium, the first cluster number information in a cluster storing one file provided in the file control area, and the one In the FAT file system for managing files in the recording medium, the FAT management means uses management information including data cluster chain information for the number of clusters related to the cluster in which the file is stored and information on the number of unused clusters. In the rollback area, when a file is updated, a rollback area in which a management information copy set composed of a required one of the management information at the time of the file related to the update and its sector address is written in time series Management means, file update results and management of the file control area If the integrity of the distribution has been established, the next to the management information copy set written by the rollback area management means, characterized in that it comprises an update completion confirmation means for writing completion information indicating the update completion.

本発明に係るFATファイルシステムでは、前記記録媒体を含むシステムがシステム停止から復旧したときに、前記ロールバック領域の最終書き込み情報が完了情報でない場合に、最後に書き込まれた完了情報以降の管理情報コピーセットを時系列の新しい側から順に前記ファイル制御領域に書き戻すと共に、ロールバック領域における書き戻した情報の次に更新完了を示す完了情報を書き込む復旧処理手段を具備することを特徴とする。   In the FAT file system according to the present invention, when the system including the recording medium recovers from a system stop, if the last write information in the rollback area is not completion information, the management information after the last written completion information The copy set is written back to the file control area in order from the newest side in time series, and recovery processing means for writing completion information indicating update completion next to the written-back information in the rollback area is provided.

本発明に係るFATファイルシステムでは、前記FAT管理手段は、ファイルデータの上書きを行う場合に、上書きするデータを未使用のクラスタに書き込むことを特徴とする。   In the FAT file system according to the present invention, the FAT management means writes data to be overwritten in an unused cluster when overwriting file data.

本発明に係るFATファイルシステムでは、前記FAT管理手段は、ファイルデータの上書きを行う場合に、クラスタ単位で上書きすることを特徴とする。   In the FAT file system according to the present invention, the FAT management means overwrites file data in cluster units when overwriting file data.

本発明に係るFATファイルシステムでは、前記FAT管理手段が、1つのクラスタへ書き込みを行う毎に、ロールバック領域管理手段が対応する管理情報コピーセットを時系列に書き込むことを特徴とする。   In the FAT file system according to the present invention, each time the FAT management means writes to one cluster, the rollback area management means writes the corresponding management information copy set in time series.

本発明に係るFATファイルシステムでは、ロールバック領域管理手段が、対応する管理情報コピーセットを時系列に書き込むと、前記FAT管理手段が、前記ファイル制御領域の管理情報を更新することを特徴とする。   In the FAT file system according to the present invention, when the rollback area management means writes the corresponding management information copy set in time series, the FAT management means updates the management information of the file control area. .

本発明に係るFATファイルシステムでは、前記FAT管理手段が全てのクラスタへの上書き処理を終了し、前記ロールバック領域管理手段が対応する管理情報コピーセットを時系列に書き込み、前記FAT管理手段が前記ファイル制御領域における管理情報の更新を完了した場合に、前記更新完了確認手段が完了情報を書き込むことを特徴とする。   In the FAT file system according to the present invention, the FAT management unit finishes overwriting all the clusters, the rollback area management unit writes the corresponding management information copy set in time series, and the FAT management unit When the management information update in the file control area is completed, the update completion confirmation unit writes the completion information.

本発明に係るFATファイルシステムのプログラムは、記録媒体中に、ファイルを書き込む所定容量のクラスタを複数備え、前記記録媒体中のファイル管理をコンピュータが行うFATファイルシステムの前記コンピュータを、ファイル制御領域に設けられる、1つのファイルが記憶されたクラスタにおける先頭クラスタ番号情報と、前記1つのファイルが記憶されたクラスタに関するクラスタ数分のデータクラスタチェーン情報と、未使用のクラスタの数情報とを含む管理情報を用いてファイル管理を行うFAT管理手段、ロールバック領域に、ファイルの更新の際に、更新に係るファイルのその時点の前記管理情報中の所要の1つとそのセクタアドレスとにより構成される管理情報コピーセットを時系列に書き込むロールバック領域管理手段、ファイルの更新結果と前記ファイル制御領域の管理情報の整合性がとれた場合に、前記ロールバック領域管理手段により書き込まれた管理情報コピーセットの次に、更新完了を示す完了情報を書き込む更新完了確認手段として機能させることを特徴とする。   A FAT file system program according to the present invention includes a plurality of clusters having a predetermined capacity for writing files in a recording medium, and the computer of the FAT file system in which a computer manages files in the recording medium is provided in a file control area. Management information including provided first cluster number information in a cluster in which one file is stored, data cluster chain information for the number of clusters related to the cluster in which the one file is stored, and unused cluster number information Management means for performing file management using the management information in the rollback area, comprising the required one of the management information at the time of the file related to the update and its sector address when updating the file Rollback area management for writing copy sets in time series If the update result of the file and the management information of the file control area are consistent, the update that writes the completion information indicating the completion of the update next to the management information copy set written by the rollback area management means It is characterized by functioning as completion confirmation means.

本発明に係るFATファイルシステムのプログラムでは、前記コンピュータを更に、前記記録媒体を含むシステムがシステム停止から復旧したときに、前記ロールバック領域の最終書き込み情報が完了情報でない場合に、最後に書き込まれた完了情報以降の管理情報コピーセットを時系列の新しい側から順に前記ファイル制御領域に書き戻すと共に、ロールバック領域における書き戻した情報の次に更新完了を示す完了情報を書き込む復旧処理手段として機能させることを特徴とする。   In the FAT file system program according to the present invention, when the computer and the system including the recording medium are recovered from the system stop, the last write information in the rollback area is not the completion information. The management information copy set after the completed information is written back to the file control area in order from the new side in time series, and functions as a recovery processing means for writing completion information indicating update completion next to the written back information in the rollback area It is characterized by making it.

本発明に係るFATファイルシステムのプログラムでは、前記コンピュータを前記FAT管理手段として、ファイルデータの上書きを行う場合に、上書きするデータを未使用のクラスタに書き込むように機能させることを特徴とする。   The FAT file system program according to the present invention is characterized in that when the computer is used as the FAT management means and the file data is overwritten, the overwritten data is written to an unused cluster.

本発明に係るFATファイルシステムのプログラムでは、前記コンピュータを前記FAT管理手段として、ファイルデータの上書きを行う場合に、クラスタ単位で上書きするように機能させることを特徴とする。   The FAT file system program according to the present invention is characterized in that, when the file data is overwritten, the computer serves as the FAT management means so as to perform overwriting in units of clusters.

本発明に係るFATファイルシステムのプログラムでは、前記コンピュータを前記FAT管理手段として、1つのクラスタへ書き込みを行う毎に、ロールバック領域管理手段が対応する管理情報コピーセットを時系列に書き込むように機能させることを特徴とする。   In the FAT file system program according to the present invention, the rollback area management unit functions to write the corresponding management information copy set in time series each time data is written to one cluster using the computer as the FAT management unit. It is characterized by making it.

本発明に係るFATファイルシステムのプログラムでは、前記コンピュータをロールバック領域管理手段機能させて、対応する管理情報コピーセットを時系列に書き込むと、前記コンピュータを前記FAT管理手段として、前記ファイル制御領域の管理情報を更新するように機能させることを特徴とする。   In the FAT file system program according to the present invention, when the computer is caused to function as a rollback area management means and the corresponding management information copy set is written in time series, the computer is used as the FAT management means to store the file control area. It is characterized by functioning to update management information.

本発明に係るFATファイルシステムのプログラムでは、前記コンピュータを前記FAT管理手段として機能させて、全てのクラスタへの上書き処理を終了し、前記コンピュータを前記ロールバック領域管理手段として機能させて、対応する管理情報コピーセットを時系列に書き込み、前記コンピュータを前記FAT管理手段として機能させて前記ファイル制御領域における管理情報の更新を完了した場合に、前記コンピュータを前記更新完了確認手段として、完了情報を書き込むように機能させることを特徴とする。   In the FAT file system program according to the present invention, the computer is caused to function as the FAT management means, the overwriting process for all clusters is terminated, and the computer is caused to function as the rollback area management means. Write the management information copy set in time series, and write the completion information using the computer as the update completion confirmation unit when the computer functions as the FAT management unit and the management information update in the file control area is completed. It is made to function as follows.

本発明によれば、ロールバック領域に、ファイルの更新の際に、更新に係るファイルのその時点の上記管理情報のいずれか1つとそのセクタアドレスとにより構成される管理情報コピーセットを時系列に書き込み、ファイルの更新結果と前記ファイル制御領域の管理情報の整合性がとれた場合に、書き込まれた管理情報コピーセットの次に、更新完了を示す完了情報を書き込むので、ファイルの更新時に電源断などのシステム停止が起きても、最後に書き込まれた完了情報の次の管理情報コピーセットを用いて元の状態にファイルシステムを戻すことが可能である。   According to the present invention, when a file is updated in the rollback area, a management information copy set composed of any one of the management information at the time of the file related to the update and its sector address is arranged in time series. When the results of writing and updating the file and the management information in the file control area are consistent, the completion information indicating the completion of the update is written after the written management information copy set. Even if the system is stopped, it is possible to return the file system to the original state by using the management information copy set next to the last written completion information.

本発明に係るFATファイルシステムの実施形態を示すブロック図。1 is a block diagram showing an embodiment of a FAT file system according to the present invention. 本発明に係るFATファイルシステムの実施形態によるファイル更新処理手順を示す図。The figure which shows the file update process sequence by embodiment of the FAT file system which concerns on this invention. 本発明に係るFATファイルシステムの実施形態によるファイル更新処理手順を示す図。The figure which shows the file update process sequence by embodiment of the FAT file system which concerns on this invention. 本発明に係るFATファイルシステムの実施形態によるファイル更新処理手順を示す図。The figure which shows the file update process sequence by embodiment of the FAT file system which concerns on this invention. 本発明に係るFATファイルシステムの実施形態によるシステム停止後の復旧処理手順を示す図。The figure which shows the recovery processing procedure after the system stop by embodiment of the FAT file system which concerns on this invention. 本発明に係るFATファイルシステムの実施形態によるシステム停止後の復旧処理手順を示す図。The figure which shows the recovery processing procedure after the system stop by embodiment of the FAT file system which concerns on this invention. 本発明に係るFATファイルシステムの実施形態によるファイルの上書き処理手順を示す図。The figure which shows the overwrite process procedure of the file by embodiment of the FAT file system which concerns on this invention. 本発明に係るFATファイルシステムの実施形態によるファイルの上書き処理手順を示す図。The figure which shows the overwrite process procedure of the file by embodiment of the FAT file system concerning this invention. 本発明に係るFATファイルシステムの実施形態によるファイルの上書き処理手順を示す図。The figure which shows the overwrite process procedure of the file by embodiment of the FAT file system which concerns on this invention. 本発明に係るFATファイルシステムの実施形態によるファイルの上書き処理手順を示す図。The figure which shows the overwrite process procedure of the file by embodiment of the FAT file system which concerns on this invention. 本発明に係るFATファイルシステムの実施形態によるファイルの上書き処理手順を示すフローチャート。The flowchart which shows the overwrite process procedure of the file by embodiment of the FAT file system which concerns on this invention. 図11のフローチャートにおけるサブルーチンの処理手順を示すフローチャート。12 is a flowchart showing a processing procedure of a subroutine in the flowchart of FIG. 11.

以下添付図面を参照して、本発明に係るFATファイルシステム及びそのプログラムの実施形態を説明する。各図において、同一の構成要素には同一の符号を付して重複する説明を省略する。図1に、本実施形態に係るFATファイルシステムの構成図を示す。   Embodiments of a FAT file system and a program thereof according to the present invention will be described below with reference to the accompanying drawings. In each figure, the same components are denoted by the same reference numerals, and redundant description is omitted. FIG. 1 shows a configuration diagram of the FAT file system according to the present embodiment.

図1に示されるように、本実施形態に係るFATファイルシステムは、例えばNAND型フラッシュメモリなどにより構成される記録媒体部20と、CPUや主メモリなどにより構成され、記録媒体部20を制御する記録媒体制御部10とを備える。このファイルシステムは、パーソナルコンピュータやサーバなどに搭載されることができる。   As shown in FIG. 1, the FAT file system according to the present embodiment includes a recording medium unit 20 configured by, for example, a NAND flash memory, a CPU, a main memory, and the like, and controls the recording medium unit 20. And a recording medium control unit 10. This file system can be mounted on a personal computer or a server.

記録媒体部20には、ファイル制御領域200とロールバック領域300が設けられている。ファイル制御領域200には、データ領域(Data)_210が設けられており、このデータ領域210には、所定容量のデータクラスタ(data)を複数(221〜22n(整数))備えている。更に、データ領域210には、DE(root)_211、DE(sub)_212、DE(sub)_213が設けられている。DE(root)_211は、ルートディレクトリの情報、ルートに存在するファイルのファイル名などが記憶された領域であり、DE(sub)_212とDE(sub)_213は、ルートディレクトリ以外のディレクトリの情報、サブディレクトリに存在するファイルのファイル名などが記憶された領域であり、これらファイル毎のDE(root)には、ファイルの先頭クラスタのクラスタ番号が記憶される。   The recording medium unit 20 is provided with a file control area 200 and a rollback area 300. The file control area 200 is provided with a data area (Data) _210, and the data area 210 includes a plurality (221 to 22n (integer)) of data clusters (data) having a predetermined capacity. Further, the data area 210 is provided with DE (root) — 211, DE (sub) — 212, and DE (sub) — 213. DE (root) — 211 is an area in which information on the root directory, the file name of a file existing in the root, and the like are stored. DE (sub) — 212 and DE (sub) — 213 are information on directories other than the root directory, This is an area in which file names and the like of files existing in subdirectories are stored, and the cluster number of the first cluster of the file is stored in DE (root) for each file.

記録媒体部20のファイル制御領域200には、MBR(マスターブートレコード)_231、PBR(パーティションブートレコード)_232、FSInfo_233、FAT[1](FATテーブル1)_234、FAT[2](FATテーブル2)_235が設けられている。   The file control area 200 of the recording medium unit 20 includes MBR (master boot record) _231, PBR (partition boot record) _232, FSInfo_233, FAT [1] (FAT table 1) _234, FAT [2] (FAT table 2). _235 is provided.

MBR231は、パーティション情報などが記憶された領域であり、PBR_232は、FATやDEに関する情報が記憶された領域である。FSInfo_233は、未使用のクラスタの数情報が記憶される領域である。FAT[1]_234は、ファイルの場所を示す情報が記憶される領域であり、ファイル毎のFATには、ファイルのクラスタ数分のデータクラスタチェーン情報が記憶される。FAT[2]_235は、FAT[1]_234と同様の機能を有する領域であり、FAT[1]_234のバックアップ(ミラー)領域とすることも可能な領域である。ここでは、FAT[2]_235まで示しているが、記録媒体部20の容量に応じて適宜な数Nが設けられる。つまり、FAT[1]〜FAT[N]が設けられる。   The MBR 231 is an area where partition information and the like are stored, and the PBR — 232 is an area where information regarding FAT and DE is stored. FSInfo — 233 is an area in which information on the number of unused clusters is stored. FAT [1] — 234 is an area in which information indicating the location of a file is stored, and data cluster chain information corresponding to the number of clusters of the file is stored in the FAT for each file. The FAT [2] _235 is an area having the same function as the FAT [1] _234, and can be a backup (mirror) area of the FAT [1] _234. Here, although FAT [2] _235 is shown, an appropriate number N is provided according to the capacity of the recording medium unit 20. That is, FAT [1] to FAT [N] are provided.

上記FSInfo_233、FAT[1]_234、FAT[2]_235、DE(root)_211、DE(sub)_212とDE(sub)_213の領域に記憶されている情報は、管理情報である。1つのファイルの管理情報は、ファイル名により統括されており、ファイル名により特定可能である。記録媒体部20には、ロールバック領域300が設けられている。このロールバック領域300には、ファイルの更新の際に、上記管理情報のいずれか1つとそのセクタアドレスとにより構成される管理情報コピーセットが時系列に書き込まれる。   Information stored in the areas of FSInfo — 233, FAT [1] — 234, FAT [2] — 235, DE (root) — 211, DE (sub) — 212, and DE (sub) — 213 is management information. The management information of one file is integrated by the file name and can be specified by the file name. The recording medium unit 20 is provided with a rollback area 300. In the rollback area 300, when a file is updated, a management information copy set composed of any one of the management information and its sector address is written in time series.

記録媒体制御部10には、FAT管理手段11、ロールバック領域管理手段12、更新完了確認手段13、復旧処理手段14が設けられる。FAT管理手段11は、ファイル制御領域200に設けられる、1つのファイルが記憶された1または複数のクラスタにおける先頭クラスタ番号情報(ファイル毎のDE(root)内)と、上記1つのファイルが記憶された複数のクラスタに関するクラスタ数分のデータクラスタチェーン情報(ファイルのFAT内)と、未使用のクラスタの数情報(FSInfo内)とを含む管理情報を用いて、上記記録媒体部20中のファイル管理を行う。   The recording medium control unit 10 includes a FAT management unit 11, a rollback area management unit 12, an update completion confirmation unit 13, and a recovery processing unit 14. The FAT management means 11 stores the first cluster number information (in DE (root) for each file) in one or a plurality of clusters provided in the file control area 200 and stores the one file. File management in the recording medium unit 20 using management information including data cluster chain information (in the FAT of the file) for the number of clusters related to a plurality of clusters and unused cluster number information (in the FSInfo). I do.

ロールバック領域管理手段12は、ロールバック領域300に、ファイルの更新の際に、更新に係るファイルのその時点の上記管理情報のいずれか1つとそのセクタアドレスとにより構成される管理情報コピーセットを時系列に書き込むものである。更新完了確認手段13は、ファイルの更新結果と上記ファイル制御領域200の管理情報の整合性がとれた場合に、上記ロールバック領域管理手段12により書き込まれた管理情報コピーセットの次に、更新完了を示す完了情報(デリミタ)を書き込むものである。復旧処理手段14は、上記記録媒体を含むシステムが電源断などのシステム停止から復旧したときに、上記ロールバック領域300の最終書き込み情報が完了情報(デリミタ)でない場合に、最後に書き込まれた完了情報(デリミタ)以降の管理情報コピーセットを時系列の新しい側から順に上記ファイル制御領域200に書き戻すと共に、ロールバック領域300における書き戻した情報の次に更新完了を示す完了情報(デリミタ)を書き込むものである。   The rollback area management means 12 stores, in the rollback area 300, a management information copy set composed of any one of the above management information of the file related to the update and its sector address when the file is updated. Write in time series. The update completion confirmation means 13 updates the update completion next to the management information copy set written by the rollback area management means 12 when the file update result and the management information in the file control area 200 are consistent. The completion information (delimiter) indicating is written. When the system including the recording medium recovers from a system stop such as a power failure, the recovery processing unit 14 completes the last written information if the final write information in the rollback area 300 is not completion information (delimiter). The management information copy set after the information (delimiter) is written back to the file control area 200 in order from the newest side in time series, and the completion information (delimiter) indicating completion of update is next to the information written back in the rollback area 300. Write.

以上のように構成されたFATファイルシステムにおけるファイル更新動作を説明する。図2に、FATファイルシステムにおけるファイル更新動作に関係する領域として、ファイル制御領域200の管理情報とデータクラスタ(data)221〜22nの一部の領域と、ロールバック領域300が示されている。管理情報の領域として、FSInfo_233、FAT_230、DE(root)_211、DE(sub)_212とDE(sub)_213が示されている。FAT_230は、FAT[1]〜FAT[N]を含むものとして示している。   A file update operation in the FAT file system configured as described above will be described. FIG. 2 shows management information in the file control area 200, partial areas of the data clusters (data) 221 to 22n, and a rollback area 300 as areas related to the file update operation in the FAT file system. As management information areas, FSInfo — 233, FAT — 230, DE (root) — 211, DE (sub) — 212, and DE (sub) — 213 are shown. FAT_230 is shown as including FAT [1] to FAT [N].

記録媒体部20に記録してあるファイルの更新を行う場合に、ロールバック領域300に、更新に係るファイルのその時点の前記管理情報のいずれか1つとそのセクタアドレスとにより構成される管理情報コピーセットを時系列に書き込む(ロールバック領域管理手段12)。図2の例では、ファイル名FLのファイル更新によってFAT_230(FAT[1]〜FAT[N]中の所定の1テーブル)のデータクラスタチェーン情報を更新する必要があるため、ファイル制御領域200のその時点の管理情報であるFAT_230の情報とそのセクタアドレス(この1テーブルが記憶されているセクタアドレス)をロールバック領域300のアドレス#1に書き込む(図2(a)S11)。   When updating a file recorded in the recording medium unit 20, a management information copy composed of any one of the management information at the time of the file related to the update and its sector address in the rollback area 300 The set is written in chronological order (rollback area management means 12). In the example of FIG. 2, it is necessary to update the data cluster chain information of FAT_230 (a predetermined table in FAT [1] to FAT [N]) by updating the file with the file name FL. The information of FAT_230, which is management information at the time, and the sector address (sector address where this one table is stored) are written to address # 1 of the rollback area 300 (FIG. 2 (a) S11).

次に図2(b)に示すように、ファイル名FLのファイルデータ更新を、データクラスタ(data)221〜22n中の例えばデータクラスタ(data)222において行う(S12)と共に、ファイル制御領域200のFAT_230の管理情報を更新する(S13)。この図2の例は、ファイルの更新結果とファイル制御領域200の管理情報の整合性が未だとれていない場合を示す。このため、上記ロールバック領域管理手段12により書き込まれた管理情報コピーセットの次に、更新完了を示す完了情報を書き込むことは行われていない。   Next, as shown in FIG. 2B, the file data update of the file name FL is performed in, for example, the data cluster (data) 222 in the data clusters (data) 221 to 22n (S12), and at the same time in the file control area 200 The management information of FAT_230 is updated (S13). The example of FIG. 2 shows a case where the consistency between the file update result and the management information in the file control area 200 has not yet been obtained. Therefore, the completion information indicating the completion of the update is not written after the management information copy set written by the rollback area management means 12.

図3のファイル更新動作例は、図2に示したファイル更新動作に続いて行われたものを示す。図2に示した動作に続いて、ファイル名FLのファイル更新によってFAT_230(FAT[1]〜FAT[N]中の所定の1テーブル(図2の場合と同じテーブル))のデータクラスタチェーン情報を更新する必要があるため、ファイル制御領域200のその時点の管理情報であるFAT_230の情報とそのセクタアドレスをロールバック領域300のアドレス#2に書き込む(図3(a)S21)。   The file update operation example of FIG. 3 shows what was performed following the file update operation shown in FIG. Subsequent to the operation shown in FIG. 2, the data cluster chain information of FAT_230 (a predetermined table in FAT [1] to FAT [N] (the same table as in FIG. 2)) is updated by updating the file with the file name FL. Since it needs to be updated, the information of FAT_230 that is the management information at that time in the file control area 200 and the sector address thereof are written in the address # 2 of the rollback area 300 (S21 in FIG. 3A).

次に図3(a)に示すように、ファイル名FLのファイルデータ更新を、データクラスタ(data)221〜22n中の例えばデータクラスタ(data)223において行う(S22)と共に、ファイル制御領域200のFAT_230の情報を更新する(S23)。更に、S22の処理でファイル名FLの先頭クラスタを変更する必要が生じたため、図3(b)に示すように、DE(sub)_212の情報とそのセクタアドレスをロールバック領域300のアドレス#3に書き込む(図3(b)S24)。更に、ファイル制御領域200のDE(sub)_212の情報(先頭クラスタ番号情報)を更新する(S25)。   Next, as shown in FIG. 3A, the file data update of the file name FL is performed in, for example, the data cluster (data) 223 in the data clusters (data) 221 to 22n (S22), and at the same time in the file control area 200 Information on FAT_230 is updated (S23). Further, since it is necessary to change the first cluster of the file name FL in the process of S22, as shown in FIG. 3B, the information of DE (sub) — 212 and its sector address are converted into the address # 3 of the rollback area 300. (FIG. 3 (b) S24). Further, the information (first cluster number information) of DE (sub) — 212 in the file control area 200 is updated (S25).

また、S22の処理で未使用クラスタ数の変更を行う必要が生じたために、図4(a)に示すように、FSInfo_233の情報とそのセクタアドレスをロールバック領域300のアドレス#4に書き込む(図4(a)S26)。また、ファイル制御領域200のFSInfo_233の情報を更新する(図4(b)S27)。なお、この図4から図6において、ロールバック領域300の横幅が図1から図3までのものよりも幅広に描いているが、これは文字列の多い構成要素を図示したためであり、ロールバック領域300の容量が変化したことを示すものではない。   Further, since it is necessary to change the number of unused clusters in the process of S22, as shown in FIG. 4A, the information of FSInfo — 233 and its sector address are written to address # 4 of the rollback area 300 (FIG. 4 (a) S26). Also, the information of FSInfo — 233 in the file control area 200 is updated (S27 in FIG. 4B). 4 to 6, the width of the rollback region 300 is drawn wider than that of the rollback region 300 shown in FIGS. 1 to 3, but this is because the components having a large number of character strings are illustrated. It does not indicate that the capacity of the region 300 has changed.

以上により、ファイル名FLのファイル更新が、データクラスタ(data)221〜22n中の例えばデータクラスタ(data)222及びデータクラスタ(data)223において行われ、対応するファイル制御領域200の管理情報の更新がFAT_230、DE(sub)_212及びFSInfo_233にて行われ、ファイル名FLのファイルの更新結果とファイル制御領域200の管理情報の整合性がとれた状態となっている。このため、上記ロールバック領域管理手段12により書き込まれた管理情報コピーセットの次に、更新完了を示す完了情報(デリミタ)が書き込まれる(図4(b)S28)。   As described above, the file update of the file name FL is performed in, for example, the data cluster (data) 222 and the data cluster (data) 223 in the data clusters (data) 221 to 22n, and the management information of the corresponding file control area 200 is updated. Are performed in FAT_230, DE (sub) _212, and FSInfo_233, and the update result of the file with the file name FL and the management information in the file control area 200 are consistent. Therefore, next to the management information copy set written by the rollback area management means 12, completion information (delimiter) indicating completion of update is written (S28 in FIG. 4B).

さて、上記記録媒体部20が電源断などのシステム停止から復旧したときに、ロールバック領域300の最終書き込み情報が完了情報(デリミタ)であれば、図4を用いて説明したようにファイルの更新結果とファイル制御領域200の管理情報の整合性がとれている状態にあるので、復旧処理を行う必要はない。これに対し、上記記録媒体部20が電源断などのシステム停止から復旧したときに、ロールバック領域300の最終書き込み情報が完了情報(デリミタ)でない場合には、復旧処理手段14により復旧処理が行われる。以下に、この復旧処理の説明を行う。   If the final write information in the rollback area 300 is completion information (delimiter) when the recording medium unit 20 recovers from a system stop such as a power failure, the file update is performed as described with reference to FIG. Since the result and the management information in the file control area 200 are consistent, there is no need to perform recovery processing. On the other hand, when the recording medium unit 20 is recovered from a system stop such as a power interruption, if the final write information in the rollback area 300 is not completion information (delimiter), the recovery processing unit 14 performs the recovery process. Is called. Hereinafter, the restoration process will be described.

図5(a)に示すように、記録媒体部20が電源断などのシステム停止から復旧したときに、ロールバック領域300の最終書き込み情報が完了情報(デリミタ)ではなく、アドレス#1に記憶された最終の完了情報(デリミタ)以降に、FAT_230の情報とそのセクタアドレスが記憶され(ロールバック領域300のアドレス#2)、DE(sub)_212の情報とそのセクタアドレスが記憶され(ロールバック領域300のアドレス#3)、FSInfo_233の情報とそのセクタアドレスが記憶され(ロールバック領域300のアドレス#4)ていたものとする。   As shown in FIG. 5A, when the recording medium unit 20 recovers from a system stop such as a power failure, the final write information in the rollback area 300 is stored not at completion information (delimiter) but at address # 1. After the final completion information (delimiter), FAT_230 information and its sector address are stored (address # 2 of the rollback area 300), and DE (sub) _212 information and its sector address are stored (rollback area). 300 address # 3), and information of FSInfo_233 and its sector address are stored (address # 4 of rollback area 300).

上記の場合に、最後に書き込まれた完了情報以降の管理情報コピーセットを時系列の新しい側から順に上記ファイル制御領域200に書き戻す。まず、ロールバック領域300のアドレス#4に記憶されているFSInfo_233の情報を、同アドレスに記憶されているセクタアドレスのファイル制御領域200に書き戻す(図5(a)S31)。次に、ロールバック領域300のアドレス#3に記憶されているDE(sub)_212の情報を、同アドレスに記憶されているセクタアドレスのファイル制御領域200に書き戻す(図5(b)S32)。   In the above case, the management information copy set after the last written completion information is written back to the file control area 200 in order from the chronological new side. First, the information of FSInfo — 233 stored at address # 4 of the rollback area 300 is written back to the file control area 200 of the sector address stored at the same address (FIG. 5 (a) S31). Next, the information of DE (sub) — 212 stored in the address # 3 of the rollback area 300 is written back to the file control area 200 of the sector address stored in the same address (S32 in FIG. 5 (b)). .

更に、ロールバック領域300のアドレス#2に記憶されているFAT_230の情報を、同アドレスに記憶されているセクタアドレスのファイル制御領域200に書き戻す(図6(a)S33)。必要な情報の書き戻しが終了すると、ロールバック領域300における書き戻した情報の次に更新完了を示す完了情報(デリミタ)を書き込む(図6(b)S34)。なお、本実施形態では、ロールバック領域300の先頭アドレス#1に完了情報(デリミタ)を書き込んである場合を示したが、この書込みを行わず、先頭アドレス#1まで戻ると書き戻しを終了するようにしても良い。   Further, the FAT_230 information stored in the address # 2 of the rollback area 300 is written back to the file control area 200 of the sector address stored in the same address (FIG. 6 (a) S33). When the necessary information is written back, the completion information (delimiter) indicating the completion of the update is written next to the information written back in the rollback area 300 (S34 in FIG. 6B). In the present embodiment, the completion information (delimiter) has been written in the start address # 1 of the rollback area 300. However, this writing is not performed, and the write-back is completed when the process returns to the start address # 1. You may do it.

次に、本実施形態に係るFATファイルシステムにおいてファイルデータの上書きを行う場合処理を説明する。この処理では、各手段が次の通り処理を行う。FAT管理手段11は、ファイルデータの上書きを行う場合に、上書きするデータを未使用のクラスタに書き込む。本実施形態では、上書き前の旧クラスタ番号を保持した状態で、上書きするデータを未使用のクラスタに書き込む。FAT管理手段11は、ファイルデータの上書きを行う場合に、クラスタ単位で上書きする。FAT管理手段11が、1つのクラスタへ書き込みを行う毎に、ロールバック領域管理手段12が対応する管理情報コピーセットを時系列に書き込む。ロールバック領域管理手段12が、対応する管理情報コピーセットを時系列に書き込むと、上記FAT管理手段11が、上記ファイル制御領域200の管理情報を更新する。FAT管理手段11が全てのクラスタへの上書き処理を終了し、上記ロールバック領域管理手段12が対応する管理情報コピーセットを時系列に書き込み、上記FAT管理手段11が上記ファイル制御領域200における管理情報の更新を完了した場合に、上記更新完了確認手段13が完了情報を書き込む。   Next, a process for overwriting file data in the FAT file system according to the present embodiment will be described. In this process, each means performs the following process. The FAT management unit 11 writes overwritten data in an unused cluster when overwriting file data. In the present embodiment, the data to be overwritten is written in an unused cluster while retaining the old cluster number before being overwritten. The FAT management unit 11 performs overwriting in units of clusters when overwriting file data. Each time the FAT management means 11 writes to one cluster, the rollback area management means 12 writes the corresponding management information copy set in time series. When the rollback area management unit 12 writes the corresponding management information copy set in time series, the FAT management unit 11 updates the management information in the file control area 200. The FAT management unit 11 finishes overwriting all the clusters, the rollback area management unit 12 writes the corresponding management information copy set in time series, and the FAT management unit 11 manages the management information in the file control area 200. When the update is completed, the update completion confirmation unit 13 writes completion information.

本実施形態では、上書き前の旧クラスタ番号を保持した状態で、上書きするデータを未使用のクラスタに書き込む。ここでは、ファイル名FRのサイズが10クラスタのファイルにおいて、先頭から2クラスタ分のデータを上書き更新する場合を例とする。図7は当該ファイル名FRのファイルに関する上書き前の、ファイル制御領域200の情報と、ロールバック領域300の情報と、FATテーブルの情報と、上書き前の旧クラスタ番号を保持するレジスタRの情報を示している。システムの運用中であればロールバック領域300には、既に他のファイルに関する情報などが記憶されているはずであるが、説明の都合上、省略してある。   In the present embodiment, the data to be overwritten is written in an unused cluster while retaining the old cluster number before being overwritten. Here, as an example, in a file having a file name FR size of 10 clusters, data for two clusters from the beginning is overwritten and updated. FIG. 7 shows the information of the file control area 200, the information of the rollback area 300, the information of the FAT table, the information of the FAT table, and the information of the register R holding the old cluster number before overwriting regarding the file with the file name FR. Show. If the system is in operation, the rollback area 300 should already store information on other files, but this is omitted for convenience of explanation.

図7において、ファイル制御領域200の、FSInfoの領域には未使用クラスタ数が記憶され、FATの領域には右側のFATテーブルに示すようなデータクラスタチェーン情報が記憶され、DEの領域には先頭クラスタ番号情報が記憶されている。このファイルは、FATテーブルの情報から判るように、クラスタ番号1のデータの次にクラスタ番号2のデータが続き、クラスタ番号2のデータの次にクラスタ番号3のデータが続き、・・・、クラスタ番号9のデータの次にクラスタ番号10のデータが続き、クラスタ番号10が終端となっている。この関係がファイル制御領域200において、DEの領域の先頭クラスタ番号情報が「1」であり、以下、矢印で、クラスタ1(data)、クラスタ2(data)、・・・、クラスタ10(data)と続いていることを示している。   In FIG. 7, the number of unused clusters is stored in the FSInfo area of the file control area 200, the data cluster chain information as shown in the FAT table on the right side is stored in the FAT area, and the head is stored in the DE area. Cluster number information is stored. As can be seen from the information in the FAT table, the data of cluster number 2 follows the data of cluster number 1, the data of cluster number 3 follows the data of cluster number 2,. The data of the cluster number 10 follows the data of the number 9, and the cluster number 10 ends. In this relation, in the file control area 200, the first cluster number information of the DE area is “1”. Hereinafter, the arrows indicate cluster 1 (data), cluster 2 (data),..., Cluster 10 (data). It is shown that it continues.

まず、当該ファイルのクラスタ1(data)のデータに対し上書きする処理による各領域の変化が図8に示され、処理手順が図8のSS1に示されている。本実施形態では、上書きするデータを未使用のクラスタ番号11のクラスタに書き込み、未使用クラスタ数が記憶されたFSInfo(の情報)をロールバック領域300のアドレス#1へ書き込む。また、ファイル制御領域200の、FSInfoの領域に記憶されている未使用クラスタ数を「1」減少させる。   First, FIG. 8 shows the change of each area due to the process of overwriting the data of cluster 1 (data) of the file, and the processing procedure is shown in SS1 of FIG. In the present embodiment, the data to be overwritten is written in the cluster of the unused cluster number 11, and FSInfo (information) in which the number of unused clusters is stored is written in the address # 1 of the rollback area 300. Also, the number of unused clusters stored in the FSInfo area of the file control area 200 is decreased by “1”.

次に、当該ファイルの第1番目のクラスタをクラスタ番号11のクラスタとするのに先立って、データクラスタチェーン情報が記憶されたFAT(の情報)をロールバック領域300のアドレス#2へ書き込むと共に、ファイル制御領域200の、FATテーブルのクラスタ番号11のFAT値(次クラスタ番号)に「2」を書き込む。更に、当該ファイルの先頭クラスタをクラスタ番号11のクラスタとするため、先頭クラスタ番号情報が記憶されたDE(の情報)をロールバック領域300のアドレス#3へ書き込み、ファイル制御領域200のDE(の情報)を「11」へ変更する。その後、上書き前の旧クラスタ番号を保持するレジスタRに「1」を書き込む。   Next, prior to making the first cluster of the file the cluster of cluster number 11, the FAT (information) storing the data cluster chain information is written to address # 2 of the rollback area 300, and “2” is written in the FAT value (next cluster number) of cluster number 11 of the FAT table in the file control area 200. Further, in order to set the first cluster of the file as the cluster having the cluster number 11, the DE (information) in which the first cluster number information is stored is written to the address # 3 in the rollback area 300, and the DE ( Information) is changed to “11”. Thereafter, “1” is written in the register R that holds the old cluster number before overwriting.

次に、当該ファイルのクラスタ2(data)のデータに対し上書きする処理による各領域の変化が図9に示され、処理手順が図9のSS2に示されている。本実施形態では、上書きするデータを未使用のクラスタ番号12のクラスタに書き込み、未使用クラスタ数が記憶されたFSInfo(の情報)をロールバック領域300のアドレス#4へ書き込む。また、ファイル制御領域200の、FSInfoの領域に記憶されている未使用クラスタ数を「1」減少させる。   Next, FIG. 9 shows changes in each area due to the process of overwriting the data of cluster 2 (data) of the file, and the processing procedure is shown in SS2 of FIG. In the present embodiment, the data to be overwritten is written in the cluster of the unused cluster number 12, and FSInfo (information) in which the number of unused clusters is stored is written in the address # 4 of the rollback area 300. Also, the number of unused clusters stored in the FSInfo area of the file control area 200 is decreased by “1”.

次に、当該ファイルの第2番目のクラスタをクラスタ番号12のクラスタとするのに先立って、データクラスタチェーン情報が記憶されたFAT(の情報)をロールバック領域300のアドレス#5へ書き込むと共に、ファイル制御領域200の、FATテーブルのクラスタ番号11のFAT値(次クラスタ番号)を「12」に更新し、FATテーブルのクラスタ番号12のFAT値(次クラスタ番号)に「3」を書き込む。その後、上書き前の旧クラスタ番号を保持するレジスタRに「2」を追加する。この結果、上書き前の旧クラスタ番号を保持するレジスタRには、「1」、「2」が保持される。   Next, prior to making the second cluster of the file the cluster of cluster number 12, the FAT (information) storing the data cluster chain information is written to address # 5 of the rollback area 300, and The FAT value (next cluster number) of the cluster number 11 of the FAT table in the file control area 200 is updated to “12”, and “3” is written to the FAT value (next cluster number) of the cluster number 12 of the FAT table. After that, “2” is added to the register R that holds the old cluster number before overwriting. As a result, “1” and “2” are held in the register R that holds the old cluster number before being overwritten.

以上のようにして、先頭から2クラスタ分のデータを上書きした後に、上書き前のデータが格納されているクラスタの無効化と、ファイルの更新結果とファイル制御領域200の管理情報の整合性をとる処理を図10に示すように行う。ここでは、処理手順が図10のSS3に示されている。まず、上書き前のデータが格納されているクラスタの無効化のために、データクラスタチェーン情報が記憶されたFAT(の情報)をロールバック領域300のアドレス#6へ書き込むと共に、ファイル制御領域200の、FATテーブルのクラスタ番号1及びクラスタ番号2のFAT値(次クラスタ番号)を「00」に更新する。   As described above, after overwriting data for two clusters from the beginning, invalidation of the cluster in which the data before overwriting is stored and consistency between the file update result and the management information of the file control area 200 are taken. Processing is performed as shown in FIG. Here, the processing procedure is shown in SS3 of FIG. First, in order to invalidate the cluster storing the data before overwriting, the FAT (information) storing the data cluster chain information is written to the address # 6 of the rollback area 300 and the file control area 200 The FAT value (next cluster number) of cluster number 1 and cluster number 2 in the FAT table is updated to “00”.

また、未使用クラスタ数が記憶されたFSInfo(の情報)をロールバック領域300のアドレス#7へ書き込み、ファイル制御領域200の、FSInfoの領域に記憶されている未使用クラスタ数を「2」増加させる。更に、上書き前の旧クラスタ番号を保持するレジスタRに保持されているクラスタ番号「1」及び「2」をクリアする。以上により、ファイルの更新結果とファイル制御領域200の管理情報の整合性がとれたため、上記更新完了確認手段13が完了情報(デリミタ)をロールバック領域300の最終空白アドレスであるアドレス#8に書き込む。   Also, the FSInfo (information) in which the number of unused clusters is stored is written to address # 7 in the rollback area 300, and the number of unused clusters stored in the FSInfo area of the file control area 200 is increased by “2”. Let Further, the cluster numbers “1” and “2” held in the register R holding the old cluster number before overwriting are cleared. As described above, since the consistency between the file update result and the management information of the file control area 200 is achieved, the update completion confirmation unit 13 writes the completion information (delimiter) to the address # 8 which is the final blank address of the rollback area 300. .

上記のようにしてファイルデータの上書きを行っているときに、完了情報(デリミタ)をロールバック領域300に書き込む前に電源断などのシステム停止となった場合には、図5と図6により説明した場合と同様にしてロールバック領域300の情報をファイル制御領域200へ書き戻してファイルデータの上書き前に戻って処理を行うことができる。   When the file data is overwritten as described above, and the system is stopped such as the power is turned off before the completion information (delimiter) is written in the rollback area 300, it will be described with reference to FIGS. In the same manner as described above, the information in the rollback area 300 can be written back to the file control area 200 to return to the process before overwriting the file data.

本実施形態におけるファイルデータの上書き処理動作を図11及び図12のフローチャートにより説明する。処理の開始から、ループS91とループ94により挟まれている処理S92と処理S93を更新データサイズ(クラスタ数n(整数))分となるまで繰り返す。まず、1つ目のクラスタに対するデータの書き込みのため、新しいクラスタを割り当てる(S92)。次に、「管理情報更新」のサブルーチン処理S93が行われる。   The file data overwrite processing operation in the present embodiment will be described with reference to the flowcharts of FIGS. From the start of processing, processing S92 and processing S93 sandwiched between loop S91 and loop 94 are repeated until the update data size (number of clusters n (integer)) is reached. First, a new cluster is allocated for writing data to the first cluster (S92). Next, the “management information update” subroutine process S93 is performed.

サブルーチン処理S93は、図12に示されている。つまり、「管理情報更新」のサブルーチンでは、ファイル制御領域200の該当管理情報をロールバック領域300へ書き込み(S931)、ファイル制御領域200の管理情報を更新する(S932)。   The subroutine process S93 is shown in FIG. That is, in the “management information update” subroutine, the management information in the file control area 200 is written to the rollback area 300 (S931), and the management information in the file control area 200 is updated (S932).

処理S92と処理S93が更新データサイズ(クラスタ数n(整数))分となるまで繰り返された後には、ファイルの更新結果とファイル制御領域200の管理情報の整合性がとれるので、更新完了確認手段13が完了情報(デリミタ)をロールバック領域300の最終空白アドレスへ書き込んで(S95)、処理終了となる。   After the process S92 and the process S93 are repeated until the update data size (the number of clusters n (integer)) is reached, the consistency between the file update result and the management information in the file control area 200 can be obtained. 13 writes the completion information (delimiter) to the last blank address in the rollback area 300 (S95), and the process ends.

以上のようにしてファイルデータの上書きの際には、ファイル制御領域200の該当管理情報をロールバック領域300へ書き込むので、電源が断となった場合には、ロールバック領域300の管理情報をファイル制御領域200へ書き戻しすることで、ファイル制御領域200のファイル記録状態と管理情報の整合性をとることができ、安定的なシステム運用を図ることができる。   When the file data is overwritten as described above, the corresponding management information in the file control area 200 is written into the rollback area 300. Therefore, when the power is cut off, the management information in the rollback area 300 is stored in the file. By writing back to the control area 200, consistency between the file recording state of the file control area 200 and the management information can be achieved, and stable system operation can be achieved.

10 記録媒体制御部
11 FAT管理手段
12 ロールバック領域管理手段
13 更新完了確認手段
14 復旧処理手段
20 記録媒体部
200 ファイル制御領域
210 データ領域
300 ロールバック領域

DESCRIPTION OF SYMBOLS 10 Recording medium control part 11 FAT management means 12 Rollback area management means 13 Update completion confirmation means 14 Recovery processing means 20 Recording medium part 200 File control area 210 Data area 300 Rollback area

Claims (14)

記録媒体中に、ファイルを書き込む所定容量のクラスタを複数備え、
ファイル制御領域に設けられる、1つのファイルが記憶されたクラスタにおける先頭クラスタ番号情報と、前記1つのファイルが記憶されたクラスタに関するクラスタ数分のデータクラスタチェーン情報と、未使用のクラスタの数情報とを含む管理情報をFAT管理手段が用いて、前記記録媒体中のファイル管理を行うFATファイルシステムにおいて、
ロールバック領域に、ファイルの更新の際に、更新に係るファイルのその時点の前記管理情報中の所要の1つとそのセクタアドレスとより構成される管理情報コピーセットを時系列に書き込むロールバック領域管理手段と、
ファイルの更新結果と前記ファイル制御領域の管理情報の整合性がとれた場合に、前記ロールバック領域管理手段により書き込まれた管理情報コピーセットの次に、更新完了を示す完了情報を書き込む更新完了確認手段と
を備えることを特徴とするFATファイルシステム。
A plurality of clusters of a predetermined capacity for writing files in a recording medium are provided,
First cluster number information in a cluster in which one file is stored provided in the file control area, data cluster chain information for the number of clusters related to the cluster in which the one file is stored, and number information of unused clusters In a FAT file system for managing files in the recording medium using FAT management means including management information including:
Rollback area management for writing a management information copy set composed of a required one of the management information at the time of the file related to the update and its sector address to the rollback area in time series when the file is updated Means,
When the update result of the file is consistent with the management information of the file control area, the completion information indicating the completion of the update is written next to the management information copy set written by the rollback area management means. A FAT file system comprising: means.
前記記録媒体を含むシステム停止から復旧したときに、前記ロールバック領域の最終書き込み情報が完了情報でない場合に、最後に書き込まれた完了情報以降の管理情報コピーセットを時系列の新しい側から順に前記ファイル制御領域に書き戻すと共に、ロールバック領域における書き戻した情報の次に更新完了を示す完了情報を書き込む復旧処理手段を
具備することを特徴とする請求項1に記載のFATファイルシステム。
When the last write information in the rollback area is not completion information when recovering from a system stop including the recording medium, the management information copy set after the last written completion information is sequentially updated from the newest in time series. 2. The FAT file system according to claim 1, further comprising recovery processing means for writing back completion information indicating completion of updating next to the information written back in the rollback area along with writing back to the file control area.
前記FAT管理手段は、ファイルデータの上書きを行う場合に、上書きするデータを未使用のクラスタに書き込むことを特徴とする請求項1または2に記載のFATファイルシステム。   3. The FAT file system according to claim 1, wherein the FAT management unit writes the data to be overwritten in an unused cluster when overwriting the file data. 前記FAT管理手段は、ファイルデータの上書きを行う場合に、クラスタ単位で上書きすることを特徴とする請求項3に記載のFATファイルシステム。   4. The FAT file system according to claim 3, wherein the FAT management unit overwrites file data in units of clusters. 前記FAT管理手段が、1つのクラスタへ書き込みを行う毎に、ロールバック領域管理手段が対応する管理情報コピーセットを時系列に書き込むことを特徴とする請求項3または4に記載のFATファイルシステム。   5. The FAT file system according to claim 3 or 4, wherein each time the FAT management unit writes to one cluster, the rollback area management unit writes the corresponding management information copy set in time series. ロールバック領域管理手段が、対応する管理情報コピーセットを時系列に書き込むと、前記FAT管理手段が、前記ファイル制御領域の管理情報を更新することを特徴とする請求項5に記載のFATファイルシステム。   6. The FAT file system according to claim 5, wherein when the rollback area management means writes the corresponding management information copy set in time series, the FAT management means updates the management information of the file control area. . 前記FAT管理手段が全てのクラスタへの上書き処理を終了し、前記ロールバック領域管理手段が対応する管理情報コピーセットを時系列に書き込み、前記FAT管理手段が前記ファイル制御領域における管理情報の更新を完了した場合に、前記更新完了確認手段が完了情報を書き込むことを特徴とする請求項6に記載のFATファイルシステム。   The FAT management means finishes overwriting all the clusters, the rollback area management means writes the corresponding management information copy set in time series, and the FAT management means updates the management information in the file control area. 7. The FAT file system according to claim 6, wherein, when the update is completed, the update completion confirmation unit writes completion information. 記録媒体中に、ファイルを書き込む所定容量のクラスタを複数備え、前記記録媒体中のファイル管理をコンピュータが行うFATファイルシステムの前記コンピュータを、
ファイル制御領域に設けられる、1つのファイルが記憶されたクラスタにおける先頭クラスタ番号情報と、前記1つのファイルが記憶されたクラスタに関するクラスタ数分のデータクラスタチェーン情報と、未使用のクラスタの数情報とを含む管理情報を用いてファイル管理を行うFAT管理手段、
ロールバック領域に、ファイルの更新の際に、更新に係るファイルのその時点の前記管理情報中の所要の1つとそのセクタアドレスとにより構成される管理情報コピーセットを時系列に書き込むロールバック領域管理手段、
ファイルの更新結果と前記ファイル制御領域の管理情報の整合性がとれた場合に、前記ロールバック領域管理手段により書き込まれた管理情報コピーセットの次に、更新完了を示す完了情報を書き込む更新完了確認手段
として機能させることを特徴とするFATファイルシステムのプログラム。
A computer of a FAT file system comprising a plurality of clusters having a predetermined capacity for writing files in a recording medium, wherein the computer manages files in the recording medium.
First cluster number information in a cluster in which one file is stored provided in the file control area, data cluster chain information for the number of clusters related to the cluster in which the one file is stored, and number information of unused clusters FAT management means for managing files using management information including
Rollback area management for writing a management information copy set composed of a required one of the management information at that time of the file related to the update and its sector address to the rollback area in time series means,
When the update result of the file is consistent with the management information of the file control area, the completion information indicating the completion of the update is written next to the management information copy set written by the rollback area management means. A FAT file system program characterized in that it functions as means.
前記コンピュータを更に、
前記記録媒体を含むシステムがシステム停止から復旧したときに、前記ロールバック領域の最終書き込み情報が完了情報でない場合に、最後に書き込まれた完了情報以降の管理情報コピーセットを時系列の新しい側から順に前記ファイル制御領域に書き戻すと共に、ロールバック領域における書き戻した情報の次に更新完了を示す完了情報を書き込む復旧処理手段
として機能させることを特徴とする請求項8に記載のFATファイルシステムのプログラム。
Said computer further
When the system including the recording medium recovers from a system stop, if the last write information in the rollback area is not completion information, the management information copy set after the last written completion information is copied from the new time-series side. 9. The FAT file system according to claim 8, wherein the FAT file system is made to function as recovery processing means for sequentially writing back to the file control area and writing completion information indicating update completion next to the information written back in the rollback area. program.
前記コンピュータを前記FAT管理手段として、ファイルデータの上書きを行う場合に、上書きするデータを未使用のクラスタに書き込むように機能させることを特徴とする請求項8または9に記載のFATファイルシステムのプログラム。   10. The FAT file system program according to claim 8, wherein when the file data is overwritten using the computer as the FAT management means, the FAT file system functions to write overwritten data to an unused cluster. . 前記コンピュータを前記FAT管理手段として、ファイルデータの上書きを行う場合に、クラスタ単位で上書きするように機能させることを特徴とする請求項10に記載のFATファイルシステムのプログラム。   11. The FAT file system program according to claim 10, wherein when the file data is overwritten as the FAT management unit, the computer is caused to function so as to be overwritten in units of clusters. 前記コンピュータを前記FAT管理手段として、1つのクラスタへ書き込みを行う毎に、ロールバック領域管理手段が対応する管理情報コピーセットを時系列に書き込むように機能させることを特徴とする請求項10または11に記載のFATファイルシステムのプログラム。   12. The computer according to claim 10, wherein the computer serves as the FAT management unit, and the rollback area management unit functions to write the corresponding management information copy set in time series every time data is written to one cluster. The FAT file system program described in 1. 前記コンピュータをロールバック領域管理手段機能させて、対応する管理情報コピーセットを時系列に書き込むと、前記コンピュータを前記FAT管理手段として、前記ファイル制御領域の管理情報を更新するように機能させることを特徴とする請求項12に記載のFATファイルシステムのプログラム。   When the computer is caused to function as a rollback area management means and the corresponding management information copy set is written in time series, the computer is caused to function as the FAT management means so as to update the management information in the file control area. 13. The FAT file system program according to claim 12, characterized in that: 前記コンピュータを前記FAT管理手段として機能させて、全てのクラスタへの上書き処理を終了し、前記コンピュータを前記ロールバック領域管理手段として機能させて、対応する管理情報コピーセットを時系列に書き込み、前記コンピュータを前記FAT管理手段として機能させて前記ファイル制御領域における管理情報の更新を完了した場合に、前記コンピュータを前記更新完了確認手段として、完了情報を書き込むように機能させることを特徴とする請求項13に記載のFATファイルシステムのプログラム。

Causing the computer to function as the FAT management means, ending the overwriting process for all clusters, causing the computer to function as the rollback area management means, and writing the corresponding management information copy set in time series, The computer is made to function as the update completion confirmation unit so as to write completion information when the computer functions as the FAT management unit and the management information update in the file control area is completed. 13. The FAT file system program according to 13.

JP2016172170A 2016-09-02 2016-09-02 FAT file system and its program Active JP6644427B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2016172170A JP6644427B2 (en) 2016-09-02 2016-09-02 FAT file system and its program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2016172170A JP6644427B2 (en) 2016-09-02 2016-09-02 FAT file system and its program

Publications (2)

Publication Number Publication Date
JP2018037030A true JP2018037030A (en) 2018-03-08
JP6644427B2 JP6644427B2 (en) 2020-02-12

Family

ID=61567468

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2016172170A Active JP6644427B2 (en) 2016-09-02 2016-09-02 FAT file system and its program

Country Status (1)

Country Link
JP (1) JP6644427B2 (en)

Also Published As

Publication number Publication date
JP6644427B2 (en) 2020-02-12

Similar Documents

Publication Publication Date Title
US10235066B1 (en) Journal destage relay for online system checkpoint creation
US10152381B1 (en) Using storage defragmentation function to facilitate system checkpoint
CN103365743B (en) For processing the method and system of snapshot in a computing environment
JP6309103B2 (en) Snapshot and clone replication
JP4292882B2 (en) Plural snapshot maintaining method, server apparatus and storage apparatus
US8255371B2 (en) Methods and apparatuses for data protection
US7774565B2 (en) Methods and apparatus for point in time data access and recovery
US7685378B2 (en) Methods and apparatus for adjusting a journal area for continuous data protection
US8001165B2 (en) Storage system format for transaction safe file system
US10430285B2 (en) Backing up metadata
KR102033323B1 (en) Method for storing metadata of log-structured file system for flash memory
CN106407040A (en) Remote data copy method and system
JP6064608B2 (en) Storage device, backup program, and backup method
US20090216973A1 (en) Computer system, storage subsystem, and data management method
US11347600B2 (en) Database transaction log migration
JP2016051294A (en) Backup method, restoration method, storage system, and program
CN105988895B (en) Snapshot processing method and device
US11403176B2 (en) Database read cache optimization
JP4755244B2 (en) Information generation method, information generation program, and information generation apparatus
KR101738965B1 (en) Apparatus and method for journaling based on garbage collection
JP2008090378A (en) Hybrid file system, operating system, cache control method, and recording medium
CN109325005B (en) Data processing method and electronic equipment
JP4741976B2 (en) Disk array device and data management method
JP6644427B2 (en) FAT file system and its program
JP7304215B2 (en) Storage system and history information management method

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20190121

RD02 Notification of acceptance of power of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7422

Effective date: 20190121

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20191216

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20200107

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20200107

R150 Certificate of patent or registration of utility model

Ref document number: 6644427

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250