JP2003263351A - Increase suppressing method of file name retrieval time and computer system - Google Patents

Increase suppressing method of file name retrieval time and computer system

Info

Publication number
JP2003263351A
JP2003263351A JP2002066362A JP2002066362A JP2003263351A JP 2003263351 A JP2003263351 A JP 2003263351A JP 2002066362 A JP2002066362 A JP 2002066362A JP 2002066362 A JP2002066362 A JP 2002066362A JP 2003263351 A JP2003263351 A JP 2003263351A
Authority
JP
Japan
Prior art keywords
file
directory
created
unique number
entries
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
JP2002066362A
Other languages
Japanese (ja)
Inventor
Takashi Imai
敬 今井
Kenzo Moriyama
建三 森山
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.)
Hitachi Software Engineering Co Ltd
Hitachi Ltd
Original Assignee
Hitachi Software Engineering Co Ltd
Hitachi Ltd
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 Hitachi Software Engineering Co Ltd, Hitachi Ltd filed Critical Hitachi Software Engineering Co Ltd
Priority to JP2002066362A priority Critical patent/JP2003263351A/en
Publication of JP2003263351A publication Critical patent/JP2003263351A/en
Pending legal-status Critical Current

Links

Abstract

<P>PROBLEM TO BE SOLVED: To suppress increase of a processing time for file open, file creation or the like caused by increase of the number of files. <P>SOLUTION: When the number of files on a directory (hereafter referred to as DIR) is small, a file is created directly on the DIR. When creating a file with files over the number of n, subdirectories (hereafter referred to as SDIR) to the number of m having respectively a number as the name of the SDIR are created on the DIR, and file characteristic numbers created sequentially with file names are allocated to the files, and an SDIR wherein the numerical value of a part of the file characteristic number agrees with the numerical value of a part of the number of the SDIR name is selected from the SDIR's to the number of m, and the file is created on the selected SDIR. When the number of files on the SDIR exceeds n again, SDIR's to the number of m are created on the SDIR, and the files are allocated to the SDIR's according to the file characteristic numbers, to thereby prevent the number of files on one DIR and one SDIR from exceeding n. <P>COPYRIGHT: (C)2003,JPO

Description

【発明の詳細な説明】Detailed Description of the Invention

【0001】[0001]

【発明の属する技術分野】本発明は、階層構造のファイ
ルシステムを持つ計算機システムにおいて、同一ディレ
クトリ上にファイルが集中することによる性能低下を抑
止するための方法に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a method for suppressing performance degradation due to file concentration in the same directory in a computer system having a hierarchical file system.

【0002】[0002]

【従来の技術】UNIX(登録商標)で一般的に使用され
るUNIX(登録商標)ファイルシステムは、ディレクト
リと呼ぶ複数のファイルをグループ化したものを階層構
造によって管理している。階層構造をしていることによ
り、ファイルが適当に分散され、1ディレクトリ上のフ
ァイル数は多くならなくて済むようになっている。各々
のディレクトリには、図7に示すように、ファイル毎
に、ファイル名の長さ700、ファイル名701、iノ
ード番号と呼ばれるファイル固有番号702のエントリ
情報が存在する。一つのディレクトリ上のファイル数が
多くなれば、このエントリ情報が多くなり、ファイルに
アクセスするオペレーティングシステムの処理の中で、
ファイル名からファイル固有番号を求める検索処理に時
間がかかるようになる。ファイルに対してアクセスする
場合、オペレーティングシステム内部では、ファイル名
ではなく、ファイル固有番号を使用している。このファ
イル固有番号を求めるファイル名検索処理は、図8に示
すように、まず、ファイル検索するディレクトリのファ
イルエントリを順番に調べていき(ステップ800)、
検索するファイル名と一致すれば(ステップ801)、
そのエントリ内にあるファイル固有番号を得て終了する
(ステップ802)。ファイル名が一致しない場合(ス
テップ801)、次のエントリが無ければ(ステップ8
03)エラー終了し、あれば次のエントリに処理を移し
(ステップ804)、ファイル名が見つかるまでこれを
繰り返す。この方法では、ディレクトリ上のファイル数
をaとし、1エントリ調べるのに要する時間をtとする
と、ファイル名検索にかかる時間は、平均a*t/2( * は
乗算を意味する)となり、ファイル数aが大きくなればな
るほどそのファイル数に比例して処理時間がかかる。
2. Description of the Related Art A UNIX (registered trademark) file system generally used in UNIX (registered trademark) manages a group of a plurality of files called a directory by a hierarchical structure. Due to the hierarchical structure, the files are appropriately distributed, and the number of files in one directory does not have to increase. As shown in FIG. 7, each directory has entry information of a file name length 700, a file name 701, and a file unique number 702 called an inode number for each file. If the number of files in one directory is large, this entry information will be large, and in the process of the operating system that accesses the file,
The search process for obtaining the file unique number from the file name takes time. When accessing a file, the operating system uses the file unique number instead of the file name. As shown in FIG. 8, in the file name search process for obtaining the file unique number, first, the file entries of the directory for file search are sequentially checked (step 800),
If it matches the file name to be searched (step 801),
The file unique number in the entry is obtained and the process ends (step 802). If the file names do not match (step 801), if there is no next entry (step 8)
03) If the processing ends in error, if there is any, the processing is moved to the next entry (step 804) and this is repeated until the file name is found. In this method, if the number of files in the directory is a and the time required to check one entry is t, the time required to search the file name is a * t / 2 (* means multiplication) on average, and The larger the number a, the longer the processing time in proportion to the number of files.

