JP2011118623A - Data synchronization apparatus - Google Patents

Data synchronization apparatus Download PDF

Info

Publication number
JP2011118623A
JP2011118623A JP2009274876A JP2009274876A JP2011118623A JP 2011118623 A JP2011118623 A JP 2011118623A JP 2009274876 A JP2009274876 A JP 2009274876A JP 2009274876 A JP2009274876 A JP 2009274876A JP 2011118623 A JP2011118623 A JP 2011118623A
Authority
JP
Japan
Prior art keywords
data
fat
file
storage area
temporary storage
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.)
Pending
Application number
JP2009274876A
Other languages
Japanese (ja)
Inventor
Seikyo Suzuki
靖教 鈴木
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.)
Canon Inc
Original Assignee
Canon Inc
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 Canon Inc filed Critical Canon Inc
Priority to JP2009274876A priority Critical patent/JP2011118623A/en
Publication of JP2011118623A publication Critical patent/JP2011118623A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To reduce disk input/output processing to a FAT area which requires data updating when performing operation for writing or deleting data to/from a file in a FAT type disk. <P>SOLUTION: A data synchronization apparatus includes a means for changing data of an FAT, a means for controlling a temporary storage area when reading out or writing data and a means for writing data corresponding to a data change in a recording medium out of the data stored in the temporary storage area. The data synchronization apparatus reads out data of at least one FAT from the temporary storage area, changes the read data, calculates a position for writing the changed data in the recording medium and a writing position of the other FAT in which the contents of the data are redundantly stored by using the sizes of the FATs, and controls the calculated results so as to be stored in the temporary storage area. Further when rewriting the changed FAT data stored in the temporary storage area in the recording medium, the same data is written in the writing position of the other FAT. <P>COPYRIGHT: (C)2011,JPO&INPIT

Description

本発明はデータ同期装置に関し、特に、FATファイルシステムに用いて好適な技術に関する。   The present invention relates to a data synchronization apparatus, and more particularly to a technique suitable for use in a FAT file system.

ファイルアロケーションテーブル(File Allocation Table、以下、FAT)を用いてファイルデータを管理するファイルシステムは、一般にFATファイルシステムと呼ばれている。特に、FATファイルシステム用に論理フォーマットされたハードディスク等の記録メディアは、FAT型ディスクと呼ばれている。ユーザプログラムからの指示を受け、FAT型ディスクに対してデータの読み出しや書き込みといった動作を行う場合、FATファイルシステムでは、その入出力をセクタと呼ばれる単位で行う。ここで、1セクタの大きさは通常は512バイト、またはそのべき乗である。また、2のべき乗(1、2、4、8、16、…)個のセクタの集合はクラスタと呼ばれており、FAT型ディスク上に存在するファイルはクラスタの集合で表される。1クラスタが何個のセクタから構成されるかは主にFAT型ディスクの容量によってディスクの論理フォーマット時に決定される。   A file system that manages file data using a file allocation table (hereinafter referred to as FAT) is generally called a FAT file system. In particular, a recording medium such as a hard disk logically formatted for the FAT file system is called a FAT type disk. When receiving an instruction from the user program and performing operations such as reading and writing data on the FAT type disk, the FAT file system performs input / output in units called sectors. Here, the size of one sector is usually 512 bytes or a power thereof. A set of sectors of powers of 2 (1, 2, 4, 8, 16,...) Is called a cluster, and a file existing on a FAT type disk is represented by a set of clusters. The number of sectors in a cluster is determined at the time of logical formatting of the disk mainly by the capacity of the FAT type disk.

