JP2006106810A - File management device, file management method, recording medium, and program - Google Patents

File management device, file management method, recording medium, and program Download PDF

Info

Publication number
JP2006106810A
JP2006106810A JP2004288306A JP2004288306A JP2006106810A JP 2006106810 A JP2006106810 A JP 2006106810A JP 2004288306 A JP2004288306 A JP 2004288306A JP 2004288306 A JP2004288306 A JP 2004288306A JP 2006106810 A JP2006106810 A JP 2006106810A
Authority
JP
Japan
Prior art keywords
file
recording
unused
area
cluster
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
JP2004288306A
Other languages
Japanese (ja)
Inventor
Makoto Kobayashi
誠 小林
Tadashi Takayama
正 高山
Kyohei Inukai
恭平 犬飼
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 JP2004288306A priority Critical patent/JP2006106810A/en
Publication of JP2006106810A publication Critical patent/JP2006106810A/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 perform at high speed a process for deleting a file so as to achieve high-speed access, thereby avoiding the life of a recording medium from shortening, and facilitating file restoration. <P>SOLUTION: A file management device, which causes files handled by users and directories to be associated with one another on an actual physical disc to form the files and the directories themselves, manages a recording area by dividing the area into a plurality of areas, and manages an unused cluster in each of the areas by means of a chain structure. To delete a file, the cluster of the file is coupled to the rear end of an unused cluster chain. The unused clusters are rearranged. <P>COPYRIGHT: (C)2006,JPO&NCIPI

Description

本発明は、ファイル管理装置、及びファイル管理方式に関し、特にユーザが扱うファイルやディレクトリを実際の物理的なディスク上に対応させて、ファイルやディレクトリ自体を構成するファイル管理装置、及びファイル管理方式に関するものである。   The present invention relates to a file management apparatus and a file management system, and more particularly to a file management apparatus and a file management system that configure files and directories themselves by associating files and directories handled by a user on an actual physical disk. Is.

従来、数多くのデータをファイルとして管理する方式として、FAT(File Allocation Table)ファイルシステムが知られている。FATファイルシステムは、MS−DOSやWindows(登録商標)で使用されていたが、現在では、Linuxや各種Unix(登録商標)などの汎用OS(Operating System)のほか、ディジタルカメラやMP3プレイヤーなどのコンシューマ向け機器、各種測定器など、フレキシブルディスクや着脱式のフラッシュメモリ(CFカードなど)を備える様々な機器で広くサポートされている。今や、リムーバブルメディアにおけるデファクトスタンダードといえるファイル管理方式である。   Conventionally, a FAT (File Allocation Table) file system is known as a method for managing a large amount of data as files. The FAT file system was used in MS-DOS and Windows (registered trademark), but nowadays, in addition to general-purpose OS (Operating System) such as Linux and various Unix (registered trademark), digital cameras, MP3 players, etc. Widely supported by various devices including flexible disks and removable flash memories (CF cards, etc.) such as consumer devices and various measuring instruments. Now, it is a file management method that can be called the de facto standard in removable media.

図12は、従来のFATファイルシステムの配列を示す。図12を参照して、DOSやWindows(登録商標)のFATファイルシステムについて説明する。FATファイルシステムは、ブートセクタと、2つのFAT、ルートディレクトリ(ディレクトリエントリ領域)、及びデータ領域とから構成される。FAT2はFAT1と同一の内容が記録されており、FAT1が壊れてもFAT2を参照することによりシステムは機能する。   FIG. 12 shows an arrangement of a conventional FAT file system. A FAT file system of DOS or Windows (registered trademark) will be described with reference to FIG. The FAT file system includes a boot sector, two FATs, a root directory (directory entry area), and a data area. The same content as FAT1 is recorded in FAT2, and the system functions by referring to FAT2 even if FAT1 is broken.

ブートセクタには、論理的なセクタ長、トラック数、1トラック当たりのセクタ数など、記録媒体の論理構造データであるBPB(BIOS Parameter Block)や、DOSやWindows(登録商標)で使用されるブートストラップローダが記録される。   The boot sector includes BPB (BIOS Parameter Block), which is the logical structure data of the recording medium, such as the logical sector length, the number of tracks, and the number of sectors per track, and the boot used in DOS and Windows (registered trademark). The strap loader is recorded.

データ領域には、各ファイルのデータ本体が分割されて格納され、幾つかのセクタをひとまとめにしたクラスタと呼ばれる単位で管理される。FATには、データ領域上の一連のクラスタの構成を示す情報、即ちクラスタの使用状況が記録されている。従って、分割されたファイルのデータがクラスタを単位として記録されているので、ファイルのデータのディスク上の物理的な位置は連続しているわけではない。   In the data area, the data body of each file is divided and stored, and managed in units called clusters in which several sectors are grouped. In the FAT, information indicating the configuration of a series of clusters on the data area, that is, the usage status of the clusters is recorded. Therefore, since the divided file data is recorded in units of clusters, the physical positions of the file data on the disk are not continuous.

FATファイルシステムは、フレキシブルディスクやハードディスクなどのブロックデバイス上のファイルやディレクトリを実際の物理的なディスク上に対応させ、ファイルやディレクトリ自体を構成する体系であり、ディレクトリエントリとFATという情報によって管理される。   The FAT file system is a system in which files and directories on block devices such as flexible disks and hard disks are made to correspond to actual physical disks, and the files and directories themselves are configured, and is managed by information called directory entries and FAT. The

図13は、従来のFATエントリの一例を示す。この例では、FATエントリ2から始まるファイルは、データ領域のクラスタ番号2(0x00000002)に記録され、続いてクラスタ番号3(0x00000003)、さらに、クラスタ番号4(0x00000004)、5(0x00000002)にその後のデータが記録されていることを示している。FATエントリ5に0xFFFFFFFF(EOFマーク)が書き込まれていることから、このクラスタ番号がファイルデータの最終記録位置である。また、FATエントリの値が0x00000000であるクラスタ6〜8は、未使用領域であることを示している。なおFATエントリ0、1は予約領域(RSVマーク)である。   FIG. 13 shows an example of a conventional FAT entry. In this example, the file starting with FAT entry 2 is recorded in cluster number 2 (0x00000002) in the data area, followed by cluster number 3 (0x00000003), and then cluster number 4 (0x00000004) and 5 (0x00000002). Indicates that data is being recorded. Since 0xFFFFFFFF (EOF mark) is written in the FAT entry 5, this cluster number is the final recording position of the file data. In addition, the clusters 6 to 8 whose FAT entry value is 0x00000000 are unused areas. FAT entries 0 and 1 are reserved areas (RSV marks).

FATエントリのクラスタ番号は、ファイルデータが分割されて記録されるクラスタと1対1に対応しており、ファイル本体を構成するデータ領域上のクラスタ番号の集合のうち、夫々後に続くクラスタ番号を保持している。従って、例えクラスタの物理的位置が離れていても、FATの一連のクラスタ番号を読み取っていけば、データ領域上に格納されているクラスタを順に読み出し、分割されたファイル本体を再構成することが可能である。また、後続するクラスタがないFATエントリ、即ち、対応するクラスタがファイルの最終クラスタである場合は、その旨を示すユニークな値0xFFFFFFFFが書き込まれる。また、値が0x00000000であるFATエントリは未使用領域であることを意味する。ただし、各ファイルの一連のクラスタ番号のうち、先頭のクラスタ番号だけはディレクトリエントリに書き込まれる。   The cluster number of the FAT entry has a one-to-one correspondence with the cluster in which the file data is divided and recorded, and holds the cluster number that follows each of the set of cluster numbers on the data area constituting the file body. is doing. Therefore, even if the physical positions of the clusters are separated, if the series of FAT cluster numbers are read, the clusters stored in the data area are read in order, and the divided file body can be reconfigured. Is possible. If the FAT entry has no subsequent cluster, that is, if the corresponding cluster is the last cluster of the file, a unique value 0xFFFFFFFF indicating that fact is written. A FAT entry whose value is 0x00000000 means an unused area. However, of the series of cluster numbers of each file, only the first cluster number is written to the directory entry.

図14は、図12に示したディレクトリエントリ領域に記録されるディレクトリエントリのフォーマットである。1つのディレクトリエントリは32バイトで構成され、ファイル名、拡張子、属性、更新日時、開始クラスタ、ファイルサイズなどが記録される。   FIG. 14 shows the format of the directory entry recorded in the directory entry area shown in FIG. One directory entry is composed of 32 bytes, and the file name, extension, attribute, update date / time, start cluster, file size, and the like are recorded.

FATファイルシステムの長所としては、以下のことが挙げられる。
(1)FATチェーンを順に追えば、次々とファイルを構成するクラスタがわかるので、シーケンシャルファイルに向いている。
(2)ファイルの管理情報をあらかじめRAMに読み込み常駐させておき、オーディオビデオ情報の再生中に余分なシークが発生しないようにしたい場合、ファイルの位置情報を示す情報やルートディレクトリがFATとして1箇所に集中しているので、RAMへ常駐させやすい。従って、MS−DOSやWindows(登録商標)に限らず、他の多くのOSでもサポートされることが多い。
Advantages of the FAT file system include the following.
(1) If the FAT chain is followed in order, the clusters constituting the file can be found one after another, which is suitable for sequential files.
(2) When file management information is read and resident in advance in RAM and it is desired to prevent an excessive seek from occurring during reproduction of audio-video information, information indicating the position information of the file and the root directory are one place as FAT. It is easy to make it resident in RAM. Therefore, not only MS-DOS and Windows (registered trademark) but also many other OSs are often supported.

一方で、FATファイルシステムにも幾つかの短所が存在する。例えば、特開平4−139543号公報においては、ファイルを新しく作成する場合に、そのファイルに使用するためのFATとして未使用であるFATのうちFAT番号の小さい順にFATを割り当てるため、ファイルの削除、及び作成を頻繁に行うとFAT番号の小さいFATが常に使用されることになり、記録媒体の同じ部分ばかり使用されるので、記録媒体の寿命を縮めるという欠点を指摘している。さらに、削除したばかりのファイルにおいて、そのFAT番号が小さい場合には、次に新しくファイルを作成することにより、そのファイルのFATが使用されてしまうため、そのファイルの復元が不可能になるという欠点も指摘している。   On the other hand, the FAT file system has some disadvantages. For example, in Japanese Patent Application Laid-Open No. 4-139543, when a file is newly created, the FAT is assigned in the order of the smallest FAT number among the FATs not used as the FAT for use in the file. If the production is frequently performed, the FAT having a small FAT number is always used, and since only the same part of the recording medium is used, it points out the disadvantage of shortening the life of the recording medium. Furthermore, if the FAT number of the file that has just been deleted is small, the FAT of the file is used by creating a new file next, so that the file cannot be restored. Also pointed out.

その課題を解決するため、未使用FATのチェーンを有し、未使用にになったFATは、その未使用FATのチェーンの末尾に追加され、使用するときには、未使用FATのチェーンの先頭から使用することにより上記課題を解決するファイル管理方式が開示されている(例えば、特許文献1を参照。)。   In order to solve this problem, an unused FAT chain is added to the end of the unused FAT chain, and when used, it is used from the beginning of the unused FAT chain. Thus, a file management system that solves the above-described problems has been disclosed (see, for example, Patent Document 1).

また、ファイル削除時に、それまでファイルを構成するクラスタの識別番号を保持していた全てのFATエントリを0x00000000にクリアしなければならなく、その作業自体は単純であるものの回数の多いループを伴い、結果的には処理が遅くなるという欠点を指摘している。さらに、ファイルの末尾に新たな領域をつなげるために、そのファイルに対応するFATエントリを順に最後まで操作しなければならず、やはり回数の多いループを処理しなければならないという問題がある。   Also, when deleting a file, all FAT entries that had previously retained the identification numbers of the clusters that make up the file must be cleared to 0x00000000, and the operation itself is simple but involves a large number of loops. As a result, it points out the drawback of slow processing. Further, in order to connect a new area to the end of the file, there is a problem that the FAT entries corresponding to the file must be sequentially operated to the end, and a loop having a large number of times must be processed.