【0003】[0003]

【発明が解決しようとする課題】上記従来のファイルシ
ステムでは、ディレクトリ上のファイル数が増えれば増
えるほど、ファイルのオープンや作成に伴うファイル名
からファイル固有番号を求める処理、すなわちファイル
名検索が遅くなる。このファイル名検索にかかる時間は
一般的に単一ディレクトリ上にあるファイル数に比例し
て大きくなる。本発明の目的は、このファイル数増大に
よるファイルオープン、ファイル作成などの処理時間の
増加を抑止することにある。また、本発明の他の目的
は、オペレーティングシステム内部の処理方法の変更に
あり、既存のファイルシステムの基本構造を変えること
なく、性能改善を行うことにある。さらに、本発明の他
の目的は、オペレーティングシステムを使用するユーザ
がこの内部処理の変更を意識することなく、性能改善の
効果を得られるようにすることにある。
In the above conventional file system, the more the number of files on the directory increases, the slower the process for obtaining the file unique number from the file name associated with the opening and creation of the file, that is, the file name search. Become. The time required for this file name search generally increases in proportion to the number of files in a single directory. An object of the present invention is to prevent an increase in processing time such as file opening and file creation due to the increase in the number of files. Another object of the present invention is to change the processing method inside the operating system, and to improve the performance without changing the basic structure of the existing file system. Further, another object of the present invention is to allow a user who uses an operating system to obtain the effect of performance improvement without being aware of the change of the internal processing.

【0004】[0004]

【課題を解決するための手段】上記目的を達成するた
め、本発明は、プロセッサ装置と、データ入出力の対象
となる階層構造を持つファイルシステムが存在する外部
記憶装置を有する計算機システムにおけるファイル名検
索時間の増大抑止方法であり、ファイルを前記ファイル
システム内のディレクトリ上に保存する際に、該ファイ
ルのファイル名に連動したファイル固有番号を作成し、
作成したファイル固有番号を該ファイルに割り当て、前
記ディレクトリにおけるファイルエントリの数が予め定
めた値に達していないときは、該ファイルを該ディレク
トリ上に保存し、前記ディレクトリにおけるファイルエ
ントリの数が予め定めた値に達しているときは、予め定
めた数のサブディレクトリを該ディレクトリ上に作成
し、該ファイルをファイル固有番号の少なくとも一部と
一致する番号を有する前記サブディレクトリに保存し、
前記ディレクトリにおけるファイルエントリの数が予め
定めた値を超えているときは、該ファイルをファイル固
有番号の少なくとも一部と一致する番号を有する既に作
成されているサブディレクトリに保存する。
In order to achieve the above object, the present invention provides a file name in a computer system having a processor device and an external storage device in which a file system having a hierarchical structure as a target of data input / output exists. This is a method of suppressing increase in search time, and when a file is stored in a directory in the file system, a file unique number linked to the file name of the file is created,
The created file unique number is assigned to the file, and when the number of file entries in the directory does not reach a predetermined value, the file is saved in the directory and the number of file entries in the directory is predetermined. A predetermined number of subdirectories are created on the directory and the file is stored in the subdirectory having a number that matches at least a part of the file unique number,
When the number of file entries in the directory exceeds a predetermined value, the file is saved in an already created subdirectory having a number matching at least a part of the file unique number.

【0005】[0005]

【発明の実施の形態】以下、本発明を実施する場合の一
形態を図面を参照して具体的に説明する。図2は本発明
の一実施例のシステム構成を示す図である。図2におい
て、1は計算機システムであり、中央処理演算装置2、
主記憶装置3、外部記憶装置6で構成されている。主記
憶装置3には、ユーザプログラム4、オペレーティング
システム5が格納されている。外部記憶装置6には、フ
ァイルシステム7が構成されており、ファイル8などが
置かれている。ユーザプログラム4からファイル作成の
要求を受けると、オペレーティングシステム5は、ファ
イルシステム7にファイルを作成する。
BEST MODE FOR CARRYING OUT THE INVENTION An embodiment for carrying out the present invention will be specifically described below with reference to the drawings. FIG. 2 is a diagram showing the system configuration of an embodiment of the present invention. In FIG. 2, reference numeral 1 is a computer system, which is a central processing unit 2,
It is composed of a main storage device 3 and an external storage device 6. A user program 4 and an operating system 5 are stored in the main storage device 3. A file system 7 is configured in the external storage device 6, and files 8 and the like are placed therein. Upon receiving a file creation request from the user program 4, the operating system 5 creates a file in the file system 7.