FATファイルシステムにより、新規にファイルを作成する場合は以下のように行われる。まず、データ内容を記録するために、初めてファイルに未使用クラスタが割り付けられると、対応するFAT項目の値は未使用を示す0000Hから、使用中かつ最終クラスタであることを示すFFFFHに変更される。そして、同じファイルに対してデータを追加記録し続けると、データ内容の大きさが1クラスタ分では足りなくなる。そこで、ファイルの最終クラスタに対応するFAT項目の値は次に新しく追加して割り付けられる未使用クラスタの位置を示すクラスタ番号に変更される。このとき、新しく追加された未使用クラスタのFAT項目の値を0000HからFFFFHに変更する。これを繰り返すことにより1つのファイルに次々とクラスタを割り付けていくことができる。以前に作成したファイルが存在し、それにデータを追加していく場合も同様である。一方、ファイルの大きさを小さくする場合、もしくはファイルを削除する場合には、操作の結果そのファイルに割り当てておく必要の無くなったクラスタに対応するFAT項目の値を0000Hに変更する。そして、新たなファイルの大きさに対して最終クラスタに対応するFAT項目の値をFFFFHに変更する。   When a new file is created by the FAT file system, it is performed as follows. First, when an unused cluster is assigned to a file for the first time in order to record data contents, the value of the corresponding FAT item is changed from 0000H indicating unused to FFFFH indicating used and the last cluster. . If data is continuously recorded on the same file, the size of the data content is insufficient for one cluster. Therefore, the value of the FAT item corresponding to the final cluster of the file is changed to a cluster number indicating the position of the unused cluster to be newly added and allocated next. At this time, the value of the FAT item of the newly added unused cluster is changed from 0000H to FFFFH. By repeating this, clusters can be assigned to one file one after another. The same applies when a previously created file exists and data is added to it. On the other hand, when the file size is reduced or the file is deleted, the value of the FAT item corresponding to the cluster which has become unnecessary to be assigned to the file as a result of the operation is changed to 0000H. Then, the value of the FAT item corresponding to the final cluster is changed to FFFFH for the new file size.

ここで、前述したようにディスク上のデータは、セクタ単位で入出力が行われる。したがって、FATの内容を更新する際は、ディスク上のデータを直接変更するのではなく、高速に入出力できる半導体メモリなどに一時保存エリア(以下、バッファ)を設ける。そして、一旦そのバッファにディスク上の元データを蓄積し、これに対して必要な変更を行い、その後適宜バッファの内容をディスク上へ書き戻すといった処理が行われる。このように、バッファの内容をディスク上へ書き戻す処理はデータ同期と呼ばれている(例えば、特許文献1参照)。   Here, as described above, the data on the disk is input / output in units of sectors. Therefore, when updating the contents of the FAT, a temporary storage area (hereinafter referred to as a buffer) is provided in a semiconductor memory or the like that can input and output at high speed, instead of directly changing data on the disk. Then, the original data on the disk is temporarily stored in the buffer, necessary changes are made to the buffer, and then the buffer contents are written back to the disk as appropriate. Thus, the process of writing back the buffer contents onto the disk is called data synchronization (see, for example, Patent Document 1).

特許第3703181号公報Japanese Patent No. 3703181

FAT型ディスクにおいては、FAT1及びFAT2の内容を常に同じものにしておく必要がある。そのため、ファイルへのデータの追加書き込みや削除などの動作に伴ってFATを更新する際には、FAT1及びFAT2の内容を、それぞれ一旦バッファ上へ読み出す。そして、それぞれに対して同じ変更を行ってからディスクに書き戻してデータを同期するといった処理が必要になる。   In a FAT type disc, it is necessary to always keep the contents of FAT1 and FAT2 the same. For this reason, when updating the FAT in accordance with an operation such as addition or deletion of data to the file, the contents of FAT1 and FAT2 are once read onto the buffer. Then, it is necessary to perform a process of making the same change to each and then writing back to the disk to synchronize the data.

また、FAT型ディスクの場合、FAT領域で各ファイルへのクラスタの割り当て状況を管理するという仕組みから、1つのファイルが使用しているクラスタの情報はFAT領域に散在している可能性がある。そのため、たとえファイルのサイズが小さくとも、更新する必要のあるFAT1及びFAT2のセクタの数が多くなる場合がある。CPU処理と比較して非常に多くの処理時間を要するディスクへの入出力動作が多くなって、結果的にファイル操作全体の処理時間が長くなるという問題がある。   Further, in the case of a FAT type disk, there is a possibility that information on clusters used by one file is scattered in the FAT area because of the mechanism of managing the allocation status of clusters to each file in the FAT area. Therefore, even if the file size is small, the number of FAT1 and FAT2 sectors that need to be updated may increase. There is a problem that the input / output operation to the disk which requires a very long processing time as compared with the CPU processing increases, and as a result, the processing time of the entire file operation becomes long.

本発明は前述の問題点に鑑み、FAT型ディスク上のファイルへのデータ書き込みや削除といった動作を行う場合に、データの更新が必要となるFAT領域へのディスク入出力処理を軽減できるようにすることを目的としている。   In view of the above-described problems, the present invention makes it possible to reduce disk input / output processing to a FAT area that requires data update when performing operations such as writing or deleting data in a file on a FAT disk. The purpose is that.