その課題を解決するため、空き領域もファイルと同様に、チェーン構造により記述、管理し、ファイルの末尾となるFATエントリへのポインタを設けて管理することにより、空き領域や個々のファイル領域を表すチェーン構造の切り貼りだけで上記課題を解決するファイル管理方式が開示されている(例えば、特許文献2を参照。)。   In order to solve the problem, the free area is described and managed by a chain structure like a file, and a free entry or individual file area is represented by providing a pointer to the FAT entry at the end of the file. A file management system that solves the above-described problems simply by cutting and pasting a chain structure is disclosed (for example, see Patent Document 2).

特開平4−139543号公報JP-A-4-139543 特開2001−56774号公報JP 2001-56774 A

しかしながら、上記従来例であっても、年々続く記録媒体の大容量化、処理するオーディオビデオ情報のファイルサイズの拡大化に伴い、更なるファイルシステムの高速化が必要とされている。また、FATファイルシステムが、様々な機器で広くサポートされ、リムーバブルメディアにおけるデファクトスタンダードであるが故に、更なる高速化が必要であるという問題が存在しつづける。   However, even in the above-described conventional example, further increase in file system speed is required as the capacity of recording media continues year by year and the file size of audio video information to be processed increases. In addition, since the FAT file system is widely supported by various devices and is a de facto standard for removable media, there still remains a problem that further speeding up is necessary.

本発明は、このような問題を解決するために提案されたものであり、その目的は、十分に高速なCPUを使用できない環境下においても、高速なファイル管理を行うことができ、記録媒体の同じ部分ばかり使用することによる記録媒体の寿命の短縮を回避するとともに、削除したばかりのファイルの復元が容易であるファイル管理装置、及びファイル管理方式を提供することを目的とする。   The present invention has been proposed in order to solve such problems. The object of the present invention is to perform high-speed file management even in an environment where a sufficiently high-speed CPU cannot be used. It is an object of the present invention to provide a file management apparatus and a file management system that avoids shortening the life of a recording medium due to the use of only the same part, and that makes it easy to restore a file that has just been deleted.

この発明は、上述した課題を解決すべくなされたもので、本発明においては、単位領域から構成される記録媒体にファイルのデータを記録、管理するファイル管理方式において、ファイルのデータを記録する夫々の単位領域をリンクさせて管理するデータリンクステップと、夫々のファイルのデータを記録する先頭の単位領域へのポインタを記録するファイル開始記録ステップと、夫々のファイルのデータを記録する最後尾の単位領域へのポインタを記録するファイル終了記録ステップと、記録媒体の記録領域を複数の領域に分割し、その領域毎に未使用の単位領域をリンクさせて管理する未使用領域管理ステップと、前記分割される複数の領域毎に管理された未使用の単位領域の先頭の単位領域へのポインタを記録する未使用領域開始記録ステップと、前記分割される複数の領域毎に管理された未使用の単位領域の最後尾の単位領域へのポインタを記録する未使用領域終了記録ステップとを有することを特徴とするファイル管理方法等を提供する。   The present invention has been made to solve the above-described problems. In the present invention, each file data is recorded in a file management method for recording and managing file data on a recording medium composed of unit areas. A data link step for linking and managing the unit areas, a file start recording step for recording a pointer to the first unit area for recording the data of each file, and a last unit for recording the data of each file A file end recording step for recording a pointer to the area, an unused area management step for dividing the recording area of the recording medium into a plurality of areas, and linking unused unit areas for each area, and the division Unused area start recording that records a pointer to the first unit area of an unused unit area managed for each of a plurality of areas And an unused area end recording step for recording a pointer to the last unit area of the unused unit area managed for each of the plurality of divided areas. I will provide a.

本発明によれば、ファイル管理装置及びファイル管理方法において、記録領域の未使用クラスタをチェーン構造で管理することにより、ファイルの削除処理を高速に行えるようにし、さらに、記録領域を複数の記録領域に分割して、夫々の記録領域に対して、未使用クラスタをチェーン構造で管理することにより、記録領域の分散を防ぎ、ディスク装置等の記録メディアにおいても高速なアクセスを可能にしたファイル管理装置、及びファイル管理方式を提供することが可能となる。   According to the present invention, in the file management apparatus and the file management method, it is possible to perform a file deletion process at a high speed by managing unused clusters in the recording area with a chain structure, and further, the recording area is divided into a plurality of recording areas. Management of unused clusters in a chain structure for each recording area, thereby preventing the recording area from being dispersed and enabling high-speed access to recording media such as disk devices It is possible to provide a file management method.

また、夫々の領域において、削除したファイルに使用されていたクラスタを、未使用クラスタのチェーン構造の最後尾に結合させ、使用するときはチェーン構造の先頭から使用することにより、さらに、夫々の記録領域において、使用回数の少ない記録領域にデータを記録することにより、記録媒体の同じ部分ばかり使用することによる記録媒体の寿命の短縮を回避するとともに、削除したばかりのファイルの復元が容易であるファイル管理装置、及びファイル管理方式を提供することが可能となる。   Also, in each area, the cluster used for the deleted file is joined to the end of the chain structure of the unused cluster, and when used, it is used from the beginning of the chain structure. By recording data in a recording area that is used less frequently in the area, it is possible to avoid shortening the life of the recording medium by using only the same part of the recording medium and to easily restore the file that has just been deleted A management device and a file management method can be provided.

以下、図面を参照しながら、本発明の実施形態を説明する。
図1に、本発明の実施形態に係るファイル管理装置である情報処理装置のシステム全体の構成を示す。
同図において、CPU101は、ファイル管理装置100全体の制御を行う。メインメモリ105には、CPU101により実行されるプログラム等がロードされる。グラフィックコントローラ107は、ディスプレイ108の表示を制御する。
Hereinafter, embodiments of the present invention will be described with reference to the drawings.
FIG. 1 shows the overall system configuration of an information processing apparatus that is a file management apparatus according to an embodiment of the present invention.
In the figure, a CPU 101 controls the entire file management apparatus 100. The main memory 105 is loaded with a program executed by the CPU 101. The graphic controller 107 controls display on the display 108.

ノースブリッジ103は、CPUローカルバス102、メモリバス104、AGP(Accelerated Graphics Port)バス106、PCI(Peripheral Component Interconnect)バス109を接続するためのブリッジである。サウスブリッジ110は、ATA(AT Attachment)バス111、113、PCIバス119、LPC(Low Pin Count)バス115を接続するブリッジである。   The north bridge 103 is a bridge for connecting a CPU local bus 102, a memory bus 104, an AGP (Accelerated Graphics Port) bus 106, and a PCI (Peripheral Component Interconnect) bus 109. The south bridge 110 is a bridge that connects ATA (AT Attachment) buses 111 and 113, a PCI bus 119, and an LPC (Low Pin Count) bus 115.

ディスク装置112は、CPU101により実行される各種のプログラム(オペレーティングシステム、デバイスドライバ、アプリケーションプログラム等)や、各種の管理情報を記録する。ディスク装置114に記録されたプログラムは必要に応じてメインメモリ105にロードされる。またディスク装置114には、各種データやコンテンツが記録される。   The disk device 112 records various programs (operating system, device driver, application program, etc.) executed by the CPU 101 and various management information. The program recorded on the disk device 114 is loaded into the main memory 105 as necessary. Various data and contents are recorded on the disk device 114.

キーボードコントローラ116は、キーボード117によるキー入力操作を制御する。BIOS−ROM118は、イニシャルプログラムローダ(Initial Program Loader)を記録する。   The keyboard controller 116 controls a key input operation using the keyboard 117. The BIOS-ROM 118 records an initial program loader (Initial Program Loader).

PCIバス119には、NIC(Network Interface Card)120が接続されている。NIC120は記録装置100をネットワーク(例えばLAN)に接続する。   A NIC (Network Interface Card) 120 is connected to the PCI bus 119. The NIC 120 connects the recording apparatus 100 to a network (for example, a LAN).

次に、ディスク装置114に適用されるFAT型ファイルファイルシステムについて、図2及至図11を参照して説明する。
図2は、FAT201の構造を示す一例である。FAT201は、FATヘッダ202と、各クラスタに夫々対応する複数のFATエントリ204から構成される。
Next, a FAT file file system applied to the disk device 114 will be described with reference to FIGS.
FIG. 2 is an example showing the structure of the FAT 201. The FAT 201 includes a FAT header 202 and a plurality of FAT entries 204 corresponding to the respective clusters.

FATヘッダ202には、記録領域を複数に分割(本実施系ではN分割)して管理する際の、記録領域管理テーブル203が含まれる。記録領域管理テーブル203には、記録領域毎に、未使用クラスタ開始ポインタ205、未使用クラスタ終了ポインタ206、クラスタアクセス回数207、記録領域開始ポインタ208、記録領域終了ポインタ209、及び使用クラスタ数210が含まれる。   The FAT header 202 includes a recording area management table 203 when managing the recording area by dividing it into a plurality of parts (N divisions in this embodiment). The recording area management table 203 includes an unused cluster start pointer 205, an unused cluster end pointer 206, a cluster access count 207, a recording area start pointer 208, a recording area end pointer 209, and a used cluster number 210 for each recording area. included.

記録領域開始ポインタ208と記録領域終了ポインタ209によって、分割された記録領域のうち、どのクラスタ領域が管理されているかが示されている。例えば図2の例では、FAT番号2からFAT番号Mの記録領域をNヶに分割し、分割された第1の記録領域の記録領域開始ポインタ208を2、記録領域終了ポインタをM/Nとしている。即ち、FAT番号2のクラスタからFAT番号M/Nのクラスタまでを第1の記録領域としている。同様に、分割された第2の記録領域の記録領域開始ポインタ208をM/N+1、記録領域終了ポインタを2×M/Nとしている。即ち、FAT番号M/N+1のクラスタからFAT番号2×M/Nのクラスタまでを第2の記録領域としている。なお、本実施形態においては、自然数Mは、自然数Nの整数倍としている。   The recording area start pointer 208 and the recording area end pointer 209 indicate which cluster area is managed among the divided recording areas. For example, in the example of FIG. 2, the recording area of FAT number 2 to FAT number M is divided into N, the recording area start pointer 208 of the divided first recording area is 2, and the recording area end pointer is M / N. Yes. That is, the first recording area is from the cluster of FAT number 2 to the cluster of FAT number M / N. Similarly, the recording area start pointer 208 of the divided second recording area is M / N + 1, and the recording area end pointer is 2 × M / N. That is, the second recording area is from the cluster of FAT number M / N + 1 to the cluster of FAT number 2 × M / N. In the present embodiment, the natural number M is an integer multiple of the natural number N.

未使用クラスタ開始ポインタ205には、その分割された記録領域のうち、データが記録されていない一連の未使用クラスタの先頭クラスタを示すFAT番号が記録される。未使用クラスタが存在しない場合、未使用クラスタ開始ポインタ205には、0xFFFFFFFFが記録される。同様に、未使用クラスタ終了ポインタ206には、その分割された記録領域のうち、データが記録されていない一連の未使用クラスタの最終クラスタを示すFAT番号が記録される。未使用クラスタが存在しない場合、未使用クラスタ終了ポインタ206にも、0xFFFFFFFFが記録される。   In the unused cluster start pointer 205, a FAT number indicating the first cluster of a series of unused clusters in which no data is recorded in the divided recording area is recorded. When there is no unused cluster, 0xFFFFFFFF is recorded in the unused cluster start pointer 205. Similarly, in the unused cluster end pointer 206, a FAT number indicating the last cluster of a series of unused clusters in which no data is recorded in the divided recording area is recorded. If there is no unused cluster, 0xFFFFFFFF is also recorded in the unused cluster end pointer 206.