【0006】図1は、ディレクトリとファイルの配置例
を示したものである。ファイルAは階層構造をしたファ
イルシステムに存在し、絶対パス名では、「/usr/local
/fileA」と表される。「/usr/local」のディレクトリ
は、内部的に多段階のサブディレクトリを作成してい
て、そのサブディレクトリ上にもファイルが作成されて
いる。すなわち、内部的に一つのディレクトリ上にファ
イルが多数集まらないように、サブディレクトリに分け
て分散配置している。ただし、ユーザからファイルの見
え方は、あくまで「/usr/local/fileA」であり、サブデ
ィレクトリは見えない。
FIG. 1 shows an arrangement example of directories and files. File A exists in a file system with a hierarchical structure, and the absolute path name is "/ usr / local
/ fileA ”. The "/ usr / local" directory internally creates a multi-stage subdirectory, and files are also created in that subdirectory. That is, the files are distributed and arranged in subdirectories so that a large number of files are not collected in one directory internally. However, the user can see the file as "/ usr / local / fileA", and the subdirectory cannot be seen.

【0007】図3に、サブディレクトリ化されたディレ
クトリの内部構造を示す。ファイル数が少ない時には、
「AAA」ファイルや「BBB」ファイルのように、従
来技術と同様にディレクトリのファイルエントリ上に直
接ファイルが置かれる。ファイル数が増え、n個(例え
ば、100個とか1000個)のエントリを超えると、
(1次の)m個のサブディレクトリ、図3の場合「.$00
0」〜「.$099」までの100個、を作成し、そのサブデ
ィレクトリ上にファイルが置かれるようになる。さらに
その各々のサブディレクトリ上のファイル数がn個を超
えた場合には、同様に(2次の)m個のサブディレクト
リ、図3の場合「.$000」〜「.$099」の100個、が存
在するというように、これが繰り返された構造をしてい
る。これらのサブディレクトリ上に分散してファイルが
置かれることにより、1つのディレクトリ上にファイル
が多数集中することを防いでいる。
FIG. 3 shows the internal structure of a subdirectory directory. When the number of files is small,
Like the "AAA" file and the "BBB" file, the file is directly placed on the file entry of the directory as in the prior art. If the number of files increases and exceeds n (eg 100 or 1000) entries,
M (primary) subdirectories, ". $ 00" in the case of FIG.
100 files from "0" to ". $ 099" are created, and files are placed in the subdirectory. Further, when the number of files on each sub-directory exceeds n, similarly (secondary) m sub-directories, 100 in the case of FIG. 3, “. $ 000” to “. $ 099”, There is a structure in which this is repeated. Distributing files on these subdirectories prevents a large number of files from being concentrated on one directory.

【0008】図4は、ファイル名からそのファイル名に
連動したファイル固有番号を得る方法の一例を説明する
ための概略図である。従来のファイルシステムでは、フ
ァイル固有番号はファイル名とは関係なくランダムに割
り当てられる。本発明では、ファイル固有番号の一部分
を用いてサブディレクトリを選択するようにしている。
したがって、ファイル名からそのサブディレクトリ、す
なわち、ファイル固有番号の一部が分からなければなら
ない。図4はファイル固有番号を作成する方法の一例を
示す。ファイル名の先頭2文字を足して100で割った
ときの余り数をファイル固有番号の下2桁にし、その次
の2文字を足して100で割ったときの余り数を下4桁
の上位2桁にするというように、これを繰り返すことで
ファイル固有番号を決めている。この下2桁の数値は第
1次のサブディレクトリを指定し、下4桁の上位2桁の
数値は(第1次の)サブディレクトリの下に作られた
(第2次の)サブディレクトリを指定する。なお、この
例では、文字数を2としているが、他の文字数にしても
よく、また、除数を100としているが、他の除数を用
いてもよい。図4において、ファイル名がABCDEの
場合、ASCIIコードで、 A:41(16進数)=65(10進数) B:42(16進数)=66(10進数) C:43(16進数)=67(10進数) D:44(16進数)=68(10進数) E:45(16進数)=69(10進数) であり、A、Bの2文字を足した数は131であり、1
31を100で割ったときの余りは31となり、C、D
の2文字を足した数は135であり、135を100で
割ったときの余りは35となり、ファイル名と連動しな
い部分が122であるとすると、ファイル固有番号は1
223531となる。ただし、一意に決まったファイル
固有番号がすでに使用されている場合があるので、さら
に上位の桁には、いくらでも数を付け加えてもよいもの
とする。ファイル名が図4に示すABCDEであるファ
イルを作成するとき、ディレクトリのファイルエントリ
数がn個を越える場合、ディレクトリ内に(第1次の)
サブディレクトリがm個作成される。図3の場合、m=
100であり、サブディレクトリ「.$000」〜「.$099」
が作成され、このとき、ファイル名がABCDEである
ファイルは、ファイル固有番号が1223531である
ので、下位1〜2桁の数値「31」にしたがってサブデ
ィレクトリ「.$031」にファイルエントリが作られる。
サブディレクトリ「.$031」のファイルエントリ数がn
個を越えてる場合には、サブディレクトリ「.$031」の
下に、さらに(第2次の)サブディレクトリがm個作成
される。図3の場合、m=100であり、サブディレク
トリ「.$000」〜「.$099」が作成され、ファイル名がA
BCDEであるファイルは、ファイル固有番号が122
3531であるので、下位3〜4桁の数値「35」にし
たがってサブディレクトリ「.$035」にファイルエント
リが作られる。
FIG. 4 is a schematic diagram for explaining an example of a method for obtaining a file unique number linked to a file name from the file name. In the conventional file system, the file unique number is randomly assigned regardless of the file name. In the present invention, a subdirectory is selected using a part of the file unique number.
Therefore, it is necessary to know a part of the subdirectory, that is, the file unique number, from the file name. FIG. 4 shows an example of a method for creating a file unique number. Add the first 2 characters of the file name and divide by 100 to make the remainder number the last 2 digits of the file unique number, then add the next 2 characters and divide by 100 to make the remainder 4 digits of the last 4 digits the upper 2 The file unique number is determined by repeating this, such as changing to a digit. The last two digits specify the primary subdirectory, and the last four digits of the upper two digits specify the (secondary) subdirectory created under the (first) subdirectory. specify. Although the number of characters is 2 in this example, the number of characters may be another number, and the divisor is 100, but other divisors may be used. In FIG. 4, when the file name is ABCDE, the ASCII code is: A: 41 (hexadecimal number) = 65 (decimal number) B: 42 (hexadecimal number) = 66 (decimal number) C: 43 (hexadecimal number) = 67 (Decimal number) D: 44 (hexadecimal number) = 68 (decimal number) E: 45 (hexadecimal number) = 69 (decimal number), and the number obtained by adding the two characters A and B is 131, and 1
When 31 is divided by 100, the remainder is 31 and C, D
The number obtained by adding the two characters is 135, and the remainder when 135 is divided by 100 is 35. Assuming that the part not linked with the file name is 122, the file unique number is 1
It becomes 223531. However, since there is a case where the unique file unique number is already used, any number may be added to the higher digits. When a file whose file name is ABCDE shown in FIG. 4 is created and the number of file entries in the directory exceeds n, the directory (primary)
M subdirectories are created. In the case of FIG. 3, m =
100, and subdirectories ". $ 000" to ". $ 099"
At this time, since the file having the file name ABCDE has the file unique number 1223531, the file entry is made in the subdirectory “. $ 031” according to the numerical value “31” of the lower one to two digits.
The number of file entries in the subdirectory ". $ 031" is n
If the number exceeds the limit, m (secondary) subdirectories are further created under the subdirectory “. $ 031”. In the case of FIG. 3, m = 100, sub directories “. $ 000” to “. $ 099” are created, and the file name is A.
A file that is BCDE has a file unique number of 122.
Since it is 3531, a file entry is created in the subdirectory ". $ 035" according to the numerical value "35" of the lower 3-4 digits.