本発明のデータ同期装置は、ファイルアロケーションテーブルの大きさの情報を取得する取得手段と、前記ファイルアロケーションテーブルのデータを変更するFAT処理手段と、データの読み出しまたは書き込みを行う際の一時保存エリアの制御を行うバッファ制御手段と、前記一時保存エリアに記憶されたデータのうち、データの変更に応じて記録媒体へ書き込む同期手段とを有し、前記FAT処理手段は、少なくとも1つのファイルアロケーションテーブルのデータを前記一時保存エリアから読み出して変更し、前記変更したデータを前記記録媒体に書き込む位置と、同一の内容を保存する他のファイルアロケーションテーブルの書き込み位置とを前記取得手段により取得したファイルアロケーションテーブルの大きさを用いて算出して、前記一時保存エリアに記憶するよう前記バッファ制御手段を制御し、前記同期手段は、前記一時保存エリアに記憶された変更されたファイルアロケーションテーブルのデータを記録媒体へ書き戻す際、前記他のファイルアロケーションテーブルの書き込み位置へ同一のデータを書き込むことを特徴とする。   A data synchronization apparatus according to the present invention includes an acquisition unit that acquires information on the size of a file allocation table, a FAT processing unit that changes data in the file allocation table, and a temporary storage area when data is read or written. Buffer control means for performing control, and synchronization means for writing to a recording medium in accordance with a change in data among data stored in the temporary storage area, and the FAT processing means includes at least one file allocation table A file allocation table in which data is read from the temporary storage area and changed, and a position at which the changed data is written to the recording medium and a write position of another file allocation table that stores the same contents are acquired by the acquisition unit. Is calculated using the size of The buffer control means is controlled to store in the temporary storage area, and the synchronization means writes the changed file allocation table data stored in the temporary storage area to the recording medium when the other file is written back. It is characterized in that the same data is written to the write position of the allocation table.

本発明によれば、重複する一方のファイルアロケーションテーブルのバッファ上への読み出し処理を省略することができる。これにより、その分高速にファイルデータの書き込みや、ファイルの削除といった動作を行うことができる。   According to the present invention, it is possible to omit the process of reading one of the overlapping file allocation tables onto the buffer. As a result, operations such as writing file data and deleting files can be performed at a higher speed.

データ同期装置の機能構成例を示すブロック図である。It is a block diagram which shows the function structural example of a data synchronizer. データ同期装置のハードウェア構成例を示すブロック図である。It is a block diagram which shows the hardware structural example of a data synchronizer. FAT型ディスクのフォーマットの一例を示す図である。It is a figure which shows an example of the format of a FAT type | mold disk. FAT領域の構造例を示す図である。It is a figure which shows the structural example of a FAT area | region. ルートディレクトリ領域に記録されている情報の一例を示す図である。It is a figure which shows an example of the information currently recorded on the root directory area | region. バッファの構成例を示す図である。It is a figure which shows the structural example of a buffer. FATの更新処理手順の一例を示すフローチャートである。It is a flowchart which shows an example of the update process procedure of FAT. バッファデータの同期処理の手順の一例を示すフローチャートである。It is a flowchart which shows an example of the procedure of the synchronization process of buffer data.

(第1の実施形態)
以下、本発明の第1の実施形態について図面を参照しながら説明する。
図1は、本実施形態に係るファイルアロケーションテーブル(FAT)を用いたFATファイルシステムにおけるデータ同期装置の機能構成例を示すブロック図である。
図1において、101はFATファイルシステムを利用するユーザプログラムであり、102は本実施形態によるFATデータ同期方式を実現するFATファイルシステムプログラムである。103はユーザプログラム101からの要求を受け付け、ファイルディスクリプタを管理してファイル名などで指定されたファイルを開閉する処理や、新規ファイルの作成、読み出し、書き込み動作のファイルポインタの管理などを行うファイル処理部である。
(First embodiment)
Hereinafter, a first embodiment of the present invention will be described with reference to the drawings.
FIG. 1 is a block diagram illustrating a functional configuration example of a data synchronization apparatus in a FAT file system using a file allocation table (FAT) according to the present embodiment.
In FIG. 1, 101 is a user program that uses the FAT file system, and 102 is a FAT file system program that implements the FAT data synchronization system according to the present embodiment. A file process 103 receives a request from the user program 101, manages a file descriptor, opens and closes a file specified by a file name, and manages a file pointer for creating, reading, and writing a new file. Part.