図2の例では、分割された第1の記録領域の、未使用クラスタ開始ポインタ205を6、未使用クラスタ終了ポインタ206をM/Nとしている。即ち、FAT番号6のクラスタを一連の未使用クラスタの先頭とし、FAT番号M/Nのクラスタを一連の未使用クラスタの最後尾としている。同様に、分割された第2の記録領域の、未使用クラスタ開始ポインタ205をM/N+4、未使用クラスタ終了ポインタ206を2×M/Nとしている。即ち、FAT番号M/N+4のクラスタを一連の未使用クラスタの先頭とし、FAT番号2×M/Nのクラスタを一連の未使用クラスタの最後尾としている。   In the example of FIG. 2, the unused cluster start pointer 205 and the unused cluster end pointer 206 of the divided first recording area are M / N. That is, the cluster of FAT number 6 is the head of a series of unused clusters, and the cluster of FAT number M / N is the last of a series of unused clusters. Similarly, in the divided second recording area, the unused cluster start pointer 205 is M / N + 4, and the unused cluster end pointer 206 is 2 × M / N. That is, the cluster having the FAT number M / N + 4 is set as the head of the series of unused clusters, and the cluster having the FAT number 2 × M / N is set as the tail end of the series of unused clusters.

クラスタアクセス回数207は、その分割された記録領域へのアクセスをクラスタ単位でカウントするカウンタである。図2の例では、分割された第1の記録領域へのクラスタアクセス回数207を200としている。即ち、既に200回のアクセスがあったことを示している。同様に、分割された第2の記録領域へのクラスタアクセス回数207を4000としている。即ち、既に4000回のアクセスがあったことを示している。   The cluster access count 207 is a counter that counts accesses to the divided recording areas in units of clusters. In the example of FIG. 2, the number of cluster accesses 207 to the divided first recording area is 200. That is, it has already been accessed 200 times. Similarly, the number of cluster accesses 207 to the divided second recording area is set to 4000. That is, it has already been accessed 4000 times.

また使用クラスタ数210は、その分割された記録領域のうち、現在使用されているクラスタ数を記録する。図2の例では、分割された第1の記録領域の使用クラスタ数210を4としている。即ち、現在使用されているクラスタは4つであることを示している。同様に、分割された第2の記録領域の使用クラスタ数210を3としている。即ち、現在使用されているクラスタは3つであることを示している。   The number of used clusters 210 records the number of clusters currently used in the divided recording area. In the example of FIG. 2, the number of used clusters 210 of the divided first recording area is four. That is, there are four clusters currently used. Similarly, the number of used clusters 210 of the divided second recording area is set to 3. That is, there are three clusters currently used.

FATエントリ204には、対応するクラスタに付与されているクラスタ番号と同一のFAT番号が付与されている。例えば、クラスタ番号2に対応するFATエントリ204には、FAT番号2が付与される。FATポインタには、クラスタの後方に連結される、クラスタに付与されているFAT番号が記録される。後方にクラスタが存在しない場合、即ち、対応するクラスタがファイルの末尾である場合、FATポインタには、0xFFFFFFFFが記録される。   The FAT entry 204 is assigned the same FAT number as the cluster number assigned to the corresponding cluster. For example, FAT number 2 is assigned to the FAT entry 204 corresponding to cluster number 2. In the FAT pointer, a FAT number assigned to the cluster, which is connected to the rear of the cluster, is recorded. When there is no cluster behind, that is, when the corresponding cluster is the end of the file, 0xFFFFFFFF is recorded in the FAT pointer.

例えば、ディスク装置114に1つのファイルだけが、FAT番号2、3、4、5が付与されている4つのクラスタに記録されている場合、図2に示すようにFAT番号2のFATポインタには、後方に連結されるクラスタに付与されているFAT番号3(0x00000003)が記録される。FAT番号3のFATポインタには、後方に連結されるクラスタに付与されているFAT番号4(0x00000004)が記録される。FAT番号4のFATポインタにも同様に記録がされている。FAT番号5のFATポインタには、後方に連結されるクラスタが存在しないことを示す0xFFFFFFFFが記録される。   For example, when only one file is recorded on the disk device 114 in four clusters assigned with FAT numbers 2, 3, 4, and 5, as shown in FIG. , FAT number 3 (0x00000003) assigned to the cluster connected backward is recorded. In the FAT pointer of FAT number 3, FAT number 4 (0x00000004) assigned to the cluster connected backward is recorded. The same is recorded in the FAT pointer of FAT number 4. In the FAT pointer of FAT number 5, 0xFFFFFFFF indicating that there is no cluster connected backward is recorded.

図3は、FAT番号2、3、4、5が付与されている4つのクラスタに1つのファイルが記録されている様子を示している。ファイルの先頭のクラスタ(図3の例では、FAT番号2のクラスタ)には、ファイルのサイズに関する情報を記録するサイズ記録領域301が設けられる。ファイルのデータは、2番目のクラスタ(図3の例ではFAT番号3のクラスタ)以降に記録される。なお、サイズ記録領域301をディレクトリエントリに設けるようにし、1番目のクラスタからファイルのデータを記録するようにしてもよい。   FIG. 3 shows a state in which one file is recorded in four clusters to which FAT numbers 2, 3, 4, and 5 are assigned. A size recording area 301 for recording information on the size of the file is provided in the first cluster of the file (in the example of FIG. 3, the cluster of FAT number 2). File data is recorded after the second cluster (the cluster of FAT number 3 in the example of FIG. 3). Note that the size recording area 301 may be provided in the directory entry, and the file data may be recorded from the first cluster.

図4は、サイズ記録領域301の構成例を示している。サイズ記録領域301には、最終FAT番号記録領域401、及び占有クラスタ数記録領域402が設けられている。最終FAT番号記録領域401には、ファイルの最後尾のクラスタのFAT番号(図3の例では5)が記録される。占有クラスタ数記録領域402には、ファイルが使用するクラスタ数、即ち、サイズ記録領域301の記録されるクラスタと、データが記録されるクラスタの総和(図3の例では4)が記録される。   FIG. 4 shows a configuration example of the size recording area 301. In the size recording area 301, a final FAT number recording area 401 and an occupied cluster number recording area 402 are provided. In the final FAT number recording area 401, the FAT number (5 in the example of FIG. 3) of the last cluster of the file is recorded. In the occupied cluster number recording area 402, the number of clusters used by the file, that is, the sum of the clusters in which the size recording area 301 is recorded and the clusters in which data is recorded (4 in the example of FIG. 3) is recorded.

次にFATを利用するファイルの作成処理、ファイルの削除処理、未使用クラスタの並び替え処理について、図5及至図11のフローチャートを参照して説明する。
最初に、ファイルの作成処理について、図5及至図8のフローチャートを参照して説明する。
Next, file creation processing, file deletion processing, and unused cluster rearrangement processing using FAT will be described with reference to the flowcharts of FIGS.
First, file creation processing will be described with reference to the flowcharts of FIGS.

ファイル作成時、そのデータの記録される領域が選択される(ステップS501)。即ち、Nヶに分割された記録領域のうち、どの記録領域に記録するのかが選択される。この記録領域選択処理について、図6のフローチャートを参照して説明する。   At the time of creating the file, the area where the data is recorded is selected (step S501). That is, the recording area to be recorded is selected from among the N divided recording areas. This recording area selection process will be described with reference to the flowchart of FIG.

最初に、X、Yを初期化する(ステップS601)。即ち、X、及びYに1を代入する。   First, X and Y are initialized (step S601). That is, 1 is substituted into X and Y.

次に、第Xの記録領域へのアクセス回数がY番目に少ないかどうかチェックする(ステップS602)。即ち、分割された各記録領域の管理テーブル203のクラスタアクセス回数207を夫々比較し、チェックする。最初はX、Yともに1であるため、第1の記録領域へのアクセス回数が1番目に少ないかどうかを、他の記録領域のクラスタアクセス回数207と比較しチェックする。チェックの結果、第Xの記録領域へのアクセス回数がY番目に少なくないと判断される場合、ステップS605へ移行する。また第Xの記録領域へのアクセス回数がY番目に少ないと判断される場合は、ステップS603へ移行する。   Next, it is checked whether the number of accesses to the Xth recording area is the Yth smallest (step S602). That is, the cluster access count 207 in the management table 203 of each divided recording area is compared and checked. Since X and Y are both 1 at first, whether or not the number of accesses to the first recording area is the first is compared with the number of cluster accesses 207 in other recording areas. As a result of the check, if it is determined that the number of accesses to the Xth recording area is not the Yth smallest, the process proceeds to step S605. If it is determined that the number of accesses to the Xth recording area is the Yth smallest, the process proceeds to step S603.

ステップS605では、Xの値を1だけインクリメントし、ステップS602へ移行する。即ち次の記録領域のチェックを行う。従って、ステップS602、ステップS605をループすることにより、アクセス回数のY番目に少ない記録領域を求める。   In step S605, the value of X is incremented by 1, and the process proceeds to step S602. That is, the next recording area is checked. Accordingly, the recording area with the Yth smallest number of accesses is obtained by looping through steps S602 and S605.

ステップS603では、第Xの記録領域に十分な未使用記録領域があるかどうかチェックする。通常はクラスタが1つ未使用であれば、十分な未使用記録領域があると判断されるが、分割された記録領域において、同一の記録領域から複数の領域を確保して記録したい場合、そのクラスタ数の未使用記録領域があるかどうかチェックする。未使用記録領域の有無に関しては、記録領域終了ポインタ209と記録領域開始ポインタ208の差分がその記録領域に含まれるクラスタ数となるから、そのクラスタ数から使用クラスタ数210を引いたクラスタ数が、未使用クラスタ数として求められる。チェックの結果、第Xの記録領域に十分な未使用記録領域がないと判断される場合、ステップS606へ移行する。また、第Xの記録領域に十分な未使用記録領域があると判断される場合は、ステップS604へ移行する。   In step S603, it is checked whether there is a sufficient unused recording area in the Xth recording area. Normally, if one cluster is unused, it is determined that there is sufficient unused recording area. However, in the divided recording area, if you want to secure and record multiple areas from the same recording area, Check if there are unused recording areas for the number of clusters. Regarding the presence / absence of an unused recording area, the difference between the recording area end pointer 209 and the recording area start pointer 208 is the number of clusters included in the recording area, so the number of clusters obtained by subtracting the number of used clusters 210 from the number of clusters is: Calculated as the number of unused clusters. If it is determined that there is not enough unused recording area in the Xth recording area, the process proceeds to step S606. If it is determined that there is a sufficient unused recording area in the Xth recording area, the process proceeds to step S604.

ステップS606では、Yの値を1だけインクリメントし、Xを初期化、即ち、Xに1を代入し、ステップS607へ移行する。   In step S606, the value of Y is incremented by 1, and X is initialized, that is, 1 is substituted for X, and the process proceeds to step S607.

ステップS607では、Yの値がNより大きいかどうかチェックする。Yの値がNより大きくなければステップS602へ移行し、Yの値がNより大きければステップS608へ移行する。従って、ステップS602、ステップS603、ステップS606、ステップS607をループすることにより、十分な未使用領域がある記録領域を求める。   In step S607, it is checked whether the value of Y is greater than N. If the value of Y is not greater than N, the process proceeds to step S602. If the value of Y is greater than N, the process proceeds to step S608. Therefore, a recording area having a sufficient unused area is obtained by looping step S602, step S603, step S606, and step S607.

ステップS608では、十分な未使用記録領域は存在しないとして、処理を終了し、図5へリターンする。   In step S608, assuming that there is no sufficient unused recording area, the process ends, and the process returns to FIG.

ステップS604では、第Xの記録領域を選択し、処理を終了し、図5へリターンする。即ち、第Xの記録領域へのアクセス回数が少なく、かつ十分な未使用記録領域が確保可能であると判断し、第Xの記録領域を選択し、図5へリターンする。   In step S604, the Xth recording area is selected, the process ends, and the process returns to FIG. That is, it is determined that the number of accesses to the Xth recording area is small and a sufficient unused recording area can be secured, the Xth recording area is selected, and the process returns to FIG.

図5のステップS501の記録領域選択において、十分な未使用記録領域が存在しない場合、処理を終了する。またあるいは、十分な未使用記録領域が確保可能であると判断される場合、選択された第Xの記録領域に対してステップS502以降の処理を行う。   In the recording area selection in step S501 of FIG. 5, if there is not a sufficient unused recording area, the process is terminated. Alternatively, if it is determined that a sufficient unused recording area can be secured, the processing from step S502 is performed on the selected Xth recording area.

