Patent ID: 7454405

Claim:
A computer-readable medium storing a file management program which makes a computer perform processing for management of files in a storage device, the program comprising: a request reception unit which receives a processing request and determines whether a file to be processed is a directory file or a non-directory file; a hash-value generation unit which, if the file to be processed in response to said processing request is the directory file, applies a predetermined hash function to name information contained in said processing request, and generates a hash value of the name information; a physical-block-number acquisition unit which, if the file to be processed in response to said processing request is the non-directory file, acquires a logical-block number of data to be accessed with reference to a dinode, and looks up an extent table indicating correspondence between logical-block numbers and physical-block numbers to acquire a physical-block number of the data to be accessed, and if the file to be processed in response to said processing request is the directory file, looks up, in place of the extent table, a hash-value-range table containing at least one hash-value-range information set each of which is constituted by a hash-value range defining a range of hash values and a physical-block number uniquely indicating a data storage region in said storage device, extracts one of the at least one hash-value-range information set in which a hash-value range containing the hash value of the name information is included, and acquires a physical-block number from the one of the at least one hash-value-range information set; and a directory processing unit which, if the file to be processed in response to said processing request is the directory file, performs processing of a physical block in said storage device corresponding to said physical-block number acquired by said physical-block-number acquisition unit, where the processing relates to a record containing said name information and is performed in accordance with said processing request, wherein when said processing request instructs insertion of said name information, said directory processing unit inserts said record containing said name information into data acquired from said physical block, and puts the data into which the record is inserted, back into said physical block, wherein said directory processing unit determines whether or not said record can be inserted into said data, and inserts the record into said data when the record can be inserted into the data; and when the record cannot be inserted into the data, said directory processing unit divides said hash-value range containing the hash value of the file to be processed, into a plurality of hash-value ranges, updating said hash-value-range table by registering in the hash-value-range table a plurality of hash-value-range information sets corresponding to the plurality of hash-value ranges, and performs processing for insertion of said record by looking up the updated hash-value-range table.