【0009】図5は、オペレーティングシステムがファ
イルを作成する際の動作概要を示すフローチャートであ
る。まず、既に同一ファイル名のファイルが存在する場
合には(ステップ500)、アクセスが許可されていれ
ば、アクセス許可があるか判定し(ステップ502)、ア
クセス許可がある場合には、そのファイルに割り当てら
れていたブロックを全て解放し(ステップ503)、サイ
ズ0の新しいファイルとしてそのファイルを提供し、フ
ァイル作成処理を終了する。アクセス許可が無い場合
(ステップ502)にはエラーとなる。ステップ502、503
は従来と同じである。
FIG. 5 is a flowchart showing an outline of the operation when the operating system creates a file. First, if a file with the same file name already exists (step 500), if access is permitted, then it is determined whether there is access permission (step 502). All the allocated blocks are released (step 503), the file is provided as a new file of size 0, and the file creation process ends. If there is no access permission (step 502), an error will occur. Steps 502, 503
Is the same as before.

【0010】ステップ500で同一ファイル名のものが無
かった場合には、図4に示すようにして、ファイル名に
連動したファイル固有番号を割当て(ステップ501)よ
うとし、ファイル名に連動したファイル固有番号が足り
ないなどの理由でファイル固有番号を得られなかった場
合には、ファイル名に関係なく、空いているファイル固
有番号を割当てる(ステップ505)。この場合には、サ
ブディレクトリ上ではなく、通常のディレクトリ上にフ
ァイルを作成して(ステップ509)、ファイル作成処理
を終了する。ステップ507でファイル名と連動しないフ
ァイル固有番号でさえも割り当てられなかった場合に
は、エラーとなる。
If there is no file with the same file name in step 500, a file unique number linked to the file name is assigned (step 501) as shown in FIG. If the file unique number cannot be obtained due to lack of numbers, a free file unique number is assigned regardless of the file name (step 505). In this case, the file is created not in the sub-directory but in the normal directory (step 509), and the file creation process ends. If even a file unique number not linked with the file name is not assigned in step 507, an error occurs.