ステップS502では、未使用クラスタAの獲得を行う。即ち、ステップS501で選択された記録領域から未使用のクラスタに対応するFAT番号を獲得する。この未使用クラスタA獲得処理について、図7のフローチャートを参照して説明する。   In step S502, an unused cluster A is acquired. That is, the FAT number corresponding to the unused cluster is acquired from the recording area selected in step S501. This unused cluster A acquisition process will be described with reference to the flowchart of FIG.

最初に、選択された記録領域の管理テーブル203の未使用クラスタ開始ポインタ205を読み取り、Kに代入する(ステップS701)。例えば図2の例で、第1の記録領域が選択されたならば、未使用クラスタ開始ポインタ205は6であるので、Kには6が代入される。   First, the unused cluster start pointer 205 in the management table 203 of the selected recording area is read and substituted for K (step S701). For example, in the example of FIG. 2, if the first recording area is selected, the unused cluster start pointer 205 is 6, so 6 is substituted for K.

次に、Kが0xFFFFFFFFであるかどうかチェックする(ステップS702)。即ち、選択された記録領域の管理テーブル203の未使用クラスタ開始ポインタに0xFFFFFFFFが記録されていて、未使用クラスタの存在しない状態かどうかチェックする。Kが0xFFFFFFFFである場合、即ち、選択された記録領域の全てのクラスタが使用されている、あるいは、使用できない場合、未使用クラスタは存在しないとして、ステップS707へ移行する。また、Kが0xFFFFFFFFでない場合、即ち、未使用クラスタがある場合、ステップS703へ移行する。   Next, it is checked whether K is 0xFFFFFFFF (step S702). That is, it is checked whether 0xFFFFFFFF is recorded in the unused cluster start pointer of the management table 203 of the selected recording area and there is no unused cluster. If K is 0xFFFFFFFF, that is, if all the clusters in the selected recording area are used or cannot be used, it is determined that there is no unused cluster and the process proceeds to step S707. If K is not 0xFFFFFFFF, that is, if there is an unused cluster, the process proceeds to step S703.

ステップS707では、未使用クラスタは存在せず、獲得できなかったとして、処理を終了し、図5へリターンする。   In step S707, since there is no unused cluster and it cannot be acquired, the process ends and the process returns to FIG.

ステップS703では、FAT番号KのFATポインタを読み取り、Lに代入する。例えば図2の例で、第1の記録領域が選択されたならば、未使用クラスタ開始ポインタ205は6であるから、FAT番号6のFATポインタ0x00000007を読み取り、7がLに代入される。   In step S703, the FAT pointer of FAT number K is read and substituted for L. For example, in the example of FIG. 2, if the first recording area is selected, the unused cluster start pointer 205 is 6, so the FAT pointer 0x00000007 with FAT number 6 is read and 7 is substituted into L.

次に、選択された記録領域の管理テーブル203の未使用クラスタ開始ポインタ205にLを記録する(ステップS704)。例えば図2の例で、第1の記録領域が選択されたならば、未使用クラスタ開始ポインタ205は6であり、FAT番号6のFATポインタは0x00000007であるから、未使用クラスタ開始ポインタ205には、新たに7が記録される。   Next, L is recorded in the unused cluster start pointer 205 of the management table 203 of the selected recording area (step S704). For example, in the example of FIG. 2, if the first recording area is selected, the unused cluster start pointer 205 is 6, and the FAT pointer of FAT number 6 is 0x00000007. 7 is newly recorded.

次に、選択された記録領域の管理テーブル203の使用クラスタ数210を1だけインクリメントする(ステップS705)。例えば図2の例で、第1の記録領域が選択されたならば、未使用クラスタ数210は、1インクリメントされ、4から5が新たに記録される。   Next, the number of used clusters 210 in the management table 203 for the selected recording area is incremented by 1 (step S705). For example, in the example of FIG. 2, if the first recording area is selected, the number of unused clusters 210 is incremented by 1, and 4 to 5 are newly recorded.

次に、未使用クラスタKを獲得できたとし、FAT番号Kをリターン値とし、処理を終了し、図5へリターンする(ステップS706)。例えば図2の例で、第1の記録領域が選択されたならば、未使用クラスタ開始ポインタ205は6であるから、FAT番号6のクラスタが未使用クラスタとして獲得され、図5へリターンする。   Next, it is assumed that the unused cluster K has been acquired, the FAT number K is set as a return value, the process is terminated, and the process returns to FIG. 5 (step S706). For example, in the example of FIG. 2, if the first recording area is selected, the unused cluster start pointer 205 is 6, so the cluster of FAT number 6 is acquired as an unused cluster, and the process returns to FIG.

図5のステップS502の未使用クラスタA獲得処理において、未使用クラスタが獲得できなかった場合、処理を終了する。またあるいは、未使用クラスタが獲得できた場合、獲得できたクラスタのFAT番号をAに代入する。即ち、図7のKを図5のAに代入し、ステップS503以降の処理を行う。例えば図2の例で、第1の記録領域が選択されたならば、未使用クラスタ開始ポインタ205は6であるから、FAT番号6のクラスタが未使用クラスタとして獲得され、Aには6が代入される。   In the unused cluster A acquisition process in step S502 of FIG. 5, if an unused cluster cannot be acquired, the process ends. Alternatively, if an unused cluster can be acquired, the FAT number of the acquired cluster is substituted into A. That is, K in FIG. 7 is substituted into A in FIG. 5, and the processing after step S503 is performed. For example, in the example of FIG. 2, if the first recording area is selected, the unused cluster start pointer 205 is 6, so that the cluster of FAT number 6 is acquired as an unused cluster, and 6 is substituted for A. Is done.

ステップS503では、作成されるファイルのディレクトリエントリの開始クラスタにAを記録する。即ちファイルの先頭となるクラスタのFAT番号がAである旨を記録する。例えば図2の例で、第1の記録領域が選択されたならば、6がディレクトリエントリの開始クラスタに記録される。   In step S503, A is recorded in the start cluster of the directory entry of the file to be created. That is, the fact that the FAT number of the cluster which is the head of the file is A is recorded. For example, in the example of FIG. 2, if the first recording area is selected, 6 is recorded in the starting cluster of the directory entry.

次に、未使用クラスタBの獲得を行う(ステップS504)。即ち、ステップS501で選択された記録領域から未使用のクラスタに対応するFAT番号を獲得する。この未使用クラスタB獲得処理については、ステップS502同様であるので省略する。未使用クラスタが獲得できなかった場合は、ステップS513へ移行する。またあるいは、未使用クラスタが獲得できた場合、獲得できたクラスタのFAT番号をBに代入する。即ち、図7のKを図5のBに代入し、ステップS505へ移行する。例えば図2の例で、第1の記録領域が選択されたならば、FAT番号7のクラスタが未使用クラスタとして獲得され、Bには7が代入される。   Next, an unused cluster B is acquired (step S504). That is, the FAT number corresponding to the unused cluster is acquired from the recording area selected in step S501. Since this unused cluster B acquisition process is the same as that in step S502, a description thereof will be omitted. If an unused cluster cannot be acquired, the process proceeds to step S513. Alternatively, if an unused cluster can be acquired, the FAT number of the acquired cluster is substituted for B. That is, K in FIG. 7 is substituted into B in FIG. 5, and the process proceeds to step S505. For example, in the example of FIG. 2, if the first recording area is selected, a cluster with FAT number 7 is acquired as an unused cluster, and 7 is substituted for B.

ステップS513では、クラスタAを開放する。即ち、2つ目の未使用クラスタの獲得ができず、ファイル作成に失敗したために、エラー終了処理として、
ステップS502にて既に獲得してある未使用クラスタを開放する。このクラスタA開放処理について、図8のフローチャートを参照して説明する。なお、図8のフローチャートでは、開放処理を行うクラスタはDとしている。即ち図8のフローチャートに処理を移行する際、図5のAを図8のDに代入して処理を行う。例えば図2の例で、第1の記録領域が選択されたならば、獲得されたクラスタAのFAT番号は6であり、仮にステップ504にて未使用クラスタBの獲得ができなかったならば、FAT番号6のクラスタの開放処理を行う。即ち図8においてはクラスタ6の開放処理を行うことになり、Dは6になる。
In step S513, cluster A is released. In other words, because the second unused cluster could not be acquired and the file creation failed,
In step S502, unused clusters that have already been acquired are released. The cluster A release process will be described with reference to the flowchart of FIG. In the flowchart of FIG. 8, the cluster that performs the release process is D. That is, when the processing is shifted to the flowchart of FIG. 8, the processing is performed by substituting A in FIG. For example, in the example of FIG. 2, if the first recording area is selected, the FAT number of the acquired cluster A is 6, and if the unused cluster B cannot be acquired in step 504, The cluster of FAT number 6 is released. In other words, in FIG. 8, the cluster 6 is released, and D becomes 6.

最初に、選択された記録領域の管理テーブル203の未使用クラスタ終了ポインタ206を読み取り、Eに代入する(ステップS801)。例えば図2の例で、第1の記録領域が選択されたならば、未使用クラスタ終了ポインタ206はM/Nであるので、EにはM/Nが代入される。   First, the unused cluster end pointer 206 in the management table 203 of the selected recording area is read and substituted into E (step S801). For example, in the example of FIG. 2, if the first recording area is selected, the unused cluster end pointer 206 is M / N, and therefore M / N is substituted for E.

次に、FAT番号EのFATポインタにDを記録する(ステップS802)。例えば図2の例で、第1の記録領域が選択されたならば、未使用クラスタ終了ポインタ206はM/Nであるので、FAT番号M/NのFATポインタにD、即ち0x00000006が記録される。   Next, D is recorded in the FAT pointer of FAT number E (step S802). For example, in the example of FIG. 2, if the first recording area is selected, the unused cluster end pointer 206 is M / N, so D, that is, 0x00000006 is recorded in the FAT pointer of the FAT number M / N. .

次に、FAT番号DのFATポインタに0xFFFFFFFFを記録する(ステップS803)。例えば図2の例で、第1の記録領域が選択されたならば、Dは6であるから、FAT番号6のFATポインタに0xFFFFFFFFが記録される。   Next, 0xFFFFFFFF is recorded in the FAT pointer of FAT number D (step S803). For example, in the example of FIG. 2, if the first recording area is selected, since D is 6, 0xFFFFFFFF is recorded in the FAT pointer of FAT number 6.

次に、選択された記録領域の管理テーブル203の未使用クラスタ終了ポインタ206にDを記録する(ステップS804)。例えば図2の例で、第1の記録領域が選択されたならば、Dは6であるから、第1の記録領域の管理テーブル203の未使用クラスタ終了ポインタ206に6が記録される。   Next, D is recorded in the unused cluster end pointer 206 of the management table 203 of the selected recording area (step S804). For example, in the example of FIG. 2, if the first recording area is selected, D is 6, so 6 is recorded in the unused cluster end pointer 206 of the management table 203 of the first recording area.

次に、選択された記録領域の管理テーブル203の使用クラスタ数210を1だけデクリメントする(ステップS805)。例えば図2の例で、第1の記録領域が選択されたならば、第1の記録領域の管理テーブル203の使用クラスタ数210は、図5のステップS502の未使用クラスタA獲得処理時、即ち図7のステップS705の使用クラスタ数1インクリメントで、4から5に記録されていたのを、このステップS805で1デクリメントし、5から4へ記録し、図8のクラスタD開放処理を終了し、図5へリターンする。   Next, the number of used clusters 210 in the management table 203 for the selected recording area is decremented by 1 (step S805). For example, in the example of FIG. 2, if the first recording area is selected, the number of used clusters 210 in the management table 203 of the first recording area is equal to the unused cluster A acquisition process in step S502 of FIG. In step S705 in FIG. 7, the number of used clusters is incremented by 1 and recorded from 4 to 5, in this step S805, is decremented by 1 and recorded from 5 to 4, and the cluster D release processing in FIG. Return to FIG.