104はディスクから読み出されたディレクトリエントリ情報を解析して、ユーザプログラム101から指示されたファイルの存在を検索するディレクトリ処理部である。また、ディレクトリ処理部104は、ファイルの先頭部分のデータの含まれるクラスタ(開始クラスタ)番号を取得するとともに、最新のファイル情報をディレクトリエントリに書き込むといったディレクトリエントリの解析や更新等を行う。105は読み出し及び書き込みの対象となるファイルのファイル位置からディスク上のクラスタ番号をディレクトリエントリやFAT領域の情報を解析して取得するFAT処理部である。また、FAT処理部105は、ファイルへデータを追加したり、ファイルを削除した場合には当該ファイルのFATチェインを正しく形成してFAT領域に書き込んだりする処理などを行う。   A directory processing unit 104 analyzes the directory entry information read from the disk and searches for the existence of a file designated by the user program 101. Further, the directory processing unit 104 obtains a cluster (start cluster) number including the data of the head portion of the file, and performs analysis and update of the directory entry such as writing the latest file information in the directory entry. A FAT processing unit 105 obtains a cluster number on the disk from the file position of the file to be read and written by analyzing information on the directory entry and the FAT area. Further, the FAT processing unit 105 performs processing such as adding data to a file or deleting a file and correctly forming the FAT chain of the file and writing it in the FAT area.

106はファイル処理部103、ディレクトリ処理部104及びFAT処理部105からの要求により、内部管理する一時保存エリアのバッファ内に格納されている指定されたセクタのデータを要求元へ返す処理を行うバッファ制御部である。また、バッファ制御部106は、指示に従って変更されたバッファの内容をディスクに書き戻す処理も行う。107は実際のデータの格納領域となるハードディスク、またはフラッシュメモリカードといった記録媒体のディスク(記録メディア)108から各種データを読み出す、またはディスク108へデータを書き込むディスクドライバ部である。   A buffer 106 performs processing to return data of a designated sector stored in a buffer of a temporary storage area to be internally managed to a request source in response to requests from the file processing unit 103, the directory processing unit 104, and the FAT processing unit 105 It is a control unit. The buffer control unit 106 also performs processing for writing back the buffer contents changed according to the instruction to the disk. Reference numeral 107 denotes a disk driver unit that reads out various data from a disk (recording medium) 108 of a recording medium such as a hard disk or a flash memory card as an actual data storage area or writes data to the disk 108.

図2は、本実施形態に係るデータ同期装置のハードウェア構成例を示すブロック図である。
図2において、201はCPUであり、上述のユーザプログラム101やFATファイルシステムプログラム102をロードして実行する。202はRAMであり、上述のユーザプログラム101やFATファイルシステムプログラム102、ディスクドライバ部107を機能させるプログラムを格納する。さらにRAM202は、バッファ制御部106によるディスク108上のデータの読み出し、または書き込みの際のバッファ領域として使用される。また、各ソフトウエアプログラムの動作時に使用する各種変数の退避、或は保存用のワークエリアとして使用される。203はファイルデータの格納領域となるFAT型のディスク108との間で読み出し及び書き込みを行うためのディスク装置である。204はCPU201、RAM202、及びディスク装置203を接続するシステムバスである。
FIG. 2 is a block diagram illustrating a hardware configuration example of the data synchronization apparatus according to the present embodiment.
In FIG. 2, 201 is a CPU that loads and executes the above-described user program 101 and FAT file system program 102. Reference numeral 202 denotes a RAM which stores a program for causing the above-described user program 101, FAT file system program 102, and disk driver unit 107 to function. Further, the RAM 202 is used as a buffer area when the buffer control unit 106 reads or writes data on the disk 108. In addition, it is used as a work area for saving or saving various variables used during the operation of each software program. Reference numeral 203 denotes a disk device for reading from and writing to the FAT disk 108 serving as a file data storage area. A system bus 204 connects the CPU 201, RAM 202, and disk device 203.

図6は、バッファ制御部106により制御されるバッファの構成例を示す図である。
図6において、バッファは、バッファの状態を示す状態ビット601、そのバッファの内容が存在するセクタ番号602、及びディスク108からバッファへとコピーされるデータ603本体に区分される。状態ビット601には、そのバッファの内容がディスク108への書き出しを要することを示すdirtyビットが含まれている。なお、それ以外の状態については任意であるとする。以上の構成のバッファは、RAM202上にユーザプログラム101が動作するために十分な領域が確保される。
FIG. 6 is a diagram illustrating a configuration example of a buffer controlled by the buffer control unit 106.
In FIG. 6, the buffer is divided into a status bit 601 indicating the status of the buffer, a sector number 602 where the contents of the buffer exist, and a data 603 main body to be copied from the disk 108 to the buffer. The status bit 601 includes a dirty bit indicating that the buffer content needs to be written to the disk 108. The other states are arbitrary. The buffer having the above configuration secures a sufficient area on the RAM 202 for the user program 101 to operate.

