METHOD FOR CONTROLLING DATA RECORDING ON MAGNETIC TAPE

Abstract: A method for controlling on magnetic tape the recording of data collected as a physical block comprising a plurality of packets is recorded. When an instruction for reading out the data corresponding to a packet in the physical block is issued from a host unit, the data of the whole of the physical block are read out from the magnetic tape, and stored in a buffer. When a write instruction and data to be recorded are outputted from the host unit at an arbitrary position in the physical block on the magnetic tape, one physical block is reorganized using the data stored in the buffer and the data to be recorded, and this data reorganized as the physical block is recorded on the magnetic tape.

Description: FIELD OF THE INVENTION The present invention relates to a data recording control method of a magnetic tape, and more particularly to a data recording control method applied to a magnetic tape system in which data recording is conducted according to an extended data recording method. BACKGROUND ART A magnetic tape subsystem is generally composed of: a magnetic tape apparatus including a magnetic tape, a tape head, and a tape loading mechanism; and a magnetic tape control apparatus. The magnetic tape control apparatus performs a control of a magnetic tape apparatus, which control is required when data are recorded on a magnetic tape (data write), or when data on a magnetic tape are read. A method called "an extended data recording method" has been proposed as a method of recording data on a magnetic tape. This "extended data recording method" was proposed by ANSI (American National Standard Institution) in 1989 as a method to increase storage capacity per a cartridge tape. The contents of the proposal by ANSI are contained in the following handbook. "X3B5 EXTENDED MAGNETIC TAPE FORMAT FOR INFORMATION INTERCHANGE 18-TRACK, PARALLEL, 12.65 MM (1/2 in), 1491 CPMM (37 871 cpi) Group-Coded Recording" A description will now be given of the "extended data recording method" described in this handbook, with reference to FIGS.1 and 2. In the "extended data recording method", data are recorded on a magnetic tape in accordance with an extended data format as shown in FIG.1. Referring to FIG.1, a data block recorded on a magnetic tape is composed of a plurality of packets and a count field. The data block has a data block ID and a pad positioned after it. The data block ID is composed of a sector number, an identification code, and a physical block ID. Each packet is composed of a packet header (PH), a data, and a packet trailer (PT), the details of the packet format being shown in FIG.2. Referring to FIG.2, the packet header PH is composed of a block ID, a packet offset, a packet trailer length, a flag, a reserve, and a CRC (error correcting code), the block ID being composed of an identification code, a sector number, and a logical record ID. The packet trailer PT provided in a non-compressed data packet and the packet trailer PT provided in a compressed data packet have different compositions. The packet trailer PT provided in the non-compressed data packet is composed of a trailer pad and a packet CRC, while the packet trailer PT provided in the compressed data packet is composed of a logical block length, a logical block CRC, a compressed data block CRC, a trailer pad, and a packet CRC. The packet header PH and the packet trailer PT of each packet are the information required when restoring data read from a magnetic tape to an original data, and are formed at the time of data recording so as to be added before and after the data respectively. In accordance with the above-mentioned extended data format, it is possible to decrease the number of IBG (inter-block gap) which have to be provided between data blocks, because a plurality of packets are combined into one physical block, and data are recorded on a magnetic tape in units of this physical block (data block). As a result of this decrease, the storage capacity per a magnetic tape can be increased. In order to record data on a magnetic tape in accordance with the above-described "extended data recording method", the magnetic tape control apparatus needs to be equipped with a function called autoblocking. This autoblocking is a kind of data compression technology. In response to a data read/write command given from a host computer for packet units, i.e., for logical block units, the magnetic tape control apparatus processes, by means of this autoblocking function, data in the above-mentioned physical block units. For example, when the magnetic tape control apparatus receives a write command WR and data from the host computer, data are recorded on a magnetic tape in the following manner. Data received from the host computer is compressed, and a packet is formed by adding the packet header PH and the packet trailer PT to the compressed data. A plurality of packets thus formed (P 1 , P 2 , P 3 , P 4 , P 5 ) are combined into one physical block. The data block ID, etc., are added to this one physical block, the result of the addition being written on the magnetic tape. The sequential recording on a magnetic tape is effected such that an IBG is provided for each physical block. When the magnetic tape control apparatus receives a read command from the host computer, data are read from the magnetic tape in physical block units, and original data are restored from the read data, using such information as the packet header PH and the packet trailer PT. As described before, a data format exchanged between the host computer and the magnetic tape control apparatus is not an extended data format. Also, the read/write command (RD, WR) from the host computer is issued to be executed on each packet of data, i.e., on each logical block unit. On the other hand, the magnetic tape control apparatus effects a read/write process for each physical block unit. Accordingly, in the case where the data having a physical block composed of five packets P 1 ∼ P 5 is recorded on the magnetic tape, as is shown in FIG.3, and a first read command RD is executed on the packet P 1 data, a second read command RD on the packet P 2 data, and a third read command RD on the packet P 3 data, in a sequential manner, the magnetic tape control apparatus reads (stores in a buffer) the physical block composed of the packets P 1 ∼ P 5 upon receipt of the first read command RD. Thereupon, in correspondence to the first, second, and third read commands, only the data in the packets P 1 , P 2 , and P 3 are fetched and restored to the original data. The restored data (read data) are then sent to the host computer. When a write command WR to be executed on the packet P 4 is issued from the host computer immediately after the third read command RD is executed, the magnetic tape control apparatus cannot execute this write command since the apparatus is not capable of processing a write operation in packet unit. Accordingly, a data recording control method is possible in which this write command, issued immediately after the execution of the read command, is made executable by reorganizing the data in the physical block to be processed. Such a control method is schematically shown in FIGS.4 and 5. As shown in FIG.4, when write commands 4 ○ ∼ 9 ○ are sequentially issued after read commands 1 ○ ∼ 3 ○ are executed on the data in the packets P 1 ∼ P 3 belonging to the physical block consisting of five packets P 1 ∼ P 5 , the following processes are effected. First, when the read command 1 ○ on the data in the packet P 1 is executed, the tape head reads, from the magnetic tape, all the data in the physical block consisting of the packets P 1 ∼ P 5 , and the read data are then stored in the buffer, as shown in FIG.5 1 ○ . The data in the packet P 1 is transferred from the buffer to the host computer, in correspondence to the read command RD 1 ○ . As shown in FIG.5 2 ○ and 3 ○ , when the read commands RD 2 ○ and 3 ○ are executed, the data in the packets P 2 and P 3 are transferred, in response to these commands, from the buffer to the host computer in a sequential manner. When a write command WR 4 ○ is output from the host computer, the tape head is positioned at the packet P 1 residing on the magnetic tape (4 ○ -1). Since the data in the packets P 1 ∼ P 3 need to be retained as they are on the magnetic tape, the data in the packets P 1 ∼ P 3 in the buffer are written unmodified on the magnetic tape via the tape head, as shown in FIG.5 4 ○ -2. A new data P 4N , output together with the write command WR 4 ○ from the host computer, is stored in the buffer as shown in FIG.5 4 ○ -3. Thereafter, when write commands WR 5 ○, 6 ○, 7 ○, and 8 ○ are sequentially output from the host computer, new write data P 5N , P 6N , P 7N , and P 8N , output together with these write commands from the host computer, are sequentially stored in the buffer (FIG.5 5 ○ ∼ 8 ○ -1). When the quantity of write data fulfills a predetermined condition (close condition), an IBG is provided after the data block consisting of the packets P 1 , P 2 , and P 3 , after which the data P 5N ∼ P 8N fulfilling that condition are written on the magnetic tape via the tape head (FIG.5 8 ○ -2). By performing the data block reorganization according to the above-described procedure, when the write command WR is executed immediately after the execution of the read command RD in one given physical block, data recording on the magnetic tape in accordance with an "extended data recording method" is achieved. However, when the write command WR is executed immediately after the execution of the read command RD, generation of one physical block consisting of the data (P 1 , P 2 , P 3 ) that have been read up to that point is compelled, thus causing the data length of the physical block thus generated to be smaller than a data length of a normal physical block. This has a disadvantage in that the number of IBGs tends to be substantially large, and data storage capacity per magnetic tape is reduced, if the read command RD and the write command WR are repeated. EP-A-0 324 542 discloses a data recording control method similar to that described above. In this method, a tape packet assembler/dissassembler is provided between a host computer and a tape driver, and assembles into "packets" (physical blocks) data from the host, for writing on the tape. DISCLOSURE OF THE INVENTION Accordingly, a general object of the present invention is to provide a novel and useful data recording control method of a magnetic tape, in which method the above-described disadvantages of the conventional art are eliminated. Another object of the present invention is to provide a data recording control method in which method data recording control using a so-called autoblocking function can be effected at any position in a given data block residing on the magnetic tape. Still another object of the present invention is to provide a data recording control method in which the number of IBGs that need to be recorded on a magnetic tape can be decreased and the storage capacity of the magnetic tape can be increased. The above objects can be achieved by a data recording control method of a magnetic tape in which tape data is constructed by combining a plurality of packets into a physical block, each packet corresponding to a data unit handled by a host unit issuing a read command and a write command applied to a magnetic tape, said method comprising steps of: (a) reading, from the magnetic tape, when a read command, for reading data, applied to a packet in the physical block, is output from the host unit, data in the entire physical block including the packet, and storing the same in a buffer; (b) reorganising the physical block using the data in the buffer and data to be recorded, when a write command for a packet which is not positioned at the head of the physical block in said buffer and the data to be recorded at any position in said physical block on the magnetic tape are output from the host unit; and (c) recording, on the magnetic tape, the data thus reorganised as the physical block. According to the present invention, a data recording control using a so-called autoblocking function can be effected at any position in a data block residing on the magnetic tape. Further, the data length of the physical block can be made larger than in the conventional art because the present invention allows for a physical block reorganisation using the data stored in the buffer that do not need to be rewritten and the new data that need to be recorded. Consequently, the number of IBGs that need to be recorded on the magnetic tape can be decreased, and the storage capacity per magnetic tape can be increased. BRIEF DESCRIPTION OF THE DRAWINGS FIG.1 illustrates an extended data format; FIG.2 illustrates a packet format; FIG.3 illustrates a conventional data recording control method; FIGS.4 and 5 illustrate another conventional data recording control method; FIG.6 illustrates a data recording control method according to the present invention; FIG.7 is a block diagram illustrating a schematic configuration of a magnetic tape control apparatus of the described embodiment of the present invention; FIG.8 is a block diagram illustrating another schematic configuration of the magnetic tape control apparatus of the described embodiment of the present invention; FIG.9 illustrates a data flow in the magnetic tape control apparatus shown in FIG.8; FIG.10 is a block diagram illustrating a detailed configuration of the magnetic tape control apparatus; FIG.11 is a flow chart showing how a read command is processed; FIGS.12 and 13 are flow charts showing how a write command is processed; FIGS.14 and 15 illustrate a data recording control method according to the described embodiment of the present invention; and FIG.16 is a block diagram illustrating still another schematic configuration of the magnetic tape control apparatus of the described embodiment of the present invention. BEST MODE OF CARRYING OUT THE INVENTION A description will now be given of the principle of an embodiment of the present invention with reference to FIG.6. Referring to FIG.6, data constructed by combining a plurality of packets P 1 ∼ P N into physical blocks, is recorded on a magnetic tape. Each of the packets P 1 ∼ P 3 corresponds to a logical block (a data unit exchanged between the host computer and the magnetic tape control apparatus). The host computer issues read/write commands (RD/WR) on the data corresponding to each of these packets. The magnetic tape control apparatus reads the data in the physical block including the packet P 1 , and the read data are stored in the buffer. The data in the packet P 1 is transferred from the buffer to the host computer. Subsequently, when the magnetic tape control apparatus receives the read commands RD on the packets P 1 , P 2 , and P 3 , the data in the packets P 1 , P 2 , and P 3 are sequentially fetched from the buffer and transferred to the host computer. Thereafter, when the magnetic tape control apparatus receives the write command WR issued from the host computer so as to renew the data in the packet P 4 , a back space operation (BSP) causes the tape head to be positioned at the head of the physical block. Then the data in the buffer, and the data issued from the host computer together with the write command WR, are used to reorganize the packet data in accordance with the "extended data format". The data thus reorganized are recorded via the tape head on the magnetic tape in physical block units. Such a procedure ensures that data recording on the magnetic tape according to the "extended data recording method" can be effected efficiently even when, in one given physical block, the read command is followed by the write command. A detailed description will now be given of an embodiment of the present invention. The magnetic tape control apparatus, for conducting data recording control in accordance with the data recording control method of the present invention, is configured as shown, for example, in FIG.7. Referring to FIG.7, a magnetic tape control apparatus (MTC) 2 is equipped with a host interface controller (HIC) 4, a buffer 5, and a formatter portion 6. The host interface controller 4, the buffer 5, and the formatter portion 6 are interconnected via an internal bus IB. The host interface controller 4 is connected to a host computer 1, and the formatter portion 6 is connected to a drive 3 for driving, for example, the magnetic tape and the tape head. The host interface controller 4 and the formatter portion 6 performs various processes in an asynchronous manner. Data are exchanged between the host interface controller 4 and the formatter portion 6 via the buffer 5. For example, the data processed in the host interface controller 4 is stored in the buffer 5, and the formatter portion 6 fetches the data stored in the buffer 5 and processes the same. An autoblocking function is realized by the host interface controller 4, the buffer 5, and the formatter portion 6, which are connected via the internal bus IB. As shown in FIG.8, it is possible to configure a close call system by using two magnetic tape control apparatuses. Referring to FIG.8, the system comprises two magnetic tape control apparatuses 2 (#0, #1), and two drives 3 (#0, #1). The respective internal buses IB in the magnetic tape control apparatuses 2 (#0, #1) are interconnected. The respective formatter portions 6 in the magnetic tape control apparatuses are respectively connected to the two drives 3. In the close call system as shown in FIG.8, data are transferred in each magnetic tape apparatus via a channel as shown in FIG.9. While FIG.9 shows a data flow relative to just one of the two buffers 5, a data flow relative to the other buffer 5 is the same as that of the former one. For example, both of the host interface controllers 4 (#0, #1) store the processed data in the buffer 5. Subsequently, the formatter portion 6 accesses the buffer 5, thereby fetching and processing the data stored in the buffer 5. Data transfer therein is effected via the internal bus IB, using an internal bus adapter IBA. One possible configuration of the above magnetic tape control apparatus will be described in detail with reference to FIG.10. Referring to FIG.10, the magnetic tape control apparatus is equipped with a host control portion 8, a drive control portion 9, and a multi-block buffer (MBB) 5A. The host control portion 8 is provided with a channel interface portion 10, a transfer control portion 11, a compression portion 12, and the host interface controller 4. The drive control portion 9 is provided with the formatter portion 6, a write formatter 14, and a read formatter 15. The above-mentioned channel interface portion 10 effects an interface control, for example, between the host control portion and a channel provided in the host computer. The transfer control portion 11 effects data transfer control. The compression portion 12 is equipped with a binary arithmetic coder BAC and a binary arithmetic decoder BAD, and processes a data compression. The host interface controller 4 (HIC) is equipped with the internal bus adapter IBA and a packet processor PP. The packet processor PP effects processes including those processes related to the packet header PH and the packet trailer PT, as well as a byte count of data blocks (DBLK BCNT). The multi-block buffer (MBB) 5A is equipped with a control information table CIT. This control information table CIT stores various items of control information required when the host control portion 8 and the drive control portion 9 conduct data transfer via the multi-block buffer 5A. The formatter portion 6 is equipped with the internal bus adapter IBA and the packet processor PP. This packet processor PP is equipped with a packet checker function PKT CKR for detecting a packet. The write formatter 14 converts a write data format into a format recordable on a magnetic tape. The read formatter 15 converts a format of a read data read from the magnetic tape into a format that can be handled in a system. The magnetic tape control apparatus of the above-described configuration effects autoblocking of data, and enables data recording control in accordance with the "extended data recording method". Upon receipt of the read command RD from the host computer, the above-described magnetic tape control apparatus conducts a process according to the flow chart shown in FIG.11. The host control portion 8 determines whether or not the data to be transferred to the host computer resides in the multi-block buffer 5A (step S 1 ). If the data to be transferred resides in the multi-block buffer 5A, the first packet of data in a logical sequence is transferred from the multi-block buffer 5A to the host interface controller (HIC) 4 via the internal bus adapter IBA (step S 2 ). Thereafter, the host interface controller (HIC) 4 and the packet processor PP check the parameters of the packet header PH and the packet trailer PT of the transferred data (step S 3 ). Then the packet processor PP deletes the packet header PH and the packet trailer PT from the data (step S 4 ). The data, from which the packet header PH and the packet trailer PT are deleted, is then transferred to the host computer via the transfer control portion 11 and the channel interface portion 10 (step S 5 ). In case it is determined in step S 1 that the multi-block buffer 5A does not contain any data to be transferred to the host computer, a determination is made as to whether or not the current logical block position (the position corresponding to the packet) is in the middle of the block (step S 6 ). When it is determined that the current logical block is positioned in the middle of the block, a back space (BSP) control for positioning the tape head at the head of the block is effected (step S 7 ). When the current logical block is not positioned in the middle of the block, this back space (BSP) control is not effected. Subsequently, one physical block of data consisting of one or a plurality of packets is read from the magnetic tape (step S 8 ). The formatter portion 6 checks the parameters of the packet header PH and the packet trailer PT of the read data (step S 9 ). Then the data is transferred from the formatter portion 6 to the multi-block buffer 5A via the internal bus adapter IBA, the data thus transferred being stored in the multi-block buffer 5A. Next, the data in the multi-block buffer 5A is transferred to the host computer in accordance with the processes from step S 2 to step S 5 . The above-described process conducted in response to the receipt of the read command RD is then completed. The magnetic tape control apparatus conducts process shown in FIGS.12 and 13 upon receipt of the write command WR from the host computer. The host control portion 8 determines whether or not the current logical block is positioned in the middle of the block (step S 41 ). When it is determined that the current logical block is not positioned in the middle of the block, the write data supplied from the host computer together with the write command WR is transferred to the host control portion 8 via the channel interface portion 10 and the transfer control portion 11 (step S 42 ). The compression portion 12 compresses the transferred data in accordance with a predetermined algorithm. Further, the host interface controller 4 adds the packet header PH and the packet trailer PT to the compressed data so as to form a packet (step S 43 ). The packet thus formed is transferred from the host controller 4 to the multi-block buffer 5A via the internal bus adapter IBA, and is stored therein (step S 44 ). A determination is then made as to whether or not the data series stored in the multi-block buffer 5A fulfills a block close condition (step S 45 ). This block close condition is represented as (P 11 ---- + P n ) + P MAX ≧ 65502 (bytes), for example. The block close condition is fulfilled when the result of an addition of the data lengths of all the packets P 1 ∼ P n in the multi-block buffer 5A to the maximum data length P MAX from among the packets P 1 ∼ P n exceeds 65502 bytes. That is, n packets P 1 ∼ P n constitute one physical block in this case. When it is found that the block close condition is fulfilled, the packet of data, in the multi-block buffer 5A, fulfilling this close condition is transferred to the formatter portion 6 via the internal bus adapter IBA (step S 46 ). Then the packet processor PP in the formatter portion 6 checks the parameters of the packet header and the packet trailer PT of the data transferred (step S 47 ). The write formatter 14 then writes, as one physical block, the packet of data fulfilling the above close condition on the magnetic tape (step S 48 ). In case it is determined in step S 41 that the current logical block is positioned in the middle of the block, the back space (BSP) control is effected for the purpose of positioning the tape head at the head of the block (step S 49 ). It is determined then whether or not the data, in the logical block preceding the position of the current logical block, resides in the multi-block buffer 5A (step S 50 ). If the data in the logical block preceding the position of the current logical block does not reside in the multi-block buffer 5A, one physical block of data consisting of one or a plurality of packets is read (step S 51 ). After the formatter portion 6 checks the parameters of the packet header PH and the packet trailer PT of the read data (step S 52 ), the data is transferred to the multi-block buffer 5A via the internal bus adapter IBA, and is stored therein (step S 53 ). Then the tape head is positioned at the head of the block (step S 54 ). When it is determined in step S 50 that the data in the logical block preceding the position of the current logical block resides in the multi-block buffer 5A, the data is recorded on the magnetic tape according to the processes from step S 42 to step S 48 . That is, the data residing in the multi-block buffer 5A (the data in the logical block preceding the position of the current logical block) and the data newly issued from the host computer are made to coexist in the multi-block buffer 5A, and the formatter portion 6 integrates these data so that one reorganized physical block is obtained. The data thus reorganized into one physical block is then written on the magnetic tape. A description will now be given of the process which is effected when, in one given block, the write command WR is issued from the host computer after the execution of the read command RD, with reference to FIGS.14 and 15. The read command RD and the write command WR are separately processed as described above. As shown in FIG.14, in a case in which the read commands RD 1 ○ ∼ 3 ○ are executed on the data in the packets P 1 ∼ P 3 belonging to the physical block consisting of five packets P 1 ∼ P 5 , and subsequently the write commands WR 4 ○ ∼ are sequentially executed, the following process is carried out. First, after the read command RD 1 ○ is executed on the data in the packet P 1 , the tape head reads all the data in the physical block consisting of the packets P 1 ∼ P 5 from the magnetic tape, and then the data are stored in the multi-block buffer 5A, as shown in FIG.15 1 ○ . In correspondence to the read command RD 1 ○ , the data in the packet P 1 is transferred from the multi-block buffer 5A to the host computer. In response to the read commands RD 2 ○ and 3 ○ issued from the host computer, the data in the packets P 2 and P 3 are transferred from the multi-block buffer 5A to the host computer, as shown in FIG.15 2 ○ and 3 ○ . When the write command WR 4 ○ is then output from the host computer, the tape head is positioned at the head of the physical block. Since all the data in the packets P 1 , P 2 , and P 3 , which packets precede the packet P 4 corresponding to the current logical block, are stored in the multi-block buffer 5A, the new data P 4N output together with the write command WR 4 ○ from the host computer is stored after the data in the packet P 3 in the multi-block buffer 5A, as shown in FIG.15 4 ○ . When the write command WR 5 ○ is output from the host computer, the new data P 5N issued together with this write command is stored in the multi-block buffer 5A, as shown in FIG.15 5 ○ -1. If the data series (P 1 , P 2 , P 3 , P 4N , P 5N ) stored in the multi-block buffer 5A fulfills the block close condition, the data are written on the magnetic tape as one physical block (FIG.15 5 ○ - 2 ○ ). Thereafter, as the write commands 6 ○ , 7 ○ , 8 ○ , 9 ○ , and are sequentially output from the host computer, new write data P 6N , P 7N , P 8N , P 9N , and P 10N which are output together with these write commands WR are sequentially stored in the multi-block buffer 5A (FIG.15 6 ○ ∼ -1). If these write data P 6N ∼ P 10N fulfill the block close condition, the IBG is provided after the data block consisting of the data P 1 , P 2 , P 3 , P 4N , and P 5N . After the IBG is provided, the data P 6N ∼ P 10N are written, as one physical block, on the magnetic tape via the tape head. It is possible to effect the above-described data recording control of the magnetic tape, by using a firmware. In this case, the magnetic tape control apparatus is configured as shown in FIG.16. Referring to FIG.16, the magnetic tape control apparatus is composed, in the same manner as the aforementioned magnetic tape control apparatus, of a host control portion functionally connected to the host computer 1, a drive control portion functionally connected to the drive 3, and the buffers 107 and 108. The host control portion is composed of a channel interface circuit 102, a packet generation/restoration circuit 103, an internal bus adapter (IBA) 104, a host MPU 105, and a host control firmware 106. The host control firmware 106 controls the entire host control portion. The drive control portion is composed of an internal bus adapter (IBA) 109, a packet check circuit 110, a drive interface circuit 111, a drive MPU 112, and a drive control firmware 113. The drive control firmware 113 controls the entire drive control portion. The buffer 107 stores the data storage information of the buffer 108. When the magnetic control apparatus receives the write command WR from the host computer 1, the magnetic tape control apparatus effects data recording control in accordance with the flow chart shown in FIGS.12 and 13. The steps in this flow will be described briefly below. In step S 41 , where it is determined whether or not the current logical block is positioned in the middle of the block, the following steps are effected. When the read command is being processed, the drive 3 reads all the data in one physical block. A count field (see FIG.1), located at the end of the physical block, stores a packet count indicating the number of packets residing in the physical block. The drive control firmware 113 stores this count when the data in one physical block is read. The host control firmware 106 reads the data requested by the host computer 1 from the buffer 108. Each time the data is read from the buffer 108 in packet units, the drive control firmware 113 decrements the packet count by one. When the magnetic tape control apparatus receives the write command WR under such a condition, the drive control firmware 113 checks the number of remaining packets. When the number of remaining packets is found to be "0", it is determined that the current logical block corresponds to the last packet; when it is found that the number of remaining packets is not "0", it is determined that the current logical block corresponds to the packet in the middle of one physical block. In step S 49 , in which the tape head is positioned at the head of the physical block, the drive control firmware 113 issues the back space (BPS) command via the drive interface circuit 111, and the drive 3 positions the tape head at the IBG immediately preceding the physical block in question. In step S 50 , in which it is determined whether or not the data preceding the current logical block resides in the buffer 108 (MBB), the following operations are effected. When the data is read in response to the read command, the data in the packet preceding the packet corresponding to this read command remains in the buffer 108. However, when the tape head is positioned at a predetermined position by means of a space (SP) or a locator command (LOC), no data resides in the buffer 108. That is, the drive control firmware 113 determines whether or not the desired data resides in the buffer 108 depending on what kind of command was issued immediately before the issuance of the write command WR. If in the above-mentioned step S 50 the answer is "YES", the process returns to step S 42 , and the normal operations are effected. On the other hand, if in step S 50 the answer is "NO", step S 51 allows the drive control firmware 113 to read one physical block of data from the drive 3, and the drive interface circuit 111 restores the data according to the format on the tape. Thereafter, step S 52 allows the drive control firmware 113 to control the packet check circuit 110 so that the contents of the packet header PH and the packet trailer PT are checked. Step S 53 allows the data to be stored in the buffer 108 via the internal bus adapter (IBA) 109. The information relative to this data storage is stored in the buffer 107. Then the process returns to step S 49 . As described above, use of the firmware enables the aforementioned autoblocking function to be achieved without increasing the size of hardware. POSSIBLE INDUSTRIAL APPLICATION The present invention can be applied to a magnetic tape subsystem in which an extended data recording method is employed.

Claims: A data recording control method of a magnetic tape in which tape data is constructed by combining a plurality of packets (P 1 ...P n )into a physical block, each packet corresponding to a data unit handled by a host unit (1) issuing a read command and a write command applied to a magnetic tape (3), said method comprising steps of: (a) reading, from the magnetic tape (3), when a read command (RD), for reading data, applied to a packet in the physical block, is output from the host unit (1), data in the entire physical block including the packet, and storing the same in a buffer (5); (b) reorganising the physical block using the data in the buffer (5) and data to be recorded, when a write command (WR) for a packet which is not positioned at the head of the physical block in said buffer and the data to be recorded at any position in said physical block on the magnetic tape are output from the host unit (1); and (c) recording, on the magnetic tape (3), the data thus reorganised as the physical block. The data recording control method of a magnetic tape as claimed in Claim 1, wherein said step (b) comprises a step of reorganising, into the physical block: the packet data (e.g. P 1 -P 3 ) preceding the position in said physical block at which position the write command (WR) is issued from the host unit (1); and the data (e.g. P 4 ) to be recorded. The data recording control method of a magnetic tape as claimed in Claim 1, wherein said step (c) comprises a step of recording the reorganised data starting from the head of the physical block from which block the data is read in step (a). The data recording control method of a magnetic tape as claimed in Claim 3, wherein said step (c) further comprises a step of positioning, when a write command (WR) is issued from the host unit (1), the recording/reproducing head at the head of the physical block from which block the data is read in step (a). The data recording control method of a magnetic tape as claimed in Claim 1, wherein, in said step (a), data are stored in the buffer (5) in packet units. The data recording control method of a magnetic tape as claimed in Claim 1, wherein said step (b) comprises steps of: determining whether or not the data to be reorganised fulfills a predetermined close condition; and designating said data as one physical block when it is determined in said step that the close condition is fulfilled. The data recording control method of a magnetic tape as claimed in Claim 5, wherein, in step (c), the data to be recorded is stored in the buffer (5) in packet units, and data reorganisation is effected in the said buffer (5).

Inventors: HIYAMIZU KAZUFUMI, TAKAI NOBUYUKI, HIYAMIZU, KAZUFUMI, TAKAI, NOBUYUKI, HIYAMIZU, KAZUFUMI, FUJITSU LIMITED
Applicants: FUJITSU LTD, FUJITSU LIMITED
Application year: 1992
Main classification: G06F3
IPC codes: G06F3, G11B20