【0011】ステップ504でファイル名に連動したファ
イル固有番号が割り当てられた場合には、ディレクトリ
上のファイルエントリ数をチェックし、ファイルエント
リ数がn個(例えば、100個とか1000個)以上の
場合には(ステップ506)、サブディレクトリが存在し
ているか否かを判定し(ステップ508)、存在していれ
ば(例えば、図3の例の場合にはサブディレクトリ「.$
000」〜「.$099」が存在する)、ステップ511に進む。
存在していなければサブディレクトリを作成した上で
(例えば、図3の例の場合にはサブディレクトリ「.$00
0」〜「.$099」を作成する)(ステップ510)、ステッ
プ511に進む。ステップ511では、ファイル固有番号を元
にサブディレクトリを選択し、そのサブディレクトリへ
移動する。例えば、図3の例の場合、サブディレクトリ
は「.$000」〜「.$099」であり、ファイル名は図4の場
合、ABCDEであり、このファイル名に割り当てられ
たファイル固有番号は、1223531であるので、下
位1〜2桁の数値「31」にしたがってサブディレクト
リ「.$031」を選択し、このサブディレクトリ「.$031」
へ移動する。次に、ファイル数をチェックする処理(ス
テップ506)に戻り、ステップ508、510、511の処理を繰
り返す。最後にディレクトリ上のファイル数がn個未満
のサブディレクトリまで来たところで(ステップ50
6)、そのサブディレクトリ上にファイルを作成する
(ステップ509)。
When a file unique number associated with the file name is assigned in step 504, the number of file entries in the directory is checked, and when the number of file entries is n (eg, 100 or 1000) or more, (Step 506), it is determined whether or not the subdirectory exists (step 508), and if it exists (for example, in the case of the example in FIG. 3, the subdirectory ". $").
000 ”to“. $ 099 ”exist), the process proceeds to step 511.
If it does not exist, create a subdirectory (for example, in the case of the example in Fig. 3, the subdirectory ". $ 00
"0" to ". $ 099" are created) (step 510) and the process proceeds to step 511. In step 511, a subdirectory is selected based on the file unique number and moved to that subdirectory. For example, in the case of the example in FIG. 3, the subdirectory is “. $ 000” to “. $ 099”, the file name is ABCDE in FIG. 4, and the file unique number assigned to this file name is 1223531. Therefore, select the subdirectory ". $ 031" according to the numerical value "31" of the last 1 to 2 digits, and select this subdirectory ". $ 031".
Move to. Next, the process returns to the process of checking the number of files (step 506) and the processes of steps 508, 510 and 511 are repeated. Finally, when a subdirectory with less than n files is reached in the directory (Step 50
6) Create a file in that subdirectory (step 509).

【0012】なお、例えば、サブディレクトリ「.$03
1」へ移動したとき、サブディレクトリ「.$031」上のフ
ァイルエントリ数がn個を越えている場合には、サブデ
ィレクトリ「.$031」の下に、既に(第2次の)サブデ
ィレクトリがm個(図3の場合、m=100)存在して
いれば、ファイル固有番号が1223531であるの
で、下位3〜4桁の数値「35」にしたがってサブディ
レクトリ「.$035」へ移動する。(第2次の)サブディ
レクトリが存在していなければ、図3の場合、m=10
0であり、サブディレクトリ「.$000」〜「.$099」が作
成され、ファイル固有番号が1223531であるの
で、下位3〜4桁の数値「35」にしたがってサブディ
レクトリ「.$035」へ移動する。
[0012] For example, the subdirectory ". $ 03
If the number of file entries on the subdirectory “. $ 031” exceeds n when moving to “1”, the (secondary) subdirectory already exists under the subdirectory “. $ 031”. If the number (m = 100 in the case of FIG. 3) exists, the file unique number is 1223531, so the file is moved to the subdirectory “. $ 035” according to the numerical value “35” of the lower 3 to 4 digits. If the (secondary) subdirectory does not exist, m = 10 in the case of FIG.
0, the subdirectories “. $ 000” to “. $ 099” are created, and the file unique number is 1223531. Therefore, the subdirectory “. $ 035” is moved according to the numerical value “35” of the lower 3 to 4 digits.

【0013】図6は、オペレーティングシステムがファ
イルをオープンする際の動作概要を示すフローチャート
である。まず、オープンしたいファイルがあるディレク
トリに移動するために、指定したパス名のディレクトリ
部分に関して解析を行い、目的のディレクトリへ移動す
る(ステップ600)。移動したディレクトリのファイル
エントリを検索し、目的のファイル名に一致するまでエ
ントリを調べる(ステップ601)。該当するファイル名
が見つかったか否か判定し(ステップ602)、全エント
リを調べても該当するファイル名が見つからなかった場
合には、サブディレクトリがあるかどうかチェックし
(ステップ603)、無なければエラーとし、存在すれば
ファイル名を元にサブディレクトリを選択し、そのサブ
ディレクトリへ移動し(ステップ606)、エントリを調
べる作業(ステップ601)からこれを繰り返す。ステッ
プ602で該当するファイル名がエントリ中に見つかった
ら、そのエントリからファイル固有番号を取得する(ス
テップ604)。そのファイルにアクセス許可があるか否
か判定し(ステップ605)、アクセス許可がない場合に
はエラーとし、アクセス許可ある場合にはファイル固有
番号から求まるファイル情報を取得して(ステップ60
7)、処理を終了する。
FIG. 6 is a flow chart showing the outline of the operation when the operating system opens a file. First, in order to move to the directory containing the file to be opened, the directory part of the specified pathname is analyzed and moved to the target directory (step 600). The file entry of the moved directory is searched, and the entry is examined until it matches the desired file name (step 601). It is judged whether or not the corresponding file name is found (step 602), and if the corresponding file name is not found even after checking all entries, it is checked whether or not there is a subdirectory (step 603). If an error occurs, a subdirectory is selected based on the file name if it exists, the subdirectory is moved to (step 606), and the operation for checking the entry (step 601) is repeated from this step. When the corresponding file name is found in the entry in step 602, the file unique number is acquired from the entry (step 604). It is determined whether or not the file has access permission (step 605). If there is no access permission, an error occurs. If there is access permission, the file information obtained from the file unique number is acquired (step 60).
7), the process ends.