次に、本実施形態におけるFATファイルシステムによるFATの更新処理動作について説明する。なお、本実施形態におけるFAT型のディスク108の記録フォーマット、ディレクトリエントリの構成、およびFAT領域の構成はそれぞれ、図3、図4及び図5に示すものである。   Next, the FAT update processing operation by the FAT file system in this embodiment will be described. It should be noted that the recording format, directory entry structure, and FAT area structure of the FAT type disk 108 in this embodiment are shown in FIGS. 3, 4 and 5, respectively.

図3は、FAT型ディスクのフォーマットの一例を示す図であり、基本的な構造は、MS−DOS(登録商標)で採用されているものと同じである。
図3において、301は先頭の1セクタ目(論理セクタ番号0)を示すブートセクタである。ブートセクタ301には、オペレーティングシステムをロードするためのブートプログラム、前述のセクタ/クラスタ数、後述するFAT領域に使用されているセクタの数、ルートディレクトリエントリの個数などの情報が記録されている。
FIG. 3 is a diagram showing an example of the format of the FAT disk, and the basic structure is the same as that adopted in MS-DOS (registered trademark).
In FIG. 3, reference numeral 301 denotes a boot sector indicating the first sector (logical sector number 0). In the boot sector 301, information such as a boot program for loading an operating system, the number of sectors / clusters described above, the number of sectors used in a FAT area described later, and the number of root directory entries are recorded.

302はFAT領域であり、クラスタの所在とファイル本体(内容)へのクラスタの割り付け(アロケーション)状況とを兼ねたそのクラスタ番号に続く次のクラスタ番号を示すFAT項目を記録する領域である。FAT領域302は安全性を確保するために2重化されており、図3における第1のFAT領域(以降、FAT1)と第2のFAT領域(以降、FAT2)とには常に同一の内容のものが記録されるようになっている。また、FAT1とFAT2はディスク上に連続して配置されている。   Reference numeral 302 denotes a FAT area, which is an area for recording a FAT item indicating the next cluster number following the cluster number, which serves both as the location of the cluster and the allocation (allocation) status of the cluster to the file body (content). The FAT area 302 is duplicated to ensure safety, and the first FAT area (hereinafter, FAT1) and the second FAT area (hereinafter, FAT2) in FIG. 3 always have the same contents. Things are going to be recorded. FAT1 and FAT2 are continuously arranged on the disk.

図4は、FAT領域302の構造例を示す図である。現在一般に広く使用されているFAT型ディスクには、1クラスタ分のFAT項目を示すために、12ビット、16ビット、または32ビットを使用するものがあるが、本実施形態では16ビットの場合を例に説明する。
図4において、各FAT項目の先頭からの位置は、そのままその項目で管理しているクラスタの位置に対応している。なお、各項目の初期値は0000H(16進数0)であり、これは未使用状態を示している。
FIG. 4 is a diagram illustrating a structure example of the FAT area 302. Some FAT-type discs that are currently widely used use 12 bits, 16 bits, or 32 bits to indicate a FAT item for one cluster. In this embodiment, the case of 16 bits is used. Explained as an example.
In FIG. 4, the position from the top of each FAT item corresponds to the position of the cluster managed by that item as it is. The initial value of each item is 0000H (hexadecimal number 0), which indicates an unused state.

図3の説明に戻り、303はルートディレクトリ領域であり、ファイルの所在を管理する領域である。1つのファイルに対応する項目は32バイトで表現される。ルートディレクトリ領域303には、図5に示すように、ファイルの名前や大きさ(ファイルサイズ)、そのファイルのデータが含まれている先頭のクラスタ(開始クラスタ)番号などの情報が記録されている。   Returning to the description of FIG. 3, reference numeral 303 denotes a root directory area, which is an area for managing the location of a file. An item corresponding to one file is expressed by 32 bytes. In the root directory area 303, as shown in FIG. 5, information such as the name and size of the file (file size) and the first cluster (starting cluster) number including the data of the file are recorded. .