次にステップS514では、ディレクトリエントリの開始クラスタをクリアし、終了する。即ち、ステップS503にて、作成されるファイルのディレクトリエントリの開始クラスタにAを記録しているのを、クリアし、終了する。なお、ここでファイル作成エラーとして、作成しようとしたファイルのディレクトリエントリ自体をクリアするようにしても良い。   In step S514, the directory entry start cluster is cleared and the process ends. That is, in step S503, the fact that A is recorded in the start cluster of the directory entry of the created file is cleared and the process ends. Here, as the file creation error, the directory entry itself of the file to be created may be cleared.

ステップS505では、Cの初期化、即ち、獲得したクラスタ数をCに代入する。ステップS502とステップS504にて2つのクラスタを獲得しているので、Cには2が代入される。   In step S505, C is initialized, that is, the acquired number of clusters is substituted into C. Since two clusters are acquired in step S502 and step S504, 2 is substituted for C.

次に、FAT番号AのFATポインタにBを記録する(ステップS506)。即ちクラスタAとクラスタBの連結を行う。例えば図2の例で、第1の記録領域が選択されたならば、最初の時点ではAは6であり、Bは7であるから、FAT番号6のFATポインタに0x00000007を記録する。   Next, B is recorded in the FAT pointer of FAT number A (step S506). That is, the cluster A and the cluster B are connected. For example, in the example of FIG. 2, if the first recording area is selected, A is 6 and B is 7 at the first time point, so 0x00000007 is recorded in the FAT pointer of FAT number 6.

次に、FAT番号BのFATポインタに0xFFFFFFFFを記録する(ステップS507)。即ち、FAT番号Bを、新規ファイルの暫定的な最終クラスタとして記録しておく。例えば図2の例で、第1の記録領域が選択されたならば、最初の時点ではBは0x00000007であるから、FAT番号7のFATポインタに0xFFFFFFFFを記録する。   Next, 0xFFFFFFFF is recorded in the FAT pointer of FAT number B (step S507). That is, the FAT number B is recorded as a temporary final cluster of the new file. For example, in the example of FIG. 2, if the first recording area is selected, B is 0x00000007 at the first time point, so 0xFFFFFFFF is recorded in the FAT pointer of FAT number 7.

次に、FAT番号Bのクラスタに新規ファイルのデータを記録し、選択された記録領域の管理テーブル203のクラスタアクセス回数207を1だけインクリメントする(ステップS508)。例えば図2の例で、第1の記録領域が選択されたならば、最初の時点でBは0x00000007であるから、FAT番号7のクラスタの各セクタに新規ファイルのデータが記録され、クラスタアクセス回数207は1インクリメントされ、200から201が新たに記録される。   Next, the data of the new file is recorded in the cluster of FAT number B, and the cluster access count 207 in the management table 203 of the selected recording area is incremented by 1 (step S508). For example, in the example of FIG. 2, if the first recording area is selected, since B is 0x00000007 at the first time, the data of the new file is recorded in each sector of the cluster of FAT number 7, and the number of cluster accesses 207 is incremented by 1, and 200 to 201 are newly recorded.

次に、記録データにまだ記録されていない残りのデータがあるかどうかをチェックする(ステップS509)。即ち、ステップS508にて、記録したファイルのデータに対し、さらに後続するデータがあるかどうかチェックを行う。後続するデータがあるならばステップS510へ移行し、後続するデータが無ければファイル作成の終了として、ステップS515へ移行する。   Next, it is checked whether or not there is remaining data not yet recorded in the recording data (step S509). That is, in step S508, it is checked whether or not there is subsequent data for the recorded file data. If there is subsequent data, the process proceeds to step S510. If there is no subsequent data, the file creation is terminated, and the process proceeds to step S515.

ステップS510では、BをAに代入する。第1の記録領域が選択されたならば、最初の時点でBは0x00000007であるから、Aに7が代入される。   In step S510, B is substituted into A. If the first recording area is selected, since B is 0x00000007 at the first time point, 7 is substituted into A.

次に、未使用クラスタBの獲得を行う(ステップS511)。即ち、ステップS501で選択された記録領域から未使用のクラスタに対応するFAT番号を獲得する。この未使用クラスタB獲得処理については、ステップS502同様であるので省略する。未使用クラスタが獲得できなかった場合は、ステップS515へ移行する。またあるいは、未使用クラスタが獲得できた場合、獲得できたクラスタのFAT番号をBに代入する。即ち、図7のKを図5のBに代入し、ステップS512へ移行する。例えば図2の例で、第1の記録領域が選択されたならば、最初の時点でFAT番号0x00000008のクラスタが未使用クラスタとして獲得され、Bには8が代入される。   Next, an unused cluster B is acquired (step S511). That is, the FAT number corresponding to the unused cluster is acquired from the recording area selected in step S501. Since this unused cluster B acquisition process is the same as that in step S502, a description thereof will be omitted. If an unused cluster cannot be acquired, the process proceeds to step S515. Alternatively, if an unused cluster can be acquired, the FAT number of the acquired cluster is substituted for B. That is, K in FIG. 7 is substituted into B in FIG. 5, and the process proceeds to step S512. For example, in the example of FIG. 2, if the first recording area is selected, a cluster having the FAT number 0x00000008 is acquired as an unused cluster at the first time, and 8 is substituted for B.

ステップS512では、Cを1だけインクリメントし、ステップS506へ移行する。最初の時点では、ステップS505にて、Cには2が代入されているから、2から3が代入される。従って、ステップS506からステップS512のループを、新規ファイルの記録しようとしている残りのデータが存在し、未使用クラスタの獲得ができる間、繰り返し処理される。   In step S512, C is incremented by 1, and the process proceeds to step S506. At the first time point, since 2 is substituted for C in step S505, 2 to 3 are substituted. Accordingly, the loop from step S506 to step S512 is repeatedly performed while the remaining data to be recorded in the new file exists and an unused cluster can be acquired.

ステップS515では、サイズ記録領域301の最終FAT番号記録領域401に、最終FAT番号としてBを記録する。即ち、ファイル作成時に、ファイルの最後のデータを記録したクラスタのFAT番号を最終FAT番号記録領域401に記録する。   In step S515, B is recorded as the final FAT number in the final FAT number recording area 401 of the size recording area 301. That is, when the file is created, the FAT number of the cluster in which the last data of the file is recorded is recorded in the final FAT number recording area 401.

次に、サイズ記録領域301の占有クラスタ数記録領域402に、占有クラスタ数としてCを記録する(ステップS516)。即ち、そのファイルのデータ記録、及びサイズ記録領域に使用したクラスタの総数を占有クラスタ数記録領域402に記録する。   Next, C is recorded as the occupied cluster number in the occupied cluster number recording area 402 of the size recording area 301 (step S516). That is, the total number of clusters used for the data recording and size recording area of the file is recorded in the occupied cluster number recording area 402.

次に、選択された記録領域の管理テーブル203のクラスタアクセス回数207を2だけインクリメントする(ステップS517)。ただし、ステップS515、及びステップS516を同時に処理した場合は、クラスタアクセス回数207は、1だけインクリメントされる。   Next, the cluster access count 207 in the management table 203 for the selected recording area is incremented by 2 (step S517). However, when step S515 and step S516 are processed simultaneously, the cluster access count 207 is incremented by one.

次に、ディレクトリエントリにファイルサイズ等各種データを記録し、終了する(ステップS518)。
以上が、ファイルの作成処理について処理の説明である。
Next, various data such as a file size is recorded in the directory entry, and the process ends (step S518).
The above is the description of the process for the file creation process.

次に、ファイルの削除処理について、図9のフローチャートを参照して説明する。
最初に、削除するファイルのディレクトリエントリの開始クラスタを読み取り、Sに代入する(ステップS901)。例えば図2の例で、FAT番号2、3、4、5のクラスタに記録されているファイルを削除する場合、FAT番号2がディレクトリエントリの開始クラスタに記録されており、Sに2が代入される。
Next, the file deletion process will be described with reference to the flowchart of FIG.
First, the start cluster of the directory entry of the file to be deleted is read and assigned to S (step S901). For example, in the example of FIG. 2, when deleting a file recorded in the clusters of FAT numbers 2, 3, 4, and 5, FAT number 2 is recorded in the starting cluster of the directory entry, and 2 is substituted for S. The

次に、FAT番号Sのクラスタが属する、分割された記録領域の管理テーブル203の未使用クラスタ終了ポインタ206を読み取り、Tに代入する(ステップS902)。例えば図2の例で、FAT番号2、3、4、5のクラスタに記録されているファイルを削除する場合、FAT番号2のクラスタは第1の記録領域に属し、第1の記録領域の管理テーブル203の未使用クラスタ終了ポインタ206はM/Nであるから、TにはM/Nが代入される。   Next, the unused cluster end pointer 206 of the divided recording area management table 203 to which the cluster of the FAT number S belongs is read and substituted into T (step S902). For example, in the example of FIG. 2, when deleting a file recorded in the clusters of FAT numbers 2, 3, 4, and 5, the cluster of FAT number 2 belongs to the first recording area, and management of the first recording area is performed. Since the unused cluster end pointer 206 of the table 203 is M / N, M / N is substituted for T.

次に、FAT番号TのFATポインタにSを記録する(ステップS903)。例えば図2の例で、FAT番号2、3、4、5のクラスタに記録されているファイルを削除する場合、Sに2が代入され、TにM/Nが代入されるから、FAT番号M/NのFATポインタには0x00000002が記録される。   Next, S is recorded in the FAT pointer of FAT number T (step S903). For example, in the example of FIG. 2, when deleting a file recorded in a cluster of FAT numbers 2, 3, 4, and 5, since 2 is substituted for S and M / N is substituted for T, FAT number M 0x00000002 is recorded in the / N FAT pointer.

次に、サイズ記録領域301の最終FAT番号記録領域401に記録されている最終FAT番号を読み取り、Uに代入する(ステップS904)。例えば図2の例で、FAT番号2、3、4、5のクラスタに記録されているファイルを削除する場合、ファイルの最後のデータを記録したクラスタのFAT番号は5であり、最終FAT番号記録領域401に記録されている。従って、Uに5が代入される。   Next, the final FAT number recorded in the final FAT number recording area 401 of the size recording area 301 is read and substituted into U (step S904). For example, in the example of FIG. 2, when deleting a file recorded in the clusters of FAT numbers 2, 3, 4, and 5, the FAT number of the cluster that recorded the last data of the file is 5, and the last FAT number record It is recorded in area 401. Therefore, 5 is assigned to U.

次に、FAT番号Sのクラスタが属する、分割された記録領域の管理テーブル203の未使用クラスタ終了ポインタ206にUを記録する(ステップS905)。例えば図2の例で、FAT番号2、3、4、5のクラスタに記録されているファイルを削除する場合、FAT番号2のクラスタは第1の記録領域に属し、Uに代入されているファイルの最後のデータを記録したクラスタのFAT番号は5であるから、第1の記録領域の管理テーブル203の未使用クラスタ終了ポインタ206に5が記録される。   Next, U is recorded in the unused cluster end pointer 206 of the management table 203 of the divided recording area to which the cluster of the FAT number S belongs (step S905). For example, in the example of FIG. 2, when deleting a file recorded in a cluster with FAT numbers 2, 3, 4, and 5, the cluster with FAT number 2 belongs to the first recording area and is assigned to U. Since the FAT number of the cluster in which the last data is recorded is 5, 5 is recorded in the unused cluster end pointer 206 of the management table 203 of the first recording area.

次に、サイズ記録領域301の占有クラスタ数記録領域402に記録されている占有クラスタ数を読み取り、Tに代入する(ステップS906)。例えば図2の例で、FAT番号2、3、4、5のクラスタに記録されているファイルを削除する場合、ファイルのデータが記録されているクラスタ数は4であり、占有クラスタ数記録領域402に記録されている。従って、Tに4が代入される。   Next, the occupied cluster number recorded in the occupied cluster number recording area 402 of the size recording area 301 is read and substituted into T (step S906). For example, in the example of FIG. 2, when deleting a file recorded in the clusters of FAT numbers 2, 3, 4, and 5, the number of clusters in which file data is recorded is 4, and the occupied cluster number recording area 402 Is recorded. Therefore, 4 is substituted for T.