【0014】次に、ファイル名検索に要する時間につい
て説明する。あるディレクトリ上の全ファイル数をaと
し、1エントリ調べるのに要する時間をt、1ディレク
トリ上の最大ファイル数をn、1ディレクトリ上のサブ
ディレクトリ数mとする。この場合、従来のファイル名
検索では、ファイル名検索に要する平均処理時間は、a
*t/2である。これに対して、本実施例では、単純に
ディレクトリエントリを調べる時間だけを考え、サブデ
ィレクトリ上に移動する処理を無視すると、ファイル名
検索に要する平均処理時間は、約loga*(n+m
/2)t+n/2t となる。ここで、logaはサ
ブディレクトリ階層数、(n+m/2)tはサブディレ
クトリ内を検索する平均時間、n/2tは最後のサブデ
ィレクトリ内での検索平均時間である。例えば、a=1
00万個、t=0.001秒、n=100、m=100
とすると、従来の処理時間が500秒であるのに対し、
本発明においては0.5秒と、1万分の1に短縮され
る。
Next, the time required for the file name search will be described. It is assumed that the total number of files in a certain directory is a, the time required to check one entry is t, the maximum number of files in one directory is n, and the number of subdirectories in one directory is m. In this case, in the conventional file name search, the average processing time required for the file name search is a
* T / 2. On the other hand, in this embodiment, if only the time for examining the directory entry is considered and the process of moving to the subdirectory is ignored, the average processing time required for the file name search is about log ma * (n + m).
/ 2) t + n / 2t. Here, log ma is the number of subdirectory hierarchies, (n + m / 2) t is the average time to search the subdirectory, and n / 2t is the average search time in the last subdirectory. For example, a = 1
1,000,000, t = 0.001 seconds, n = 100, m = 100
Then, while the conventional processing time is 500 seconds,
In the present invention, it is shortened to 0.5 seconds, which is 1 / 10,000.

【0015】[0015]

【発明の効果】以上、説明したように、本発明によれ
ば、ファイル数増大によるファイルオープン、ファイル
作成などの処理時間の増加を大幅に抑え、1ディレクト
リ上のファイル数の規模に依存しない安定した性能を実
現することができ、計算機システム全体のアベイラビリ
ティを向上することができる。また、従来のファイルシ
ステムの基本構造は変更しないので、本発明のファイル
システムへの移行時間は必要がなく、また、障害時にも
既存のユーティリティや、回復プログラムがそのまま使
用できる。また、ユーザからのファイルの見え方は本発
明によって変わらないので、ユーザは本発明による性能
向上を意識することなく享受できる。また、ファイル名
検索に要する処理時間を大きく短縮することができる。
As described above, according to the present invention, the increase in the processing time such as file opening and file creation due to the increase in the number of files can be significantly suppressed, and the stability independent of the scale of the number of files in one directory can be achieved. The above performance can be realized, and the availability of the entire computer system can be improved. In addition, since the basic structure of the conventional file system is not changed, there is no need for the time required to transfer to the file system of the present invention, and existing utilities and recovery programs can be used as they are even in the event of a failure. Moreover, since the appearance of the file to the user is not changed by the present invention, the user can enjoy the performance improvement by the present invention without being aware of it. Moreover, the processing time required for the file name search can be greatly shortened.

【図面の簡単な説明】[Brief description of drawings]

【図1】ディレクトリとファイルの配置例を示す図であ
る。
FIG. 1 is a diagram showing an arrangement example of directories and files.

【図2】本発明の一実施例のシステム構成を示す図であ
る。
FIG. 2 is a diagram showing a system configuration of an embodiment of the present invention.

【図3】サブディレクトリ化されたディレクトリの内部
構造を示す図である。
FIG. 3 is a diagram showing an internal structure of a directory that is a subdirectory.

【図4】ファイル名からそのファイル名に連動したファ
イル固有番号を得る方法を説明するための概略図であ
る。
FIG. 4 is a schematic diagram for explaining a method of obtaining a file unique number associated with a file name from the file name.

【図5】オペレーティングシステムがファイルを作成す
る際の動作概要を示すフローチャートである。
FIG. 5 is a flowchart showing an operation outline when the operating system creates a file.

【図6】オペレーティングシステムがファイルをオープ
ンする際の動作概要を示すフローチャートである。
FIG. 6 is a flowchart showing an outline of operations performed when the operating system opens a file.

【図7】従来のディレクトリの内容を示す図である。FIG. 7 is a diagram showing the contents of a conventional directory.

【図8】従来のディレクトリ内のファイル固有番号を求
めるファイル名検索処理のフローチャートを示す図であ
る。
FIG. 8 is a diagram showing a flowchart of a conventional file name search process for obtaining a file unique number in a directory.

【符号の説明】[Explanation of symbols]

1 計算機 2 中央処理演算装置 3 主記憶装置 4 ユーザプログラム 5 オペレーティングシステム 6 外部記憶装置 7 ファイルシステム 8 ファイル 1 calculator 2 Central processing unit 3 main memory 4 User program 5 Operating system 6 External storage device 7 file system 8 files