304はデータ領域であり、実際のファイルの内容(データ本体)やルートディレクトリに属するディレクトリに関する情報を記録する領域である。FAT領域302と同様、データ領域はクラスタ単位で管理され、そのクラスタが属しているファイルとクラスタとのつながりの順序、あるいは未使用クラスタであるといった情報はFAT領域302によって管理されている。したがって、あるファイルに属するクラスタの集合とクラスタとのつながりの順序はFAT領域302によって論理的に連続してつながっていることになり、データ領域304においては、必ずしも一つのファイルのデータが物理的に連続しているとは限らない。また、1つのFAT領域の大きさを示すFATセクタ数は、ファイルの処理の対象のディスクに最初にアクセスがあった時点で、ブートセクタ301からその値を求め、すでにそれがRAM202上に記憶されているものとする。   Reference numeral 304 denotes a data area in which information about the actual file contents (data body) and the directory belonging to the root directory is recorded. Similar to the FAT area 302, the data area is managed in units of clusters, and information such as the order of connection between the file to which the cluster belongs and the cluster, or an unused cluster is managed by the FAT area 302. Accordingly, the order of connection between clusters and clusters belonging to a certain file is logically continuously connected by the FAT area 302. In the data area 304, data of one file is not necessarily physically connected. It is not always continuous. The number of FAT sectors indicating the size of one FAT area is obtained from the boot sector 301 when the file processing target disk is first accessed, and is already stored in the RAM 202. It shall be.

図7は、本実施形態におけるFATの更新処理手順の一例を示すフローチャートである。
まず、ステップS701において、FAT処理部105の制御によりバッファ制御部106は、これから更新するFAT項目の存在するセクタの番号を、図6のセクタ番号602に記憶する。なお、ディスク108上に図3に示すようなFAT1、FAT2の両方に存在するが、ここではFAT1の範囲にある該当のセクタ番号を記憶する。
FIG. 7 is a flowchart illustrating an example of a FAT update processing procedure according to the present embodiment.
First, in step S701, under the control of the FAT processing unit 105, the buffer control unit 106 stores the sector number in which the FAT item to be updated is present in the sector number 602 in FIG. In addition, although it exists in both FAT1 and FAT2 as shown in FIG. 3 on the disk 108, the corresponding sector number in the range of FAT1 is stored here.

次に、ステップS702において、バッファ制御部106は、ステップS701で記憶したセクタ番号のデータを図6のデータ603に書き込む。そして、ステップS703において、バッファ制御部106は、ステップS702で書き込まれたバッファ上で、指示通りに該当するFAT項目を変更する。そして、ステップS704において、バッファ制御部106は、変更を行ったことを示すため、状態ビット601のdirtyビットを立てて処理を終了する。   Next, in step S702, the buffer control unit 106 writes the sector number data stored in step S701 into the data 603 in FIG. In step S703, the buffer control unit 106 changes the corresponding FAT item as instructed on the buffer written in step S702. In step S704, the buffer control unit 106 sets the dirty bit of the status bit 601 to end the process to indicate that the change has been made.

一方、バッファの同期処理はユーザプログラム101から任意のタイミングで指示されることにより適宜行われる。図8は、バッファデータの同期処理の手順の一例を示すフローチャートである。なお、図8に示す各処理は、バッファ制御部106の制御により行われる。
まず、ステップS801において、状態ビット601のdirtyビットを参照して、そのバッファがディスク108への書き込みを必要とするセクタのものであるか否かを判断する。ディスク108への書き込みが必要ない場合は、ステップS805に進む。
On the other hand, the buffer synchronization processing is appropriately performed by an instruction from the user program 101 at an arbitrary timing. FIG. 8 is a flowchart illustrating an example of a procedure of buffer data synchronization processing. 8 is performed under the control of the buffer control unit 106.
First, in step S801, the dirty bit of the status bit 601 is referred to and it is determined whether or not the buffer is of a sector that needs to be written to the disk 108. If writing to the disk 108 is not necessary, the process proceeds to step S805.

一方、ステップS801の判断の結果、ディスク108への書き込みを必要とするセクタのものである場合は、ステップS802に進む。そして、そのバッファのセクタ番号602を参照して、しかるべきFAT1領域のセクタへデータ603を書き込むようにディスクドライバ部107へと指示を出す。次に、ステップS803において、あらかじめ求められたFATサイズnから、FAT2の該当するセクタ番号を算出する。具体的には、セクタ番号602にFATサイズnを足したものになる。   On the other hand, if it is determined in step S801 that the sector needs to be written to the disk 108, the process proceeds to step S802. Then, referring to the sector number 602 of the buffer, the disk driver unit 107 is instructed to write the data 603 to the sector in the appropriate FAT1 area. Next, in step S803, the corresponding sector number of FAT2 is calculated from the FAT size n obtained in advance. Specifically, the sector number 602 is added with the FAT size n.