次に、FAT番号Sのクラスタが属する、分割された記録領域の管理テーブル203の使用クラスタ数210からT減算した値を記録する(ステップS907)。例えば図2の例で、FAT番号2、3、4、5のクラスタに記録されているファイルを削除する場合、FAT番号2のクラスタは第1の記録領域に属し、Tに代入されているファイルのデータが記録されているクラスタ数は4であるから、第1の記録領域の管理テーブル203の使用クラスタ数210に記録されている値、即ち4から4減算され、0が新たに記録される。即ち、第1の記録領域においては、1つのクラスタも使用されていないことを意味する。   Next, a value obtained by subtracting T from the number of used clusters 210 of the divided recording area management table 203 to which the cluster of the FAT number S belongs is recorded (step S907). For example, in the example of FIG. 2, when deleting a file recorded in a cluster with FAT numbers 2, 3, 4, and 5, the cluster with FAT number 2 belongs to the first recording area and is assigned to T. Since the number of clusters in which the data is recorded is 4, the value recorded in the number of used clusters 210 in the management table 203 of the first recording area, that is, 4 is subtracted from 4, and 0 is newly recorded. . That is, it means that no cluster is used in the first recording area.

次に、FAT番号Sのクラスタが属する、分割された記録領域の管理テーブル203のクラスタアクセス回数207を2だけインクリメントする(ステップS908)。ただし、ステップS904、及びステップS906を同時に処理した場合は、クラスタアクセス回数207は、1だけインクリメントされる。   Next, the cluster access count 207 in the management table 203 of the divided recording area to which the cluster of the FAT number S belongs is incremented by 2 (step S908). However, when step S904 and step S906 are processed simultaneously, the cluster access count 207 is incremented by one.

例えば図2の例で、FAT番号2、3、4、5のクラスタに記録されているファイルを削除する場合、FAT番号2のクラスタは第1の記録領域に属するから、第1の記録領域の管理テーブル203のクラスタアクセス回数207がインクリメントされる。   For example, in the example of FIG. 2, when deleting a file recorded in the clusters of FAT numbers 2, 3, 4, and 5, since the cluster of FAT number 2 belongs to the first recording area, The cluster access count 207 in the management table 203 is incremented.

次に、削除されるファイルのディレクトリエントリをクリアし、終了する(ステップS909)。
以上が、ファイルの削除処理について処理の説明である。
Next, the directory entry of the file to be deleted is cleared, and the process ends (step S909).
The above is the description of the process regarding the file deletion process.

次に、未使用クラスタの並び替え処理について、図10、及び図11のフローチャートを参照して説明する。
最初に、Fを初期化する(ステップS1001)。即ち、Fに1を代入する。
Next, the unused cluster rearrangement process will be described with reference to the flowcharts of FIGS. 10 and 11.
First, F is initialized (step S1001). That is, 1 is substituted into F.

次に、Fの値がNより大きいかどうかチェックする(ステップS1002)。Fの値がNより大きくなければステップS1003へ移行し、Fの値がNより大きければ(1)、即ち図11のステップS1101へ移行する。   Next, it is checked whether the value of F is larger than N (step S1002). If the value of F is not greater than N, the process proceeds to step S1003. If the value of F is greater than N (1), the process proceeds to step S1101 in FIG.

ステップS1003では、第Fの記録領域の管理テーブル203の未使用クラスタ開始ポインタ205を読み取り、Gに代入する。例えば図2の例で、Fが1、即ち第1の記録領域関して最初は、管理テーブル203の未使用クラスタ開始ポインタ205は6であり、Gに6が代入される。   In step S1003, the unused cluster start pointer 205 in the management table 203 for the Fth recording area is read and substituted for G. For example, in the example of FIG. 2, F is 1, that is, regarding the first recording area, initially, the unused cluster start pointer 205 of the management table 203 is 6, and 6 is substituted for G.

次に、FAT番号GのFATポインタを読み取り、Hに代入する(ステップS1004)。例えば図2の例で、Fが1、即ち、第1の記録領域関して最初は、管理テーブル203の未使用クラスタ開始ポインタ205は6であり、Gに6が代入されているから、FAT番号6のFATポインタ0x00000007がHに代入される。   Next, the FAT pointer of FAT number G is read and substituted for H (step S1004). For example, in the example of FIG. 2, F is 1, that is, regarding the first recording area, initially, the unused cluster start pointer 205 of the management table 203 is 6, and 6 is assigned to G. 6 FAT pointer 0x00000007 is assigned to H.

次に、FAT番号GのFATポインタに、未使用領域であることを暫定で示す値、0x00000000を記録する(ステップS1005)。例えば図2の例で、Fが1、即ち、第1の記録領域関して最初は、管理テーブル203の未使用クラスタ開始ポインタ205は6であり、Gに6が代入されているから、FAT番号6のFATポインタに、0x00000000が記録される。   Next, a temporary value indicating 0x00000000, which is an unused area, is recorded in the FAT pointer of FAT number G (step S1005). For example, in the example of FIG. 2, F is 1, that is, regarding the first recording area, initially, the unused cluster start pointer 205 of the management table 203 is 6, and 6 is assigned to G. 0x00000000 is recorded in the FAT pointer 6.

次に、ステップS1004で代入されたHの値が、0xFFFFFFFFであるかチェックする(ステップS1006)。Hの値が0xFFFFFFFFであればステップS1008へ移行し、Hの値が0xFFFFFFFFでなければステップS1007へ移行する。即ち、第Fの記録領域の一連の未使用クラスタに関して、全てのFATポインタに0x00000000を記録したかどうかチェックする。   Next, it is checked whether the value of H substituted in step S1004 is 0xFFFFFFFF (step S1006). If the value of H is 0xFFFFFFFF, the process proceeds to step S1008, and if the value of H is not 0xFFFFFFFF, the process proceeds to step S1007. That is, with respect to a series of unused clusters in the Fth recording area, it is checked whether 0x00000000 has been recorded in all FAT pointers.

ステップS1007では、Hの値をGに代入し、ステップS1004へ移行する。例えば図2の例で、Fが1、即ち第1の記録領域関して最初は、管理テーブル203の未使用クラスタ開始ポインタ205は6であり、ステップS1004にて、FAT番号6のFATポインタ0x00000007がHに代入されていたから、7がGに代入される。従って、ステップS1004からステップS1007をループすることにより、第Fの記録領域の一連の未使用クラスタに関して、全てのFATポインタに0x00000000を記録する。   In step S1007, the value of H is substituted for G, and the process proceeds to step S1004. For example, in the example of FIG. 2, F is 1, that is, regarding the first recording area, initially, the unused cluster start pointer 205 of the management table 203 is 6. In step S1004, the FAT pointer 0x00000007 of FAT number 6 is set. Since 7 is assigned to H, 7 is assigned to G. Therefore, by looping from step S1004 to step S1007, 0x00000000 is recorded in all FAT pointers for a series of unused clusters in the Fth recording area.

ステップS1008では、Fの値を1だけインクリメントし、ステップS1002へ移行する。従って、ステップS1002からステップS1008をループすることにより、Nヶに分割された全ての記録領域に関して、一連の未使用クラスタの全てのFATポインタに、未使用である旨を暫定で示す、0x00000000を記録する。   In step S1008, the value of F is incremented by 1, and the process proceeds to step S1002. Therefore, by looping from step S1002 to step S1008, 0x00000000, which temporarily indicates that it is unused, is recorded in all FAT pointers in a series of unused clusters for all the recording areas divided into N. To do.

ステップ1101では、Fを初期化する。即ち、Fに1を代入する。
次に、Fを初期化する(ステップS1001)。即ち、Fに1を代入する。
次に、Fの値がNより大きいかどうかチェックする(ステップS1102)。Fの値がNより大きくなければステップS1103へ移行し、Fの値がNより大きければ全ての未使用クラスタの並び替え処理が終了したと判断し、処理を終える。
In step 1101, F is initialized. That is, 1 is substituted into F.
Next, F is initialized (step S1001). That is, 1 is substituted into F.
Next, it is checked whether the value of F is greater than N (step S1102). If the value of F is not greater than N, the process proceeds to step S1103. If the value of F is greater than N, it is determined that the rearrangement process for all unused clusters has been completed, and the process ends.

ステップS1103では、第Fの記録領域の管理テーブル203の未使用クラスタ開始ポインタ205を読み取り、G、H、及びIに代入する。例えば図2の例で、Fが1、即ち第1の記録領域関して最初は、管理テーブル203の未使用クラスタ開始ポインタ205は6であり、G、H、及びIに6が代入される。   In step S1103, the unused cluster start pointer 205 of the F-th recording area management table 203 is read and substituted for G, H, and I. For example, in the example of FIG. 2, F is 1, that is, for the first recording area, the unused cluster start pointer 205 of the management table 203 is 6 at first, and 6 is substituted for G, H, and I.

次に、Hの値が第Fの記録領域の管理テーブル203の記録領域終了ポインタ209に記録されている値と等しいかどうかチェックする(ステップS1104)。Hの値が第Fの記録領域の管理テーブル203の記録領域終了ポインタに記録されている値と等しければステップS1106へ移行し、等しくなければステップS1105へ移行する。   Next, it is checked whether the value of H is equal to the value recorded in the recording area end pointer 209 of the Fth recording area management table 203 (step S1104). If the value of H is equal to the value recorded in the recording area end pointer of the F-th recording area management table 203, the process proceeds to step S1106, and if not equal, the process proceeds to step S1105.

ステップS1105では、Hの値を1つインクリメントし、ステップS1107へ移行する。即ちFAT番号の1つ大きなFATポインタについて以降の処理を行う。
ステップS1106では、Hの値が第Fの記録領域の管理テーブル203の記録領域開始ポインタ208に記録されている値を読み取り、代入し、ステップS1107へ移行する。即ち、第Fの記録領域の先頭のFAT番号に対するFATポインタについて以降の処理を行う。
In step S1105, the value of H is incremented by 1, and the process proceeds to step S1107. In other words, the subsequent processing is performed for the FAT pointer having one FAT number.
In step S1106, the value recorded in the recording area start pointer 208 of the management table 203 for the Fth recording area is read and substituted, and the process proceeds to step S1107. That is, the subsequent processing is performed on the FAT pointer for the first FAT number in the Fth recording area.

ステップS1107では、Hの値とIの値が等しいかどうかチェックする。即ち、ステップS1103でIにセットされた第Fの記録領域の管理テーブル203の未使用クラスタ開始ポインタ205の値と比較し、第Fの記録領域に関し、一通り処理が終了したかどうかチェックする。Hの値とIの値が等しければステップS1112へ移行し、等しくなければステップS1108へ移行する。   In step S1107, it is checked whether the value of H is equal to the value of I. That is, it is compared with the value of the unused cluster start pointer 205 in the management table 203 of the Fth recording area set to I in step S1103, and it is checked whether the processing has been completed for the Fth recording area. If the value of H is equal to the value of I, the process proceeds to step S1112, and if not equal, the process proceeds to step S1108.

ステップS1108では、FAT番号HのFATポインタを読み取り、Jに代入する。
次に、Jの値が0x00000000であるかどうかチェックする(ステップS1109)。即ち、FAT番号HのFATポインタに、未使用である旨を暫定で示す、0x00000000が記録されているかチェックする。Jの値が0x00000000であればステップS1110へ移行し、0x00000000でなければステップS1104へ移行する。ステップS1107で第Fの記録領域に関し、一通り処理が終了したと判断されるか、未使用である旨を暫定で示されたFAT番号を見つけるまで、ステップS1104からステップS1109をループする。
In step S1108, the FAT pointer with FAT number H is read and substituted for J.
Next, it is checked whether or not the value of J is 0x00000000 (step S1109). That is, it is checked whether 0x00000000 is temporarily recorded in the FAT pointer of FAT number H, indicating that it is unused. If the value of J is 0x00000000, the process proceeds to step S1110, and if it is not 0x00000000, the process proceeds to step S1104. Steps S1104 to S1109 are looped until it is determined in step S1107 that the processing has been completed for the Fth recording area, or until a FAT number tentatively shown to be unused is found.

