Patent ID: 8904103

Claim:
A data processing apparatus for recording a file having a plurality of blocks into a storage device that is a virtual tape library, the data processing apparatus comprising: a processor to control the data processing apparatus according to a process including: performing a write processing when receiving the file that is written into the storage device from a higher level device, the write processing including: calculating a compression ratio of each of the blocks of the file, in sequence, from a first block of the file toward a last block of the file, comparing the calculated compression ratio of each of the blocks of the file with a threshold, determining whether each of the blocks of the file is to be compressed based on a result of the comparison, recording each of the blocks of the file on the storage device in a compressed or uncompressed state corresponding to each of the blocks of the file on a basis of a result of the determination and recording in an uncompressed state consecutive blocks of the file from one of the blocks that is determined to be uncompressed to the last block of the file when determining that the one of the blocks of the file is to be uncompressed based on the result of the determination, creating a management information in association with data identification information for identifying the file, the management information including state information indicating a compressed or uncompressed state corresponding to each of the blocks, and storing the created management information in a memory, and performing a patrol processing after the write processing is completed, the patrol processing including: recalculating a compression ratio of each of the consecutive blocks recorded in the uncompressed state of the file based on the compression ratio calculated by the write processing, comparing the recalculated compression ratio of each of the consecutive blocks recorded in the uncompressed state of the file based on the compression ratio calculated by the write processing with the threshold, determining whether each of the consecutive blocks recorded in the uncompressed state of the file based on the compression ratio calculated by the write processing is to be compressed or not based on a result of the comparison of the patrol processing, and updating the management information including state information indicating a compressed or uncompressed state based on a result of the determination of the patrol processing.