次に、ステップS804において、ステップS802で書き込むよう指示したバッファのデータ603を、ステップS803で求めた対応するFAT2領域のセクタへと書き込むようにディスクドライバ部107へ指示する。そして、ステップS805において、全てのバッファに対し処理が終了下か否かを判断し、終了していない場合はステップS801に戻り、終了した場合はそのまま処理を終了する。以上のように、ステップS801〜ステップS804までの処理は、全てのバッファに対して繰り返し行われる。このように、一切FAT2領域の内容をバッファに読み出さず、ファイルへのデータの追加書込み、削除等のファイル操作に伴って変更されたFATデータを、FAT1及びFAT2の両方へ同じ内容のデータを書き込むことができる。   In step S804, the disk driver unit 107 is instructed to write the buffer data 603 instructed to be written in step S802 to the sector in the corresponding FAT2 area obtained in step S803. In step S805, it is determined whether or not processing has been completed for all buffers. If not completed, the process returns to step S801. If completed, the process ends. As described above, the processing from step S801 to step S804 is repeated for all buffers. In this way, the contents of the FAT2 area are not read into the buffer at all, and the FAT data changed in accordance with the file operation such as addition writing or deletion of data to the file is written to both FAT1 and FAT2. be able to.

なお、本実施形態では、図6に示す構成でRAM202に確保されたバッファはFATデータ専用とした。ところが、このバッファはディレクトリエントリデータやファイルデータ用のバッファと共通のバッファとして用いてもよい。その場合、状態ビット601にFATビットを設け、そのバッファがディレクトリエントリデータやファイルデータとは区別されることを示すこととする。バッファの同期操作の際に、状態ビット601を参照してFATビットが立っている(例えば零以外)場合にのみ、同じバッファのデータ603をFAT2の対応するセクタに書き込むことにより、同様の効果が得られる。   In the present embodiment, the buffer secured in the RAM 202 with the configuration shown in FIG. 6 is dedicated to FAT data. However, this buffer may be used as a buffer common to the directory entry data and file data buffers. In this case, a FAT bit is provided in the status bit 601 to indicate that the buffer is distinguished from directory entry data and file data. The same effect can be obtained by writing the data 603 of the same buffer to the corresponding sector of FAT2 only when the FAT bit is set (for example, other than zero) with reference to the status bit 601 during the buffer synchronization operation. can get.

(その他の実施形態)
また、本発明は、以下の処理を実行することによっても実現される。即ち、上述した実施形態の機能を実現するソフトウェア(プログラム)を、ネットワーク又は各種記憶媒体を介してシステム或いは装置に供給し、そのシステム或いは装置のコンピュータ(またはCPUやMPU等)がプログラムを読み出して実行する処理である。
(Other embodiments)
The present invention can also be realized by executing the following processing. That is, software (program) that realizes the functions of the above-described embodiments is supplied to a system or apparatus via a network or various storage media, and a computer (or CPU, MPU, or the like) of the system or apparatus reads the program. It is a process to be executed.

105 FAT処理部、106 バッファ制御部、107 ディスクドライバ部、108 ディスク 105 FAT processing unit, 106 buffer control unit, 107 disk driver unit, 108 disk

Claims (1)

ファイルアロケーションテーブルの大きさの情報を取得する取得手段と、
前記ファイルアロケーションテーブルのデータを変更するFAT処理手段と、
データの読み出しまたは書き込みを行う際の一時保存エリアの制御を行うバッファ制御手段と、
前記一時保存エリアに記憶されたデータのうち、データの変更に応じて記録媒体へ書き込む同期手段とを有し、
前記FAT処理手段は、少なくとも1つのファイルアロケーションテーブルのデータを前記一時保存エリアから読み出して変更し、前記変更したデータを前記記録媒体に書き込む位置と、同一の内容を保存する他のファイルアロケーションテーブルの書き込み位置とを前記取得手段により取得したファイルアロケーションテーブルの大きさを用いて算出して、前記一時保存エリアに記憶するよう前記バッファ制御手段を制御し、
前記同期手段は、前記一時保存エリアに記憶された変更されたファイルアロケーションテーブルのデータを記録媒体へ書き戻す際、前記他のファイルアロケーションテーブルの書き込み位置へ同一のデータを書き込むことを特徴とするデータ同期装置。
An acquisition means for acquiring size information of the file allocation table;
FAT processing means for changing data in the file allocation table;
Buffer control means for controlling the temporary storage area when reading or writing data;
Of the data stored in the temporary storage area, having synchronization means for writing to the recording medium in accordance with the data change,
The FAT processing means reads and changes data in at least one file allocation table from the temporary storage area, and stores the same content as the position where the changed data is written to the recording medium. Calculating the write position using the size of the file allocation table acquired by the acquisition means, and controlling the buffer control means to store in the temporary storage area,
The synchronization means writes the same data to the write position of the other file allocation table when the changed file allocation table data stored in the temporary storage area is written back to the recording medium. Synchronizer.
JP2009274876A 2009-12-02 2009-12-02 Data synchronization apparatus Pending JP2011118623A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2009274876A JP2011118623A (en) 2009-12-02 2009-12-02 Data synchronization apparatus

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2009274876A JP2011118623A (en) 2009-12-02 2009-12-02 Data synchronization apparatus