ステップS1110では、FAT番号GのFATポインタにHを代入する。即ち、FAT番号Gで表される前の未使用クラスタと、FAT番号Hの未使用クラスタの連結を行う。
次に、Hの値をGに代入し、ステップS1104へ移行する(ステップS1111)。従って、ステップS1104からステップS1111をループすることにより、第Fの記録領域に関し、未使用クラスタの並び替えを行う。
In step S1110, H is substituted into the FAT pointer of FAT number G. That is, the unused cluster before the FAT number G and the unused cluster of the FAT number H are connected.
Next, the value of H is substituted into G, and the process proceeds to step S1104 (step S1111). Therefore, by looping from step S1104 to step S1111, the unused clusters are rearranged in the Fth recording area.

ステップS1112では、FAT番号GのFATポインタに0xFFFFFFFFを記録する。即ち、FAT番号Gのクラスタが、一連の未使用クラスタの最後尾クラスタである旨を記録する。   In step S1112, 0xFFFFFFFF is recorded in the FAT pointer of FAT number G. That is, it is recorded that the cluster having the FAT number G is the last cluster in a series of unused clusters.

次に、第Fの記録領域の管理テーブル203の未使用クラスタ終了ポインタ206に、Gを記録する(ステップS1113)。
次に、Fの値を1つインクリメントし、ステップS1102へ移行する(ステップS1114)。即ち、第Fの記録領域に関し、未使用クラスタの並び替え、及び管理テーブル203の修正を終了し、次の記録領域の処理へと進む。ステップS1102からステップS1114の処理を繰り返し行うことにより、全ての記録領域の、未使用クラスタの並び替えを行う。
Next, G is recorded in the unused cluster end pointer 206 of the F-th recording area management table 203 (step S1113).
Next, the value of F is incremented by 1, and the process proceeds to step S1102 (step S1114). That is, regarding the Fth recording area, rearrangement of unused clusters and correction of the management table 203 are terminated, and the process proceeds to the next recording area. By repeating the processing from step S1102 to step S1114, the unused clusters are rearranged in all the recording areas.

以上が、未使用クラスタの並び替え処理について処理の説明である。
なお、未使用クラスタの並び替え処理は、記録領域にフラグメンテーションを解消するためのデフラグ時に行っても良いし、CPU等システムに負荷のかかっていないときに行っても良い。
This completes the description of the processing for rearranging unused clusters.
The unused cluster rearrangement process may be performed at the time of defragmentation for eliminating fragmentation in the recording area, or may be performed when a load is not applied to the system such as the CPU.

また、本実施形態では、その目的の1つである、ハードディスク装置などの記録メディアにおいて、シーク時間の短縮をできるだけ行えるようにするため、1つのファイルが複数の記録領域に跨って記録されない構成をとっているが、複数の記録領域に跨って記録できる構成をとっても良い。   Further, in the present embodiment, in order to reduce seek time as much as possible in a recording medium such as a hard disk device, which is one of the purposes, a configuration in which one file is not recorded across a plurality of recording areas is provided. However, a configuration in which recording can be performed across a plurality of recording areas may be adopted.

その場合、図7にて未使用クラスタがない場合、再度図6に示された記録領域の選択を行うことで実現できる。具体的には、図4に図示したサイズ記録領域301に、他の記録領域に記録する時点で、その記録領域における開始クラスタのFAT番号、他の記録領域への記録終了時点で、その記録領域における終了クラスタのFAT番号、及びその記録領域における占有クラスタを記録し、ファイル削除時は、それらの情報を用いて、その記録領域の管理テーブル203、FATエントリに図9と同様の処理を行うことにより実現できる。また、この場合、図10、及び図11に示された未使用クラスタの並び替え処理に対しては何ら変更の必要がない。   In that case, when there is no unused cluster in FIG. 7, it can be realized by selecting the recording area shown in FIG. 6 again. Specifically, the FAT number of the start cluster in the recording area at the time of recording in the other recording area in the size recording area 301 shown in FIG. 4, the recording area at the end of recording in the other recording area The FAT number of the end cluster and the occupied cluster in the recording area are recorded, and when deleting the file, the same processing as in FIG. 9 is performed on the management table 203 and the FAT entry of the recording area using the information. Can be realized. In this case, there is no need to change the unused cluster rearrangement process shown in FIGS. 10 and 11.

また、本実施形態では、図3に示されるように、ファイルの先頭クラスタにファイルのサイズに関する情報を記録するサイズ記録領域301を設けており、ファイルの実データは2番目以降のクラスタに記録するようにしているが、サイズ記録領域301をディレクトリエントリ、あるいはその他の場所で記録し、先頭クラスタからファイルの実データを記録するようにしても良い。   In the present embodiment, as shown in FIG. 3, a size recording area 301 for recording information on the file size is provided in the first cluster of the file, and the actual data of the file is recorded in the second and subsequent clusters. However, the size recording area 301 may be recorded in a directory entry or other location, and the actual data of the file may be recorded from the top cluster.

また、ファイルの記録に使用されるクラスタ数をサイズ記録領域301の占有クラスタ数記録領域402に記録するよう実施したが、ディレクトリエントリのファイルサイズからクラスタ数を求めるようにしても良い。   Further, although the number of clusters used for file recording is recorded in the occupied cluster number recording area 402 of the size recording area 301, the number of clusters may be obtained from the file size of the directory entry.

また、分割した夫々の記録領域の記録領域開始ポインタ208、及び記録領域終了ポインタ209を記録領域管理テーブル203に有するようにしたが、記録領域全体のクラスタ数を分割の数で割った値を用いて境界を分けるようにしても良い。   Further, the recording area start pointer 208 and the recording area end pointer 209 of each divided recording area are included in the recording area management table 203, but a value obtained by dividing the number of clusters in the entire recording area by the number of divisions is used. The boundaries may be separated.

また、上述した実施形態において図1に示したファイル管理装置100は、図5〜11に示す各処理の機能を実現する為のプログラムをメモリから読み出してCPU101が実行することによりその機能を実現させるものであったが、これに限定さるものではなく、各処理の全部または一部の機能を専用のハードウェアにより実現してもよい。また、上述したメモリは、光磁気ディスク装置、フラッシュメモリ等の不揮発性のメモリや、CD−ROM等の読み出しのみが可能な記録媒体、RAM以外の揮発性のメモリ、あるいはこれらの組合せによるコンピュータ読み取り、書き込み可能な記録媒体より構成されてもよい。   In the above-described embodiment, the file management apparatus 100 shown in FIG. 1 realizes the function by reading out a program for realizing the function of each process shown in FIGS. However, the present invention is not limited to this, and all or part of the functions of each process may be realized by dedicated hardware. The above-mentioned memory is a non-volatile memory such as a magneto-optical disk device or a flash memory, a recording medium such as a CD-ROM that can only be read, a volatile memory other than a RAM, or a computer read by a combination thereof. The recording medium may be a writable recording medium.

また、ファイル管理装置100の図5〜11に示す各処理の機能を実現する為のプログラムをコンピュータ読み取り可能な記録媒体に記録して、この記録媒体に記録されたプログラムをコンピュータシステムに読み込ませ、実行することにより各処理を行っても良い。なお、ここでいう「コンピュータシステム」とは、OSや周辺機器等のハードウェアを含むものとする。具体的には、記録媒体から読み出されたプログラムが、コンピュータに挿入された機能拡張ボードやコンピュータに接続された機能拡張ユニットに備わるメモリに書きこまれた後、そのプログラムの指示に基づき、その機能拡張ボードや機能拡張ユニットに備わるCPUなどが実際の処理の一部または全部を行い、その処理によって前述した実施形態の機能が実現される場合も含む。   Further, a program for realizing the functions of the processes shown in FIGS. 5 to 11 of the file management apparatus 100 is recorded on a computer-readable recording medium, and the program recorded on the recording medium is read into a computer system. Each process may be performed by executing. Here, the “computer system” includes an OS and hardware such as peripheral devices. Specifically, a program read from a recording medium is written into a memory provided in a function expansion board inserted into the computer or a function expansion unit connected to the computer, and then the program is read based on the instructions of the program. It includes the case where the CPU of the function expansion board or function expansion unit performs part or all of the actual processing, and the functions of the above-described embodiments are realized by the processing.

また、「コンピュータ読み取り可能な記録媒体」とは、フレキシブルディスク、光磁気ディスク、ROM、CD−ROM等の可搬媒体、コンピュータシステムに内蔵されるハードディスク等の記憶装置のことをいう。さらに「コンピュータ読み取り可能な記録媒体」とは、インターネット等のネットワークや電話回線等の通信回線を介してプログラムが送信された場合のサーバやクライアントとなるコンピュータシステム内部の揮発メモリ(RAM)のように、一定時間プログラムを保持しているものも含むものとする。   The “computer-readable recording medium” refers to a portable medium such as a flexible disk, a magneto-optical disk, a ROM, and a CD-ROM, and a storage device such as a hard disk built in the computer system. Further, the “computer-readable recording medium” refers to a volatile memory (RAM) in a computer system that becomes a server or a client when a program is transmitted via a network such as the Internet or a communication line such as a telephone line. In addition, those holding a program for a certain period of time are also included.

また、上記プログラムは、このプログラムを記憶装置等に格納したコンピュータシステムから、伝送媒体を介して、あるいは、伝送媒体中の伝送波により他のコンピュータシステムに伝送されてもよい。ここで、プログラムを伝送する「伝送媒体」は、インターネット等のネットワーク(通信網)や電話回線等の通信回線(通信線)のように情報を伝送する機能を有する媒体のことをいう。
また、上記プログラムは、前述した機能の一部を実現する為のものであっても良い。さらに、前述した機能をコンピュータシステムに既に記録されているプログラムとの組合せで実現できるもの、いわゆる差分ファイル(差分プログラム)であっても良い。
The program may be transmitted from a computer system storing the program in a storage device or the like to another computer system via a transmission medium or by a transmission wave in the transmission medium. Here, the “transmission medium” for transmitting the program refers to a medium having a function of transmitting information, such as a network (communication network) such as the Internet or a communication line (communication line) such as a telephone line.
The program may be for realizing a part of the functions described above. Furthermore, what can implement | achieve the function mentioned above in combination with the program already recorded on the computer system, and what is called a difference file (difference program) may be sufficient.

また、上記のプログラムを記録したコンピュータ読み取り可能な記録媒体等のプログラムプロダクトも本発明の実施形態として適用することができる。上記のプログラム、記録媒体、伝送媒体およびプログラムプロダクトは、本発明の範疇に含まれる。
以上、この発明の実施形態について図面を参照して詳述してきたが、具体的な構成はこの実施形態に限られるものではなく、この発明の要旨を逸脱しない範囲の設計等も含まれる。
Further, a program product such as a computer-readable recording medium in which the above program is recorded can also be applied as an embodiment of the present invention. The above program, recording medium, transmission medium, and program product are included in the scope of the present invention.
The embodiment of the present invention has been described in detail with reference to the drawings. However, the specific configuration is not limited to this embodiment, and includes designs and the like that do not depart from the gist of the present invention.

本実施形態に係るファイル管理装置のシステム全体の構成図である。It is a block diagram of the whole system of the file management apparatus which concerns on this embodiment. FAT201の構成を示す一例の図である。3 is a diagram illustrating an example of a configuration of a FAT 201. FIG. ファイル記録の一例を示す図である。It is a figure which shows an example of file recording. サイズ記録領域301の構成を示す図である。3 is a diagram illustrating a configuration of a size recording area 301. FIG. ファイル作成処理を説明するフローチャートである。It is a flowchart explaining a file creation process. 記録領域選択処理を説明するフローチャートである。It is a flowchart explaining a recording area selection process. 未使用クラスタの獲得処理を説明するフローチャートである。It is a flowchart explaining the acquisition process of an unused cluster. クラスタDの開放処理を説明するフローチャートである。10 is a flowchart for explaining a cluster D release process. ファイル削除処理を説明するフローチャートである。It is a flowchart explaining a file deletion process. 未使用クラスタの並び替え処理を説明するフローチャートである。It is a flowchart explaining the rearrangement process of an unused cluster. 未使用クラスタの並び替え処理を説明するフローチャートである。It is a flowchart explaining the rearrangement process of an unused cluster. 従来のFATファイルシステムの構成を示す図である。It is a figure which shows the structure of the conventional FAT file system. 従来のFATエントリの一例を示す図である。It is a figure which shows an example of the conventional FAT entry. ディレクトリエントリのフォーマット図である。It is a format figure of a directory entry.

