|Publication number||US7246139 B2|
|Application number||US 10/154,848|
|Publication date||Jul 17, 2007|
|Filing date||May 28, 2002|
|Priority date||Nov 8, 2001|
|Also published as||US20050076063|
|Publication number||10154848, 154848, US 7246139 B2, US 7246139B2, US-B2-7246139, US7246139 B2, US7246139B2|
|Original Assignee||Fujitsu Limited|
|Export Citation||BiBTeX, EndNote, RefMan|
|Patent Citations (10), Non-Patent Citations (2), Referenced by (22), Classifications (18), Legal Events (7)|
|External Links: USPTO, USPTO Assignment, Espacenet|
1. Field of the Invention
The present invention relates to a file system, for which a large memory capacity recording medium, such as a hard disk, is provided which enables the restoration of a defective file generated due to an accident occurred during the recording of data, and to file management apparatus incorporated therein.
2. Related Background Arts
Heretofore, file systems incorporating hard disks have been used mainly as external storage media for computers. A file system employed for this purpose must write and read data with high reliability, and it is assumed that such a file system should normally finish a data recording operation in progress when a stoppage, such as a power loss, occurs. Thus, a function is provided for a file system for monitoring the power supply voltage, and for supplying power when the voltage is reduced, so that even if there is a sudden, complete loss of power, auxiliary power can be supplied for a short period of time to permit the data recording operation to be finished normally. Alternatively, two file allocation tables (FATs) may be provided for a file system and used for disk file management, so that following the occurrence of a stoppage, a defective file can be detected by comparing the two FATs. A file management process is thus required for a plurality of FATs.
Further, since the costs of manufacturing a large memory capacity recording media such as hard disks have been dramatically reduced, a video recorder incorporating the hard disk for recording video and sound data have been developed. Unlike computer data, the recording of video and sound data requires extremely large amounts of memory media; however, with the reduction in the costs associated with the manufacture of hard disks, as a recording media employed for a video recorder installed in homes, hard disks are gradually replacing video tapes.
A video recorder having built-in hard disk uses the MPEG2 method to encode and compress video and sound data, and records the resultant data on a recording medium, the hard disk. During reproduction, the recorded data is read from the hard disk, and a decoder converts that data into the original video or sound data, which is then output. Unlike video tape, a hard disk can be accessed randomly and can both reproduce and record data at the same time, so that video recorders having built-in hard disks are assumed to have a favorable future as home video recorders. In addition to video recorders, in consonance with the growth in popularity of broadband, the wide use of recording/reproduction apparatuses having built-in hard disks, for recording video and sound data, appears promising.
For a file system, such as a hard disk recorder, a function is required to prevent the abnormal termination of a recording operation due to a power cutoff and to avoid the production of a defective file. However, it is not preferable for, as with a file system used for a conventional computer system, a power monitoring device and a battery, or a plurality of FATS to be provided to cope with a stoppage because system manufacturing costs would be increased. While the reliability required for the recording and reproduction of video and sound data need not be as high as that required for computer data, for a file system cost reduction is a more important problem.
It is, therefore, one objective of the present invention to provide a file system which, without increasing manufacturing costs, can restore a defective file produced as the result of a stoppage, such as a power cutoff, and to also provide a file management apparatus that is incorporated into the file system.
To achieve the above objective, according to a first aspect of the present invention, a file management apparatus for a file system, which includes a data area divided into a plurality of clusters, a file allocation table (FAT) having a plurality of table areas mapped in accordance with said clusters, and a directory having a file attribute area in which at the least a file name, a head FAT pointer and a file size of a number of said clusters are recorded, comprises:
a data recording module for, during data recording, setting a head FAT address for said head FAT pointer and an initial value for said file size (cluster number) to generate a new file attribute area in said directory, for repetitively writing data in a cluster corresponding to a currently processed FAT while storing a succeeding FAT address in said currently processed FAT to generate a FAT chain, and for writing an end code in a last FAT and writing a number of used clusters as said file size in said file attribute area of said directory to finish a recording operation; and
a FAT restoration module for searching said file attribute area of said directory to detect a first file whose file size is other than said initial value, for generating a FAT map by storing a file number of said first file in a map area corresponding to each FAT of the FAT chain of said detected first file, for additionally storing, in said FAT map, a file number of a second file whose file size is said initial value, and for restoring said FAT in accordance with said FAT map.
According to the present invention, it is assumed that in a data recording operation, when the data recording is initiated, the data recording module writes the initial value of the file size in the new file attribute area of the directory, and when the data recording is ended, the data recording module writes the number of clusters as the file size in the new file attribute area. With this assumption, the FAT restoration module examines the file size written in the file attribute area, and distinguishes the first file for which the writing is normally terminated, from the second file for which the writing is not normally terminated. The FAT restoration module tracks the FAT chain of the first file and stores the file number of the first file in the map area corresponding to that FAT. Thereafter, the FAT restoration module tracks the FAT chain of the second file, and stores the file number of the second file in the map area corresponding to that FAT. Therefore, at the least, FATs corresponding to clusters in which data may have been recorded can be designated on the FAT map, and the FAT map can be employed to restore the FAT of the defective file. The file number is a file ID for defining, as a directory, the location of a file from the beginning of the directory area. Therefore, the file number differs from the file name.
According to this invention, while taking into account that, in a hard disk recorder for which not very high reliability is required, stream data is recorded by the cluster unit as for data recording and reproduction, simple software, i.e., a FAT restoration module, is employed to restore a defective file.
Further, to achieve the above objective, according to a second aspect of the invention, a file system comprises a file management apparatus including the data recording module and the FAT restoration module of the first aspect, and a file apparatus having, at the least, the data area.
The preferred embodiment of the present invention will now be described while referring to the accompanying drawings. It should be noted, however, that the scope of the protection of the present invention is not limited to this embodiment, and covers the invention cited in the following claims and its equivalent.
The file system further comprises a data recording module program for controlling the writing of data on the disk drive 16, a data reading module program for controlling the reading of data, and a FAT restoration module program for restoring a defective file resulting from the occurrence of a power cutoff while data is being recorded in the memory 16.
The file management apparatus 14, on the periphery of the encoder 18, further comprises: a video decoder 30, for decoding an analog video input signal Vin, which is a composite signal, in accordance with the NTSC method or the PAL method, and for converting the decoded signal into a digital signal; an analog/digital audio converter 32, for receiving analog audio input signals (right and left audio signals) SLin and SRin, and for converting the input signals into digital signals at a predetermined sampling rate; a PLL circuit 34 for receiving a bit clock BCLK and supplying a sampling clock to a analog/digital audio converter 32; a memory 36 for temporarily storing compressed data; a program memory 38 for storing a control program for the encoder 18; and a temporary data memory 40 for recording encoded data.
The file management apparatus 14 further comprises, for the decoder 22: a video amplifier 44 for amplifying a decompressed or decoded video signal and outputting the obtained analog video signal Vout; a digital/analog audio converter 48 for converting the decompressed or decoded digital audio signal into analog audio signals SLout and SRout; and a temporary data recording memory 42 for recording decoded data.
In addition to the CPU 24 and the program memory 26, a CPU work memory 56 and a timer 58 for recording the recording start time and the end time are also connected to the CPU bus 28. The disk manager 20 incorporates a hard disk interface (IDE interface) and a CPU write/read register, and a disk input/output pin 54 which is connected to the disk manager 20 via a buffer 52 as well as to the disk drive 16. The disk manager 20 can be implemented by a single ASIC, for example, and may be carried out by a system LSI which is integrally formed with the CPU 24 and the memories 26 and 56 which are connected to the CPU bus 28.
In the file management apparatus 14, the input video signal Vin and the input audio signals SLin and SRin are converted into digital signals, the obtained digital signals are encoded or compressed by the encoder 18, and the digital data stream is supplied to the data buffer 52 of the disk manager 20, which thereafter writes the digital data stream to the hard disk drive 16. The operation for recording the stream data is controlled by the data recording module of the program memory 26, and the data is recorded as a new file on the disk drive 16. A specific recording operation will be described later.
As is shown in
A plurality of FATs are provided in the FAT area 62, physically and respectively corresponding to plural clusters in the data area 66. In the example in
In the initial state wherein the file system is formatted, an unused cluster code uniquely indicating the unused state (empty) of a cluster, e.g. “0xFFFFFFFF” (the most significant value provided by four bytes in the hexadecimal system), is stored in each FAT in the FAT area 62. When a cluster is used, FAT address corresponding to the succeeding cluster or FAT end code is stored in the corresponding FAT. A code that ordinarily will not occur, such as “0xFFFFFFFE”, is selected as the FAT end code.
Further, during the initialized state, an initial value of “0xFFFFFFFF”, for example, is also stored in the directory area 64.
When the data recording operation is begun, first, a new file is created (S10). In the new file creation sub-routine in
The attribute data in
In the file system of this embodiment, a file number (file ID) of two bytes is allocated for the file attribute area corresponding to each file which is provided in the directory area 64, and such file number is distinguished from the file name. Since the file number is binary data indicating the location of the file attribute area in the directory area 64, the internal process for identifying the file is simplified and can be performed rapidly.
For example, for a time-shifting reproduction in which a TV program is being reproduced while being recorded, a rule must be maintained whereby the reproduction side does not go ahead of the recording side. In this case, it is necessary to determine whether the same file being recorded is currently being reproduced or whether a different file is currently being reproduced, and in this case, to make a quick determination, only the file numbers need be compared. In addition, the file number (file ID) is also employed for the file identification information stored in the FAT map, which will be described later.
For this, employing the file name in the file attribute area of the directory area 64 is not preferable, because since the file name is large, 32 bytes long, the speed for the identification process is slower.
Referring again to
When steps S20 to S24 have been completed for the first FAT, the same steps S20 to S24 are performed for the second FAT. In the process for the second FAT, at step S20 the address of the FAT corresponding to the third cluster is stored as the FAT pointer in the second FAT. Steps S20 to S24 are repeated until writing of all the stream data is completed (S25). In this manner, in the current FAT, the next address is stored as the FAT pointer, and a sequential FAT chain is generated.
In the example in
When all the stream data have been written (S25), the file closing process (S26) is performed. In the file closing process, as is shown in
When the recording operation is started, first, the file size=0 is stored in the file attribute area of the directory area 64, and the first FAT address is stored in the first FAT pointer of the directory area. When the recording operation is normally terminated, the FAT end code NL is stored at the last FAT, and the number of used clusters is stored as the file size. In this embodiment, as will be described later, a defective file is detected while taking the recording control operation into account.
The defective file restoration operation for this embodiment will now be described. According to the previous data recording operation, when power is cut off during data recording and the operation is not normally terminated, the process (1) for changing the FAT pointer of the FAT corresponding to the last cluster into the end code NL, and the process (2) for changing the file size into the number of used clusters are incomplete. Therefore, the defective file can be detected if (1) the FAT pointer of the FAT corresponding to the last cluster is not the end code, and (2) the file size is maintained as the initial value (=0). In this embodiment, the restoration of the defective file is implemented while taking this state into account.
For the explanation of the restoration, assume that the following files are created.
file 1: first FAT=00, file size=4
file 2: first FAT=04, file size=9
file 3: first FAT=15, file size=14
file 4: first FAT=09, file size=0 (actual size=4)
file 5: first FAT=12, file size=0 (actual size=3)
file 6: first FAT=0D, file size=0 (actual size=0)
The above first FAT pointer and the file size are written in the file attribute area in the directory area 64. The actual file size can be detected by analizing the FAT state, but can not be detected by referring to the directory area 64 due to file size=0.
In the above example, files 1, 2 and 3 are normal files because their file sizes are other than the initial value=0. Files 4, 5 and 6 are detective files because their file sizes are maintained as the initial value=0.
As shown at right side of the FAT state table in
In addition, file 4 has a first FAT address of “09”, and a FAT chain of 09-0A-0B-0C, and the FAT pointer value of the FAT “0D”, supposed to be the last FAT, is unused cluster code (an empty column). Therefore, it is assumed that the recording operation was interrupted by a power cutoff, when the data stream is recorded in the cluster corresponding to FAT “0C”. Therefore, the actual last FAT is “0C”, which immediately precedes “0D”.
File 5 has a first FAT address of “12” and a FAT chain of 12-13-14, and the FAT pointer of the last FAT “14” is “15”. Since the FAT “15” overlaps the first FAT for file 3, it can be assumed that the recording of file 5 was also interrupted by the power cutoff while data is recorded up to the cluster corresponding to the FAT “14”. Therefore, the actual last FAT is “14”, which immediately precedes “15”.
For file 6, the first FAT address is “0D”, and the unused cluster code (an empty column) is stored as the FAT pointer in the FAT “0D”. Therefore, it is assumed that for file 6, a new file attribute area is prepared in the directory area 64; however, the power was cut off before a FAT pointer or data were written to the FAT and the cluster.
An explanation will now be given for the defective file restoration processing for the FAT state before the above referenced restoration. In
At step S44, a normal file whose file size is other than the initial value of 0 is detected in the file attribute area of the directory area 64, and a FAT map is prepared for the detected normal file. The FAT map is a table to represent to which file each FAT corresponds, and is temporarily employed to restore a defective file. Therefore, the FAT map is prepared, for example, in the CPU work memory 56 or in the temporary area of the disk drive 16. When the upper limit for the number of files for the file system is defined as a maximum 65535 files, which can be represented by two bytes (216), the individual areas in the FAT map have capacities of two bytes each, and the FAT map has a capacity of a multiple of the number of clusters therewith. Further, at the beginning, the FAT map is initialized by an unused code, such as 0xFFFF.
A normal file 1 whose file size is other than the initial value of 0 is detected, the FAT address of the used cluster is detected from the head FAT pointer and the FAT state of the file 1, and the file number “01” is sequentially stored in the corresponding addresses in the FAT map. As a result, in the FAT map in
At step S46, the file number of a defective file whose file size is maintained as the initial value of 0 is added to the FAT map. As a result, the FAT map in
Condition 1: The FAT pointer is an unused cluster code (case for file 4);
Condition 2: The code in the FAT map is not an unused code, but a file number code which is already present (case for file 5); and
Condition 3: The FAT pointer in the FAT pointed to by the head FAT pointer is an unused cluster code (case for file 6).
A cluster counter for recording the file size is set up in the work memory 56, and each time the file number of the defective file is stored in the FAT map, the value of the cluster counter is incremented by one in order to count the file size at the same time.
For the file 4, a series of addresses 09-0A-0B-0C, from the head FAT pointer of “09” until condition 1 is satisfied, are detected as used clusters, and file number “04” is stored in the corresponding addresses of the FAT map. The cluster counter value at this time is four. For the file 5, a series of addresses 12-13-14, from the head FAT pointer “12” until condition 2 is satisfied, are defined as used clusters, and file number “05”, is stored in the corresponding addresses of the FAT map. Since the file number “03” of the normal file is already stored at address “15” of the FAT map, it is determined that the used clusters of file 5 continue up to the address “14”. The cluster counter value in this case is three.
Since the used clusters have been detected for files 4 and 5, as is shown in
For file 6, since the head FAT pointer “0D” corresponds to condition 3, only file number “06” need be stored at address “0D” in the FAT map. However, for file 6, an unused cluster code is stored at address “0D” of FAT. Therefore, the cluster corresponding to the address “0D” is unused state and it is determined that no data has been written in the cluster for file 6. As a result, since no stream data has been recorded for file 6, a file deletion process is performed.
The file deletion process is a process of initializing a directory area 64 and a FAT area 62 corresponding to the deleting file. For file 6, the initial value is stored in the corresponding file attribute area of the directory area 64, however since no FAT pointer is stored in the FAT area 62, no particular process is performed for the FAT area 62. During the file deletion process, an initial value is stored in a series of FATs of the file size, beginning with the FAT in the head FAT pointer. For file 6, since the file size is maintained as 0, the initialization of the FAT is not performed, and as a result, address “0D” of the FAT in
At step S48, a cluster which is not included in a cluster chain indicating currently used clusters is changed from the used state to the unused state. Specifically, the FAT map in
According to the first case, code other than the unused cluster code is stored in the FAT, although as a result of the examination based on the file attribute area of the directory area 64 the cluster is determined to be unused. Since at the creation of a new file, this cluster is not detected as an empty cluster, so that the data can not thereafter be recorded in the cluster. Therefore, to restore the clusters, the unused cluster code is written in the corresponding FAT to enable the use of the cluster thereafter. The second case is a state which can not normally occur, and in the file deletion process, only the directory area is initialized.
Through this restoration processing, a defective file wherein data seems to be recorded in the clusters is restored as a normal file within the range of these clusters. Further, a defective file wherein data does not seem to be recorded in the clusters is deleted. Therefore, the normal files are recovered without most of the recorded data being deleted.
In this embodiment, the FAT map is created first for a normal file, and is then created for a defective file. Thus, clusters in the normal file can be prevented from being replaced by clusters in a defective file (e.g., the cluster in the last FAT entry for file 4 or 5) that may have been erroneously designated. Further, by employing the fact that in the data recording operation, the file size is set to the initial value (=0) first, a defective file can be detected by only referring the file size of the file attribute area of the directory area 64.
Furthermore, in the embodiment, the file management apparatus 14 is carried out as a system board including multiple semiconductor devices; however, it may be implemented by a system LSI wherein the file manager 20, the CPU 24, the program memory 26, the RAM 56 and the timer 58 are integrally formed.
The defective file restoration processing may be performed upon the reception of an active instruction from the user, or at a time periodically designated by the timer. That is, the FAT restoration module in the program memory 26 is executed when a restoration is required.
According to the present invention, a defective file can be restored without power source monitoring means or a battery being required, and without the creation of overlapping FATs.
|Cited Patent||Filing date||Publication date||Applicant||Title|
|US4941059 *||Sep 13, 1988||Jul 10, 1990||Compaq Computer Corporation||Method for restoring computer files, including improved steps for location of head clusters of files|
|US5806072 *||Dec 21, 1992||Sep 8, 1998||Olympus Optical Co., Ltd.||Electronic imaging apparatus having hierarchical image data storage structure for computer-compatible image data management|
|US5832526 *||Jan 24, 1996||Nov 3, 1998||Symantec Corporation||Method and apparatus using slack area of file storage structures for file reconstruction|
|US5907672 *||Oct 4, 1995||May 25, 1999||Stac, Inc.||System for backing up computer disk volumes with error remapping of flawed memory addresses|
|US6038639 *||Sep 9, 1997||Mar 14, 2000||Storage Technology Corporation||Data file storage management system for snapshot copy operations|
|US6041425 *||Sep 2, 1997||Mar 21, 2000||Hitachi, Ltd.||Error recovery method and apparatus in a computer system|
|US6377958 *||Jul 7, 2000||Apr 23, 2002||Powerquest Corporation||File system conversion|
|US6519762 *||Dec 15, 1998||Feb 11, 2003||Dell Usa, L.P.||Method and apparatus for restoration of a computer system hard drive|
|US7080105 *||Jan 27, 2003||Jul 18, 2006||Hitachi, Ltd.||System and method for data backup|
|US20060212491 *||Mar 21, 2005||Sep 21, 2006||International Business Machines Corporation||Auditing compliance with a hippocratic database|
|1||*||Richard Kenner Intergrating GNAT and GCC, Annual International Conference of Ada, p. 84-92, 1994.|
|2||*||Wang et al. Orientation information measure bsed image restoration, Machine Learning and Cybernetics, 2003 International Confrence, V. 5, pp. 2925-2930, Nov. 2-5, 2003.|
|Citing Patent||Filing date||Publication date||Applicant||Title|
|US7363352 *||Jul 19, 2006||Apr 22, 2008||Hitachi, Ltd.||Method for accessing distributed file system|
|US7548959||Mar 4, 2008||Jun 16, 2009||Hitachi, Ltd.||Method for accessing distributed file system|
|US8200611 *||Apr 15, 2009||Jun 12, 2012||Fujitsu Semiconductor Limited||File system and data management method|
|US8205060||Dec 22, 2009||Jun 19, 2012||Sandisk Il Ltd.||Discardable files|
|US8375192||Dec 22, 2009||Feb 12, 2013||Sandisk Il Ltd.||Discardable files|
|US8463802||Sep 30, 2010||Jun 11, 2013||Sandisk Il Ltd.||Card-based management of discardable files|
|US8499013 *||Sep 19, 2011||Jul 30, 2013||Microsoft Corporation||FAT directory structure for use in transaction safe file system|
|US8533847 *||Jan 27, 2008||Sep 10, 2013||Sandisk Il Ltd.||Apparatus and method for screening new data without impacting download speed|
|US8549229||Sep 30, 2010||Oct 1, 2013||Sandisk Il Ltd.||Systems and methods for managing an upload of files in a shared cache storage system|
|US8626993||Nov 18, 2011||Jan 7, 2014||Apple Inc.||Method for tracking memory usages of a data processing system|
|US8738845||Sep 19, 2011||May 27, 2014||Microsoft Corporation||Transaction-safe fat file system improvements|
|US8788849||Dec 20, 2011||Jul 22, 2014||Sandisk Technologies Inc.||Method and apparatus for protecting cached streams|
|US8849856||Dec 22, 2009||Sep 30, 2014||Sandisk Il Ltd.||Discardable files|
|US8949518||Dec 3, 2013||Feb 3, 2015||Apple Inc.||Method for tracking memory usages of a data processing system|
|US9003396 *||Jun 19, 2006||Apr 7, 2015||Lenovo Enterprise Solutions (Singapore) Pte. Ltd.||File manager integration of uninstallation feature|
|US9015209||Mar 9, 2010||Apr 21, 2015||Sandisk Il Ltd.||Download management of discardable files|
|US9020993||Dec 15, 2011||Apr 28, 2015||Sandisk Il Ltd.||Download management of discardable files|
|US9104686||Dec 30, 2011||Aug 11, 2015||Sandisk Technologies Inc.||System and method for host management of discardable objects|
|US9141630||Jul 29, 2013||Sep 22, 2015||Microsoft Technology Licensing, Llc||Fat directory structure for use in transaction safe file system|
|US20060259611 *||Jul 19, 2006||Nov 16, 2006||Hitachi, Ltd.||Method for accessing distributed file system|
|US20090282091 *||Nov 12, 2009||Fujitsu Microelectronics Limited||File system and data management method|
|US20120011179 *||Jan 12, 2012||Microsoft Corporation||Fat directory structure for use in transaction safe file system|
|U.S. Classification||707/823, 707/E17.01, 714/E11.136, 707/999.202, 707/914, 707/916, 707/999.2|
|International Classification||G11B20/10, G06F3/06, G06F12/00, G11B20/12|
|Cooperative Classification||Y10S707/916, Y10S707/99953, Y10S707/914, G06F11/1435, G06F17/30067|
|European Classification||G06F11/14A8F, G06F17/30F|
|May 28, 2002||AS||Assignment|
Owner name: FUJITSU LIMITED, JAPAN
Free format text: ASSIGNMENT OF ASSIGNORS INTEREST;ASSIGNOR:ANDOH, TSUYOSHI;REEL/FRAME:012929/0253
Effective date: 20020522
|Apr 15, 2008||CC||Certificate of correction|
|Dec 10, 2008||AS||Assignment|
Owner name: FUJITSU MICROELECTRONICS LIMITED,JAPAN
Free format text: ASSIGNMENT OF ASSIGNORS INTEREST;ASSIGNOR:FUJITSU LIMITED;REEL/FRAME:021985/0715
Effective date: 20081104
|Jul 27, 2010||AS||Assignment|
Owner name: FUJITSU SEMICONDUCTOR LIMITED, JAPAN
Free format text: CHANGE OF NAME;ASSIGNOR:FUJITSU MICROELECTRONICS LIMITED;REEL/FRAME:024794/0500
Effective date: 20100401
|Dec 16, 2010||FPAY||Fee payment|
Year of fee payment: 4
|Dec 24, 2014||FPAY||Fee payment|
Year of fee payment: 8
|Apr 27, 2015||AS||Assignment|
Owner name: SOCIONEXT INC., JAPAN
Free format text: ASSIGNMENT OF ASSIGNORS INTEREST;ASSIGNOR:FUJITSU SEMICONDUCTOR LIMITED;REEL/FRAME:035507/0923
Effective date: 20150302