Publications (1)

Publication Number Publication Date
JP2011118623A true JP2011118623A (en) 2011-06-16

Family

ID=44283878

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2009274876A Pending JP2011118623A (en) 2009-12-02 2009-12-02 Data synchronization apparatus

Country Status (1)

Country Link
JP (1) JP2011118623A (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH04106643A (en) * 1990-08-27 1992-04-08 Nec Ibaraki Ltd System for managing file area of floppy disk
JP2001188701A (en) * 1999-10-21 2001-07-10 Matsushita Electric Ind Co Ltd Accessing device for semiconductor memory card and computer readable recording medium and initializing method and semiconductor memory card
WO2005008499A1 (en) * 2003-07-16 2005-01-27 Matsushita Electric Industrial Co., Ltd. Data area managing method in information recording medium and information processor employing data area managing method
JP2007087063A (en) * 2005-09-21 2007-04-05 Canon Inc Fat file system, file management method, program and storage medium
JP2007310447A (en) * 2006-05-16 2007-11-29 Buffalo Inc Data storage device and initializing method thereof
JP2009064263A (en) * 2007-09-06 2009-03-26 Toshiba Corp Memory device

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH04106643A (en) * 1990-08-27 1992-04-08 Nec Ibaraki Ltd System for managing file area of floppy disk
JP2001188701A (en) * 1999-10-21 2001-07-10 Matsushita Electric Ind Co Ltd Accessing device for semiconductor memory card and computer readable recording medium and initializing method and semiconductor memory card
WO2005008499A1 (en) * 2003-07-16 2005-01-27 Matsushita Electric Industrial Co., Ltd. Data area managing method in information recording medium and information processor employing data area managing method
JP2007087063A (en) * 2005-09-21 2007-04-05 Canon Inc Fat file system, file management method, program and storage medium
JP2007310447A (en) * 2006-05-16 2007-11-29 Buffalo Inc Data storage device and initializing method thereof
JP2009064263A (en) * 2007-09-06 2009-03-26 Toshiba Corp Memory device

Similar Documents

Publication Publication Date Title
US10635310B2 (en) Storage device that compresses data received from a host before writing therein
JP6033241B2 (en) Backup and restore strategies for data deduplication
JP6046216B2 (en) Host system and host controller
US8316201B2 (en) Methods for executing a command to write data from a source location to a destination location in a memory device
US9778860B2 (en) Re-TRIM of free space within VHDX
KR100317691B1 (en) Efficient volume copy using pre-configuration of log structured target storage
TWI531963B (en) Data storage systems and their specific instruction enforcement methods
US7330947B2 (en) Method and apparatus for backing up data in virtual storage medium
CN108628542B (en) File merging method and controller
JP2007220101A (en) Method and apparatus for managing block according to update type of data in block-type memory
JP6867578B2 (en) Storage controller, storage system, storage control method and storage control program
JP2017204037A (en) Information processor, duplication elimination program, and duplication elimination method
US20120137063A1 (en) Auxiliary storage device and processing method thereof
JP2006313531A (en) File management system
WO2020241545A1 (en) Information processing device
JP2008262452A (en) Cache method of recording device, and recording device
JP2011118623A (en) Data synchronization apparatus
JP4920937B2 (en) FAT file system, file management method, program, and storage medium
JP2010003150A (en) Memory controller and method for managing data in flash memory
JP2014059760A (en) Storage device, control method of storage device, and control program of storage device
US20100274828A1 (en) Electronic Device, Storage Area Allocation Method for File System, and Computer Product
JP2681986B2 (en) Computer system
JP2006127377A (en) Fat file system
JP2008134777A (en) Caching method of file allocation table
JP5161989B2 (en) Information recording apparatus, information recording method, and information recording program

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20121203

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20131031

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20131112

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20140110

A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20140218