───────────────────────────────────────────────────── フロントページの続き (72)発明者 今井 敬 神奈川県横浜市中区尾上町6丁目81番地 日立ソフトウェアエンジニアリング株式会 社内 (72)発明者 森山 建三 神奈川県横浜市戸塚区戸塚町5030番地 株 式会社日立製作所ソフトウェア事業部内 Fターム(参考) 5B082 EA01    ─────────────────────────────────────────────────── ─── Continued front page    (72) Inventor Kei Imai             6-81 Onoe-cho, Naka-ku, Yokohama-shi, Kanagawa             Hitachi Software Engineering Stock Association             In-house (72) Inventor Kenzo Moriyama             5030 Totsuka Town, Totsuka Ward, Yokohama City, Kanagawa Prefecture             Ceremony company Hitachi Ltd. software division F-term (reference) 5B082 EA01

Claims (4)

【特許請求の範囲】[Claims] 【請求項1】 プロセッサ装置と、データ入出力の対象
となる階層構造を持つファイルシステムが存在する外部
記憶装置を有する計算機システムにおけるファイル名検
索時間の増大抑止方法であって、 ファイルを前記ファイルシステム内のディレクトリ上に
保存する際に、該ファイルのファイル名に連動したファ
イル固有番号を作成し、作成したファイル固有番号を該
ファイルに割り当て、 前記ディレクトリにおけるファイルエントリの数が予め
定めた値に達していないときは、該ファイルを該ディレ
クトリ上に保存し、 前記ディレクトリにおけるファイルエントリの数が予め
定めた値に達しているときは、予め定めた数のサブディ
レクトリを該ディレクトリ上に作成し、該ファイルをフ
ァイル固有番号の少なくとも一部と一致する番号を有す
る前記サブディレクトリに保存し、 前記ディレクトリにおけるファイルエントリの数が予め
定めた値を超えているときは、該ファイルをファイル固
有番号の少なくとも一部と一致する番号を有する既に作
成されているサブディレクトリに保存することを特徴と
するファイル名検索時間の増大抑止方法。
1. A method for suppressing an increase in file name search time in a computer system having a processor device and an external storage device in which a file system having a hierarchical structure as a target of data input / output exists, the file system comprising: When a file is stored in a directory inside, a file unique number linked to the file name of the file is created, the created file unique number is assigned to the file, and the number of file entries in the directory reaches a predetermined value. If not, save the file in the directory, and if the number of file entries in the directory reaches a predetermined value, create a predetermined number of subdirectories in the directory, The file has a number that matches at least part of the file's unique number. When the number of file entries in the directory exceeds a predetermined value, the file is already created in a subdirectory having a number that matches at least a part of the file unique number. A method for suppressing an increase in the file name search time, which is characterized by storing in a file.
【請求項2】 請求項1記載のファイル名検索時間の増
大抑止方法において、 前記ファイル固有番号は、ファイル名を構成する複数の
文字から、1以上の文字からなる文字の組を少なくとも
1組抽出し、抽出した各文字のコードを10進数に変換
し、各組において組を構成する各文字の10進数を加算
し、加算結果を予め定めた除数で割った残りの数値を求
め、各組の該数値と、ファイル名と連動しない数値とを
組み合わせることにより生成することを特徴とするファ
イル名検索時間の増大抑止方法。
2. The method for suppressing an increase in file name search time according to claim 1, wherein the file unique number extracts at least one character set consisting of one or more characters from a plurality of characters forming the file name. Then, the code of each extracted character is converted into a decimal number, the decimal numbers of the respective characters that make up the set in each set are added, and the remaining numerical value obtained by dividing the addition result by a predetermined divisor is obtained. A method of suppressing an increase in file name search time, which is generated by combining the numerical value and a numerical value that does not work with a file name.
【請求項3】 プロセッサ装置と、データ入出力の対象
となる階層構造を持つファイルシステムが存在する外部
記憶装置を有する計算機システムにおいて、 ファイルを前記ファイルシステム内のディレクトリ上に
保存する際に、該ファイルのファイル名に連動したファ
イル固有番号を作成し、作成したファイル固有番号を該
ファイルに割り当てる手段と、 前記ディレクトリにおけるファイルエントリの数が予め
定めた値に達していないときは、該ファイルを該ディレ
クトリ上に保存する手段と、 前記ディレクトリにおけるファイルエントリの数が予め
定めた値に達しているときは、予め定めた数のサブディ
レクトリを該ディレクトリ上に作成する手段と、 該ファイルをファイル固有番号の少なくとも一部と一致
する番号を有する前記サブディレクトリに保存する手段
と、 前記ディレクトリにおけるファイルエントリの数が予め
定めた値を超えているときは、該ファイルをファイル固
有番号の少なくとも一部と一致する番号を有する既に作
成されているサブディレクトリに保存する手段を有する
ことを特徴とする計算機システム。
3. A computer system having a processor device and an external storage device in which a file system having a hierarchical structure as a target of data input / output exists, when a file is stored in a directory in the file system. A means for creating a file unique number linked to the file name of the file and assigning the created file unique number to the file; and, when the number of file entries in the directory does not reach a predetermined value, Means for storing on the directory; means for creating a predetermined number of subdirectories on the directory when the number of file entries in the directory reaches a predetermined value; and a file unique number for the file Of the subdata having a number matching at least a part of Means for storing in a directory, and when the number of file entries in the directory exceeds a predetermined value, the file is stored in an already created subdirectory having a number matching at least a part of the file unique number. A computer system having means for storing.
【請求項4】 ファイルを前記ファイルシステム内のデ
ィレクトリ上に保存するときに、該ファイルのファイル
名に連動したファイル固有番号を作成し、作成したファ
イル固有番号を該ファイルに割り当てる手順と、 前記ディレクトリにおけるファイルエントリの数が予め
定めた値に達していないと判定したときは、該ファイル
を該ディレクトリ上に保存する手順と、 前記ディレクトリにおけるファイルエントリの数が予め
定めた値に達していると判定したときは、予め定めた数
のサブディレクトリを該ディレクトリ上に作成する手順
と、 該ファイルをファイル固有番号の少なくとも一部と一致
する番号を有する前記サブディレクトリに保存する手順
と、 前記ディレクトリにおけるファイルエントリの数が予め
定めた値を超えていると判定したときは、該ファイルを
ファイル固有番号の少なくとも一部と一致する番号を有
する既に作成されているサブディレクトリに保存する手
順をコンピュータに実行させるためのプログラム。
4. When a file is stored in a directory in the file system, a file unique number associated with the file name of the file is created, and the created file unique number is assigned to the file. When it is determined that the number of file entries in the file does not reach the predetermined value, the procedure of storing the file in the directory and the number of file entries in the directory are determined to reach the predetermined value. In that case, a procedure of creating a predetermined number of subdirectories on the directory, a procedure of storing the file in the subdirectory having a number that matches at least a part of the file unique number, and a file in the directory Judged that the number of entries exceeds a predetermined value When it is a program for executing the steps of storing in a subdirectory that has already been created with a number that matches the at least a portion of the file unique number of the file to the computer.
JP2002066362A 2002-03-12 2002-03-12 Increase suppressing method of file name retrieval time and computer system Pending JP2003263351A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2002066362A JP2003263351A (en) 2002-03-12 2002-03-12 Increase suppressing method of file name retrieval time and computer system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2002066362A JP2003263351A (en) 2002-03-12 2002-03-12 Increase suppressing method of file name retrieval time and computer system