符号の説明Explanation of symbols

100 ファイル管理装置
101 CPU
102 CPUローカルバス
103 ノースブリッジ
104 メモリバス
105 メインメモリ
106 AGP(Accelerated Graphics Port)バス
107 グラフィックコントローラ
108 ディスプレイ
109、119 PCI(Peripheral Component Interconnect)バス
110 サウスブリッジ
111、113 ATA(AT Attachment)バス
112、114 ディスク装置
115 LPC(Low Pin Count)バス
116 キーボードコントローラ
117 キーボード
118 BIOS−ROM
120 NIC(Network Interface card)
201 FAT(File Allocation Table)エントリ
202 FATヘッダ
203 記録領域管理テーブル
204 FATヘッダ
205 未使用クラスタ開始ポインタ
206 未使用クラスタ終了ポインタ
207 クラスタアクセス回数
208 記録領域開始ポインタ
209 記録領域終了ポインタ
210 使用クラスタ数
301 サイズ記録領域
401 最終FAT番号記録領域
402 占有クラスタ数記録領域
100 File management apparatus 101 CPU
102 CPU local bus 103 North bridge 104 Memory bus 105 Main memory 106 AGP (Accelerated Graphics Port) bus 107 Graphic controller 108 Display 109, 119 PCI (Peripheral Component Interconnect) bus 110 South bridge 111, 113 ATA (AT Attachment) bus 112, 114 Disk device 115 LPC (Low Pin Count) bus 116 Keyboard controller 117 Keyboard 118 BIOS-ROM
120 NIC (Network Interface card)
201 FAT (File Allocation Table) entry 202 FAT header 203 Recording area management table 204 FAT header 205 Unused cluster start pointer 206 Unused cluster end pointer 207 Cluster access count 208 Recording area start pointer 209 Recording area end pointer 210 Number of used clusters 301 Size recording area 401 Final FAT number recording area 402 Occupied cluster number recording area

Claims (12)

単位領域から構成される記録媒体にファイルのデータを記録、管理するファイル管理装置において、
ファイルのデータを記録する夫々の単位領域をリンクさせて管理するデータリンク手段と、
夫々のファイルのデータを記録する先頭の単位領域へのポインタを記録するファイル開始記録手段と、
夫々のファイルのデータを記録する最後尾の単位領域へのポインタを記録するファイル終了記録手段と、
記録媒体の記録領域を複数の領域に分割し、その領域毎に未使用の単位領域をリンクさせて管理する未使用領域管理手段と、
前記分割される複数の領域毎に管理された未使用の単位領域の先頭の単位領域へのポインタを記録する未使用領域開始記録手段と、
前記分割される複数の領域毎に管理された未使用の単位領域の最後尾の単位領域へのポインタを記録する未使用領域終了記録手段と
を有することを特徴とするファイル管理装置。
In a file management apparatus for recording and managing file data on a recording medium composed of unit areas,
A data link means for linking and managing each unit area for recording file data;
File start recording means for recording a pointer to the head unit area for recording data of each file;
File end recording means for recording a pointer to the last unit area for recording data of each file;
An unused area management unit that divides a recording area of a recording medium into a plurality of areas and links and manages unused unit areas for each area;
Unused area start recording means for recording a pointer to the head unit area of the unused unit area managed for each of the plurality of divided areas;
An unused area end recording unit that records a pointer to the last unit area of the unused unit area managed for each of the plurality of divided areas.
ファイルのデータ記録の際の単位領域の獲得を、前記未使用領域開始記録手段に記録される先頭の単位領域より行うことを特徴とする請求項1記載のファイル管理装置。   2. The file management apparatus according to claim 1, wherein acquisition of a unit area at the time of data recording of a file is performed from a head unit area recorded in the unused area start recording means. ファイルの削除を行う際、前記ファイル開始記録手段に記録される単位領域へリンクさせるリンク手段と、
前記ファイル終了記録手段に記録される単位領域を未使用領域終了記録手段に記録する記録手段と
を有することを特徴とする請求項1又は請求項2記載のファイル管理装置。
A link means for linking to a unit area recorded in the file start recording means when deleting a file;
The file management apparatus according to claim 1, further comprising: a recording unit that records the unit area recorded in the file end recording unit in the unused area end recording unit.
前記分割された複数の領域毎にアクセスの回数をカウントするカウント手段と
を有し、前記カウンタ手段の結果アクセス回数の少ない領域からファイル作成の際のデータ記録を行うことを特徴とする請求項1〜3のいずれか1項に記載のファイル管理装置。
2. A count unit that counts the number of accesses for each of the plurality of divided areas, and data recording at the time of file creation is performed from an area with a small number of accesses as a result of the counter unit. The file management apparatus according to any one of to 3.
前記未使用領域管理手段にてリンクされている未使用領域を、近傍の未使用領域にリンクされるように再構築することを特徴とする請求項1〜4のいずれか1項に記載のファイル管理装置。   5. The file according to claim 1, wherein the unused area linked by the unused area management unit is reconstructed so as to be linked to a nearby unused area. Management device. 単位領域から構成される記録媒体にファイルのデータを記録、管理するファイル管理方式において、
ファイルのデータを記録する夫々の単位領域をリンクさせて管理するデータリンクステップと、
夫々のファイルのデータを記録する先頭の単位領域へのポインタを記録するファイル開始記録ステップと、
夫々のファイルのデータを記録する最後尾の単位領域へのポインタを記録するファイル終了記録ステップと、
記録媒体の記録領域を複数の領域に分割し、その領域毎に未使用の単位領域をリンクさせて管理する未使用領域管理ステップと、
前記分割される複数の領域毎に管理された未使用の単位領域の先頭の単位領域へのポインタを記録する未使用領域開始記録ステップと、
前記分割される複数の領域毎に管理された未使用の単位領域の最後尾の単位領域へのポインタを記録する未使用領域終了記録ステップと
を有することを特徴とするファイル管理方法。
In a file management method for recording and managing file data on a recording medium composed of unit areas,
A data link step for linking and managing each unit area for recording file data;
A file start recording step for recording a pointer to a head unit area for recording data of each file;
A file end recording step for recording a pointer to the last unit area for recording data of each file;
An unused area management step of dividing the recording area of the recording medium into a plurality of areas and linking and managing unused unit areas for each area;
An unused area start recording step for recording a pointer to a head unit area of an unused unit area managed for each of the plurality of divided areas;
An unused area end recording step of recording a pointer to the last unit area of the unused unit area managed for each of the plurality of divided areas.
ファイルのデータ記録の際の単位領域の獲得を、前記未使用領域開始記録ステップに記録される先頭の単位領域より行うことを特徴とする請求項6記載のファイル管理方法。   7. The file management method according to claim 6, wherein acquisition of a unit area at the time of file data recording is performed from a head unit area recorded in the unused area start recording step. ファイルの削除を行う際、前記ファイル開始記録ステップに記録される単位領域へリンクさせるリンクステップと、
前記ファイル終了記録ステップに記録される単位領域を未使用領域終了記録ステップに記録する記録ステップと
を有することを特徴とする請求項6又は請求項7記載のファイル管理方法。
A link step for linking to a unit area recorded in the file start recording step when deleting a file;
8. The file management method according to claim 6, further comprising: a recording step of recording the unit area recorded in the file end recording step in an unused area end recording step.
前記分割された複数の領域毎にアクセスの回数をカウントするカウントステップと
を有し、前記カウンタステップの結果アクセス回数の少ない領域からファイル作成の際のデータ記録を行うことを特徴とする請求項6〜8のいずれか1項に記載のファイル管理方法。
A counting step for counting the number of accesses for each of the plurality of divided areas, and data recording at the time of file creation is performed from an area with a small number of accesses as a result of the counter step. The file management method of any one of -8.
前記未使用領域管理ステップにてリンクされている未使用領域を、近傍の未使用領域にリンクされるように再構築することを特徴とする請求項6〜9のいずれか1項に記載のファイル管理方法。   The file according to any one of claims 6 to 9, wherein the unused area linked in the unused area management step is reconstructed so as to be linked to a nearby unused area. Management method. 請求項6記載の方法の各ステップをコンピュータに実行させるためのプログラムを記録したコンピュータ読取可能な記録媒体。   A computer-readable recording medium on which a program for causing a computer to execute each step of the method according to claim 6 is recorded. 請求項6記載の方法の各ステップをコンピュータに実行させるためのプログラム。   The program for making a computer perform each step of the method of Claim 6.
JP2004288306A 2004-09-30 2004-09-30 File management device, file management method, recording medium, and program Pending JP2006106810A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2004288306A JP2006106810A (en) 2004-09-30 2004-09-30 File management device, file management method, recording medium, and program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2004288306A JP2006106810A (en) 2004-09-30 2004-09-30 File management device, file management method, recording medium, and program

Publications (1)

Publication Number Publication Date
JP2006106810A true JP2006106810A (en) 2006-04-20

Family

ID=36376522

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2004288306A Pending JP2006106810A (en) 2004-09-30 2004-09-30 File management device, file management method, recording medium, and program

Country Status (1)

Country Link
JP (1) JP2006106810A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2013033338A (en) * 2011-08-01 2013-02-14 Toshiba Corp Memory system
US10789228B2 (en) 2017-11-21 2020-09-29 Fujitsu Limited Data presence/absence determination apparatus and computer-readable storage medium storing program for determination of data presence/absence

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2013033338A (en) * 2011-08-01 2013-02-14 Toshiba Corp Memory system
US10789228B2 (en) 2017-11-21 2020-09-29 Fujitsu Limited Data presence/absence determination apparatus and computer-readable storage medium storing program for determination of data presence/absence

Similar Documents

Publication Publication Date Title
JP4537083B2 (en) Data processing apparatus and control method thereof
JP4691209B2 (en) Access device, information recording device, information recording system, file management method, and program
US20030065866A1 (en) Memory controller for memory card manages file allocation table
JP6920448B2 (en) Flash memory file system and its data management method
JP5481493B2 (en) ACCESS DEVICE, INFORMATION RECORDING DEVICE, CONTROLLER, REAL TIME INFORMATION RECORDING SYSTEM, ACCESS METHOD, AND PROGRAM
EP1805589A2 (en) Tape emulating disk based storage and method with automatically resized emulated tape capacity
KR100703807B1 (en) Method and apparatus for managing block by update type of data in block type memory
JP6391061B2 (en) How to write a file on tape
CN107391669A (en) A kind of multi version file management method and device based on file system
JP5362594B2 (en) Access device and remaining capacity calculation method
CN108763531A (en) A kind of MDVR document storage systems and its operation method
CN105302488B (en) The method for writing data and system of a kind of storage system
JP2015215788A (en) Efficient use of meta information accompanying file writing to media
KR20060120674A (en) Information recording medium data processing apparatus and data recording method
JP5394394B2 (en) File management / editing method and apparatus in file system
JP2006106810A (en) File management device, file management method, recording medium, and program
JP2008269520A (en) Recorder and recording method
TWI470454B (en) File format transforming method
US20190354306A1 (en) Available-space management method for nonvolatile memory, access device which stores data to information storage device with nonvolatile memory, information storage device, and information storage system
US20170115926A1 (en) Information processing device, information processing method and program
CN113360095A (en) Hard disk data management method, device, equipment and medium
JP2009205591A (en) Access module, information recording module, and information recording system
JP2006133923A (en) Data recording/reproducing device, recording/reproducing method, program and data recording medium
US8775383B2 (en) File editing apparatus and file editing method
JP2006146466A (en) Recording medium and method for managing file system