Publications (1)

Publication Number Publication Date
JP2003263351A true JP2003263351A (en) 2003-09-19

Family

ID=29198189

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2002066362A Pending JP2003263351A (en) 2002-03-12 2002-03-12 Increase suppressing method of file name retrieval time and computer system

Country Status (1)

Country Link
JP (1) JP2003263351A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007334397A (en) * 2006-06-12 2007-12-27 Yokogawa Electric Corp Data management device
JP2011070688A (en) * 2005-08-26 2011-04-07 Panasonic Corp System, method and program for recording data

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2011070688A (en) * 2005-08-26 2011-04-07 Panasonic Corp System, method and program for recording data
JP2011070687A (en) * 2005-08-26 2011-04-07 Panasonic Corp System, method and program for recording data
JP2012142020A (en) * 2005-08-26 2012-07-26 Panasonic Corp Data recording system, data recording method and data recording program
JP2007334397A (en) * 2006-06-12 2007-12-27 Yokogawa Electric Corp Data management device

Similar Documents

Publication Publication Date Title
US20210311912A1 (en) Reduction of data stored on a block processing storage system
US10515052B2 (en) File system that supports both case sensitive and case insensitive directory lookup
US6212525B1 (en) Hash-based system and method with primary and secondary hash functions for rapidly identifying the existence and location of an item in a file
US7756835B2 (en) Database and operating system independent copying/archiving of a web base application
US7185011B1 (en) Method and system for directory balancing
US7454405B2 (en) File management program, file management process, and file management apparatus
JP2005302038A (en) Method and system for renaming consecutive key in b-tree
US9256610B2 (en) File deduplication in a file system
US20080109908A1 (en) Reverse Name Mappings In Restricted Namespace Environments
CN113297138A (en) Index establishing method, data query method and computing device
US6735600B1 (en) Editing protocol for flexible search engines
US6826755B1 (en) Systems and methods for switching internet contexts without process shutdown
CN106547644A (en) Incremental backup method and equipment
CN108475508B (en) Simplification of audio data and data stored in block processing storage system
CN110413711B (en) Differential data acquisition method and storage medium thereof
CN110737663A (en) data storage method, device, equipment and storage medium
JP6726690B2 (en) Performing multidimensional search, content-associative retrieval, and keyword-based retrieval and retrieval on losslessly reduced data using basic data sieves
MXPA04007146A (en) Method and apparatus for late-binding/dynamic pathname resolution.
CN109460406B (en) Data processing method and device
US9020977B1 (en) Managing multiprotocol directories
US8086638B1 (en) File handle banking to provide non-disruptive migration of files
US9509757B2 (en) Parallel sorting key generation
JP2003263351A (en) Increase suppressing method of file name retrieval time and computer system
JPH04260945A (en) Device and method for accessing file
KR20100022565A (en) Method for searching an url using hash tree

Legal Events

Date Code Title Description
RD04 Notification of resignation of power of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7424

Effective date: 20040318