Data transfer control method and apparatus for external storage subsystem

Abstract: In control method and apparatus for data transfer in an external storage subsystem, a disk unit (13) and a control unit (12) interposed between a host channel (11) and a processing unit (10) are provided and data in a variable record length supplied from the host is converted to data in a fixed record length to write it in the disk unit (13). Final format writing end position information for a logical track and an erase flag indicating whether the erasing is required or not are stored at a portion of a logical track control table which controls a cache memory (126), for each logical track. In the format writing on the cache memory, the final format writing end position information and the erase flag are updated, and when the data is written into the disk unit (13) from the cache memory (126) by logical track unit, the erase flag is referred and the erasing is performed if it is required. Thus, the area of erasing and the number of times of execution are minimized and the throughput of the data transfer between the processing unit and the rotating storage device is improved.

Description: BACKGROUND OF THE INVENTION FIELD OF THE INVENTION The present invention relates to control technique and control apparatus for an external storage subsystem, and more particularly to data transfer method and apparatus for an external storage subsystem which is suitable for converting data in a variable record length format to data in a fixed record length format for storage in a rotating storage device. The term rotating storage device refers to a storage device which writes and reads information to and from a storage medium (e.g. floppy disk, hard disk or CD-ROM) having recording tracks spirally formed thereon. In general, a disk storage device for recording data in the variable record length format needs format writing to write control information on a track of a disk when new data is to be written on the track having data previously written thereon. The term format writing is referred to writing or updating count field information of information, key and data on CKD (count key data) format. After the format writing, erasing to erase previously written data (up to the end of the track) is conducted by a command from a control unit. In the erasing, erase data (having a value 0) is actually written onto the track. In this manner, the previously written data is invalidated so that the disk unit and the control unit may recognize, by reading the erase data, that there is no valid data in the track area after the format writing. On the other hand, if the erase data is not written, the previously written control information, that is, the count field information remains and the data corresponding to the remaining count field information may be erroneously recognized as valid data. The above data is divided into record units (records) on the track and each record is assigned with a serial number. When data is to be written into the disk unit through a cache memory, the data writing procedure is same as that described above. In the prior art, the erasing after the format writing is conducted immediately after the format writing. Thus, when the format writing is to be conducted to record a new record on a track for which the erasing has once been conducted after the format writing, the erasing is conducted again immediately after the format writing for the previously erased area. Thus, the erasing is conducted continuously for the same area of the same track and the second erasing is wasteful and the process time is wasted. An approach to solve this problem is disclosed in JP-A-61-241824, corresponding to US-4,814,904. In this prior art, a table for recording information on the erasing after the format writing for each track of the disk unit is provided in a memory in the disk unit and the table is dynamically referred in the format writing to the track to determine whether the erasing has already been conducted for that track. When it is determined that the erasing has already been conducted, only the format writing is conducted and the erasing is not conducted. On the other hand, if it is determined that the erasing has not been conducted, the erasing is conducted after the format writing. In this manner, unnecessary erasing of the erasing which was conducted at every end of the format writing in the past is eliminated and efficient format writing is attained. As an improvement over the technology of JP-A-61-241824, a technology disclosed in JP-A-2-79266 is known. In JP-A-2-79266, a non-volatile memory for storing location information indicating a valid record area of a record for an individual track in the disk unit is provided, and after the format writing to initialize the track, the area for which the format writing has not been conducted is removed from the valid area and only the valid record area of the record of the track is stored in the memory. In this manner, the erasing to invalidate the remaining area of the track other than the valid record area of the track is made unnecessary. Namely, by referring the location information indicating the valid record area in the memory, it may be determined that there is no valid data in the track area after the format writing so that the erasing after the format writing is not necessary. Accordingly, it is not necessary for the disk unit or the control unit to recognize the valid data area based on the erase data recorded on the track. The prior art references (1) and (2) mentioned above may eliminate unnecessary erasing. It is known from e.g. EP-A-0 559 142 to build a storage system from magnetic discs storing data of fixed length format and to provide a converter so that the system can be accessed from a host computer in a variable record length format such as CKD. However, assume that a control unit of the previously discussed references is connected to a commercially available disk unit (for example, a commercially available SCSI disk drive unit). The SCSI disk drive unit records data in the fixed record length format. On the other hand, the processing unit transfers data in the variable record length format. Accordingly, when the processing unit is connected to a plurality of disk units (for example, a plurality of SCSI disk drive units) and a system (disk array system) for storing a logical track in the same logical drive which the processing unit may recognize is distributedly stored in a plurality of disk units which record data in the fixed record length format is adopted, it is not possible to provide the control table for storing the location information of the references (1) and (2) in the memory in the disk unit. This is because the logical drive and the logical track recognized by the processing unit which transfers the data in the variable record length format and the physical track in the disk unit (physical drive) which record data in the fixed record length format are not the same. If the control table for storing the location information is to be absolutely provided in the disk unit, an area for storing the location information may be provided on the medium in the disk unit. In this case, before accessing each data area, the location information on the medium has to be first referred to to recognize whether it is in the valid data area and then only the data in the valid area may be accessed. However, in such a series of processes, it is necessary to refer to the location information on the track medium in order to access the target data in the data area. Namely, in order to access the target data area, the positioning of a head onto the medium (disk) is needed twice. Considering the rotation of the disk, the two head positionings result in the increase of the rotation waiting time, which raises a serious performance problem. As a result, the approach to provide the control table for storing the location information in the disk unit has to be avoided. When the control table is provided in the control unit rather than in the disk unit, the control information of all of the logical tracks storable in all disk units connected to the control unit is to be stored in the table. However, the control information of all logical tracks is very large in volume and the capacity of the control table increases and a semiconductor memory for the control table for storing the control information in the control unit needs to be expanded. For those reasons, if the control table for storing the location information for each track cannot be provided in the disk unit or the control unit, it is not possible to implement the teaching of JP-A-2-79266 to eliminate the erasing for invalidating the remaining area of the track. If it is the case, it is necessary for the disk unit and the control unit to recognize that there is no valid data in the track area after the format writing based on the erase data as it was in the prior art. Namely, after the format writing, the erasing of the track in the disk unit is required at least once. In this case, the smaller the area invalidated in one erasing, the less the transfer of the wasteful erase data and the higher is the efficiency. JP-A-6-180 671 discloses a storage controller which interfaces a variable length record format (CKD) on a host computer side with a fixed block format (SCSI) on a disc side of the controller. Conversion between the two formats is achieved by organisation of a cache memory so as to map each CKD track to a number of blocks within SCSI discs. When data is written from the host computer to the cache memory by a format write command, the controller automatically erases CKD records after the last written CKD record in a CKD track in the cache memory. All blocks having thus been updated are then transferred from the cache memory to the disc drives in a destaging operation. This technique does not solve the above-mentioned problem of avoiding unnecessary writes of erase data to the discs. It is therefore an object of the invention to provide a storage subsystem, and a method and an apparatus for controlling the storage subsystem which solve the problems encountered in the prior art. This object is solved by the method of claim 1, the apparatus of claim 7 and the storage subsystem of claim 12. The dependent claims are directed to preferred embodiments of the invention. An embodiment of the present invention provides a control method and apparatus for the external storage subsystem which can improve throughput of data transfer between a processing unit and a rotating storage device by minimizing an area of erasing and the number of times of execution. Another embodiment of the present invention provides a control method and apparatus for the external storage subsystem which can improve the throughput of the data transfer between the processing unit and the rotating storage device by minimizing the area of erasing and the number of times of execution without sacrificing the reliability of data and operation. A further embodiment of the present invention provides a control method and apparatus for the external storage subsystem which can improve the throughput of the data transfer between the processing unit and the rotating storage device by minimizing the area of erasing and the number of times of execution with less resources. In the embodiments, in order to achieve the above objects, (1) control information on only the data accompanied with the format writing (format writing data) written on a logical track on a cache memory into a memory (control table) of a control unit and an end position of the format writing data in the logical track on the cache memory is stored as the control information, and (2) when data is read from the cache memory and written into the rotating storage device (disk unit), the erasing is selectively conducted based on the control information. Thus, in accordance with the feature (1), since the control information on only the format writing data written on the logical track on the cache memory is stored in the control table of the control unit, the capacity of the control table maybe small. .In accordance with the features (1) and (2), when the data is read from the cache memory and written into the rotating storage device (disk unit), whether the erasing is required or not is determined based on the control information, and the erasing is conducted only when it is required (when the end position of the format writing data in the logical track on the cache memory is different from the end of the logical track). Thus, the number of times of execution of the erasing is suppressed to a minimum required. Preferably, each time new write data is written into the logical track on the cache memory, the end position of the write data in the logical track is compared with the end position of the logical track, and if the end positions are different, a flag indicating that the erasing is necessary is set in the control table in the control unit and when the data is read from the logical track of the cache memory and written into the rotating storage device (disk unit), the flag corresponding to the logical track is referred to determine whether the erasing is necessary or not, and if the erasing is necessary, the erasing is conducted. According to an embodiment of the present invention, there is provided a method for controlling data transfer in an external storage subsystem comprising a rotating storage device and a control unit provided between said rotating storage device and a host processing unit, said control unit including a cache memory for temporarily holding data transmitted and received between said processing unit and said rotating storage device, said cache memory having a memory area in a form of a plurality of logical tracks corresponding to logical tracks of said rotating storage device, said method comprising the steps of a) writing write data transferred from said processing unit and to be transferred to said rotating storage device to one logical track of said logical tracks of said cache memory corresponding to the write data; b) for each of the logical tracks of the cache memory having the write data written thereon, storing an end position of valid write data in the logical track to a control memory in said control unit; c) in reading the write data from one of the logical tracks of said cache memory, referring the end position of the valid write data in one of the logical tracks in said control memory, reading the data from the top position to the end position of the valid write data in one of the logical tracks and transferring the data to said rotating storage device; and d) transferring specified data of the volume equal to the data from the position immediately after the end position of the valid write data to the end position in one of the logical tracks read in said step c) to said rotating storage device as erase data to perform the erasing. Preferably, the method for controlling data transfer further comprises the steps of e) for each of the logical tracks of said cache memory having the write data written thereon, setting a flag indicating whether the erasing of said step d) is required or not in transferring the write data read from each of said logical tracks to said rotating storage device in said control memory based on the end position of the valid write data in each logical track and the end position in each logical track; and f) in reading the write data from one of the logical tracks of said cache memory, referring the flag of said control memory corresponding to the one logical track of said cache memory and performing said step d) when the referred flag indicates that the erasing of said step d) is required. Preferably, in the method for controlling data transfer, said step e) sets a flag indicating that the erasing is required or not required in reading the write data in each of the logical tracks when the end position of the valid write data in each logical track and the end position of each logical track match or mismatch, respectively. Preferably, the method for controlling data transfer further comprises a step of when an access request requesting updating or reading of data for the data of one of logical tracks of said cache memory is issued from said processing unit to said cache memory, granting the access request only when the position of the data to be accessed in the one logical track designated by the access request is located toward the top of the one logical track relative to the end position of the valid write data in the one logical track of said cache memory. In accordance with one embodiment of the present invention, the final format writing end position information and the flag indicating whether the erasing is necessary or not are stored in the control table for controlling the logical track on the cache memory in the control unit and when the logical track is read from the cache memory and written into the disk unit, the final format writing end position information and the flag indicating whether the erasing is necessary or not are referred to determine the erasing is to be conducted for the area immediately following to the final format writing end position in the logical track, and the erasing is conducted only when it is necessary. When an access request such as the updating of the write data or the reading of the data which does not need the format writing is issued from a host processor to the data in the logical track on the cache memory, the position information in the logical track designated by the access request is compared with the final format writing end position information stored in the control table of the control unit. Depending on the comparison, the grant/non-grant of the access request, that is, the valid data area in the logical track is determined. The control table is of minimum required capacity corresponding to the number of logical tracks which are in the on the cache memory and are ready to be written into the disk unit and may be developed into a portion of a semiconductor memory which forms the cache memory or a portion of a semiconductor memory which is independent from the cache memory. When the data of the logical track is to be written on the cache memory, the logical track may comprise a plurality of control units (blocks) on the cache memory. When new or additional writing to the logical track which requires the updating of the write data or the format writing other than the data reading is made, the block number of the block having the format writing end position sequentially assigned from the top of the logical track is stored in the control table as the final format writing end position information. Thus, the net or valid data area in the logical track may be identified. When the block number as the final format writing end position information is different from the last vacant block number of the logical track, that is, when an unused block is present following the current final format writing end position, a flag indicating that the erasing is required is set. Accordingly, the erasing to discriminate the invalid area in the logical track is not necessary until the logical track on the cache memory is written into the disk unit, and when the additional or new writing which accompanies the format writing on the cache memory takes place, only the block number as the final format writing end position information and the flag status need be updated. When the logical track on the cache memory is written into the disk unit, the flag is referred to and only when the erasing is required (when the entire logical track is not filled with the valid data), the erasing is conducted for the invalid area. Accordingly, the erasing is conducted only when the logical track is written into the disk unit and the invalid data area is present in the logical track and the area of the erasing and the number of times of the erasing are suppressed to the minimum required. For the access request such as the updating or reading of the existing data in the logical track which does not accompany with the format writing, the access request is granted only when the position information (block number) in the logical track designated by the access request is smaller than the block number as the final format writing end position information so that the erroneous reading of the invalid data on the rear side of the logical track or the handling as the data to be updated and written is prevented. BRIEF DESCRIPTION OF THE DRAWINGS Fig. 1 shows a block diagram of a configuration of a data processing system in accordance with an embodiment of the control method and apparatus for the data transfer of the external storage subsystem of the present invention, Fig. 2 shows a format of a control information table in the control unit shown in Fig. 1, Figs. 3A and 3B show relations between variable length data and fixed length data, Figs. 4A and 4B show storage format of data on the cache memory in the control unit shown in Fig. 1, Fig. 5 shows a flow chart to illustrate a format writing process to the cache memory in the embodiment of the control method for the data transfer of the external storage subsystem of the present invention, Fig. 6 shows a flow chart to illustrate an erase process in the embodiment of the control method for the data transfer of the external storage subsystem of the present invention, and Fig. 7 shows a flow chart to illustrate an access request process in the embodiment of the control method for the data transfer of the external storage subsystem of the present invention. DESCRIPTION OF THE PREFERRED EMBODIMENTS The preferred embodiments of the present invention are now explained in detail with reference to the accompanying drawings. Fig. 1 shows a block diagram of a configuration of a data processing system to which control method and apparatus for the external storage subsystem in accordance with one embodiment of the present invention are applied, Fig. 2 shows a conceptual view of a format of a control information table in the control unit shown in Fig. 1 and Figs. 4A and 4B show conceptual views of data storage format on a cache memory in the control unit shown in Fig. 1. Figs. 5, 6 and 7 shoe flow charts of the control method for the external storage subsystem in accordance with the present embodiment. The data processing system shown in Fig. 1 comprises a processing unit 10 for performing operations for information, a channel 11 for performing input/output control such as data transfer, a plurality of disk units (disk array) 13 and a control unit 12 interposed between the disk unit 13 and the channel 11 for controlling the exchange of data and commands. It records data in the disk unit 13 through the channel 11 and the control unit 12 and reproduces data from the disk unit 13 by a command from the processing unit 10. Portions excluding the processing unit in Fig. 1 constitute the external storage subsystem. In the embodiment shown in Fig. 1, the subsystem is directly connected to one processing unit although a similar method my be applied when it is connected to a plurality of processing units. The data to be recorded and reproduced is recorded by logical track unit when it is recorded to the disk unit 13. The logical track does not always directly correspond a physical track of the disk unit 13. The data is divided into record units called records on the logical track and information indicating a position of its own record on the logical track (hereinafter referred to as a segment number) and a record length are written in a control information field or CKD format count field at the top of each record. The segment number is assigned sequentially from the top of the track to the fractions of logical track. The control unit 12 of the present embodiment comprises a data transfer unit A 124 for inputting to the control unit 12 and outputting to a host unit the write data transferred from the host unit (or the processing unit) and the read data to be transferred to the host unit, a control unit A 121 for controlling the data transfer between the host unit and the cache memory 126 through the data transfer unit A 124, a data transfer unit B 125 for inputting to a cache memory 126 and outputting to the disk unit 13 the write data transferred from the cache memory 126 to the disk unit 13 and the read data transferred from the disk unit 13 to the cache memory 126, a control unit B 122 for controlling the data transfer between the cache memory 126 and the disk unit 13 through the data transfer unit B 125, and a control information memory 123. The control information memory 123 has a logical track control table 127 for storing, by logical track unit, the control information for controlling the write data and the read data such as the position on the cache memory 126 at which the control unit A 121 writes the write data, the position on the cache memory 126 at which the control unit B 122 reads the read data and the number of the disk unit corresponding to the read data, as well as other control information stored therein. When the format writing is instructed from the host unit, that is, when a command to update the control field is issued, the control unit A 121 determines the erase area and the data processing unit A 124 erases that area so that the data transfer to the cache memory 126 is ready. On the other hand, when the data is transferred from the cache memory 126 to the disk unit 13 without erasing on the data transfer unit A 124, the control unit B 122 determined the erase area and the data transfer unit B 125 erases that area so that the data transfer to the disk unit 13 is ready. In the control unit 12 of the present embodiment, as shown in Fig. 2, an area 20 is provided in the logical track control table 127 to store an erase flag 21 indicating whether the erasing is required or not after the completion of the format writing for each logical track and position information 22 indicating the final format writing end block in each logical track. For the final format writing end position information 22, a value calculated based on the segment number of the record for the final format writing and the record length thereof is converted to a block number of a plurality of block numbers which constitutes the logical track on the cache memory and it is stored. The correspondence between the variable length data shown in Fig. 3A and the fixed length data (corresponding to the logical track) shown in Fig. 3B when the former is converted to the latter is now explained. From the segment number of the control information of the variable length data (Ren), the position Pa (Fig. 3B) of the record on the logical track is determined. Assuming that the data (record) length is determined to be DLe from the record length of the control information, the data length DLe is divided by the length L 8 of one block (fixed length record) of the fixed length data to obtain the number of blocks (offset) of the fixed length data corresponding to the variable length data. Accordingly, by adding the end position of the previous variable length data (Ren-1) in the fixed length data shown in Fig. 3B, that is, the number of blocks DLe/L 8 derived for the head position (block number) of the current variable length data Ren, the writing end position (block number x) Pb of the variable length data Ren is obtained. When the variable length data Ren is the write data corresponding to the finial format writing command, the derived block number Pb represents the final writing end block. Accordingly, the block number x is stored as the final format writing end position information of the control table 127 of the corresponding logical track number. Accordingly, blocks y∼e are erase area. The fixed length data block i represents the data transfer start block number of the final format writing record. Fig. 4A shows an example of data record format on the cache memory in the present embodiment. The cache memory 126 is controlled by dividing it into a plurality of logical tracks and each track n comprises a plurality of blocks 30. Each track is assigned with a track number in an ascending order from the top as shown in Fig. 4B. The blocks 30 (blocks y∼e) immediately after the final format writing end block (the block x in the present example) in the logical track are contained in the erase area 31. The control unit A 121 compares the final format writing end position information 22 of the logical track with the final block numbers in the blocks of the logical track on the cache memory and if they do not match, the erase flag 21 is set to "1". The operations of the units in the erasing process after the format writing are now explained. When a format writing command is issued from the processing unit 10 and the write data is transferred to the control unit 12 through the channel 11, the control unit A 121 in the control unit 12 recognizes the logical track number from the control information at the top of the record to determine whether the corresponding logical track control table 127 is present or not. If the corresponding logical track control table 127 is not present, a new logical track control table 127 is prepared and a plurality of blocks on the cache memory 126 which can store the entire logical track including the write data are secured. The control unit A 121 calculates the data transfer start block number from the segment number of the record which is the subject of the format writing. On the other hand, if the corresponding logical track format table 127 is present, the blocks on the cache memory are not secured and the data transfer start block number is immediately calculated. Then, the control unit A 121 commands to the data transfer unit so that the data transfer unit A 124 inputs the write data from the channel 11 and then sequentially transfers the input write data from the position of the calculated data transfer start block number. If the next format writing command is chained to the above format writing command, the control unit A 121 calculates the data transfer start block number from the segment of the record which is the subject of the next format writing and sequentially transfers the data to the cache memory 126 from the position of the block number. When a plurality of format writing commands are serially chained, the same process is repeated. When the format writing command of the channel 11 terminates, the control unit A 121 calculates the offset of the block number from the record length of the record which is the subject of the final format writing, adds it to the data transfer start block number of the record which is the subject of the final format writing and stores it as the final format writing end position information (block number) 22. The control unit A 121 compares the final format writing end position information (block number) 22 of the logical track for which the format writing has been performed with the final block number (end block number of the logical block) of the blocks forming the corresponding logical track on the cache memory, and if they do not match, the erase flag 21 is set to "1". The operation when the control unit A 121 or B 122 attempts to write the data of a logical track from the cache memory 126 to the disk unit 13 is now explained. The control unit B 122 first determines whether the data of the logical track requires the erasing after the format writing or not by referring the erase flag 21 in the logical track control table 127 corresponding to the logical track. If the erase flag 21 is on, the control unit A 121 or B 122 refers the final format writing end position information 22 in the corresponding logical track control table 127 and transfers the data from the top position of the logical track to the final format writing end position (i.e. the data in the valid area) from the cache memory 126 to the disk unit 13, and the control unit B 122 sets the erase data (for example, NULL data) on the data transfer unit B 125 and transfers the erase data of the volume from the block immediately after the position indicated by the final format writing end position information 22 derived by referring the table 127 to the final block, to the disk unit 13. Instead of the above method, the erasing may be performed in the following manner. Namely, the control unit B 122 sets the erase data on the data transfer unit B 122 and transfers the data from the block immediately after the position indicated by the final format writing end position information 22 to the final block number and writes the data from the block immediately after the final format writing end position of the corresponding logical track to the end block. Then, the data of the logical track from the cache memory 126 from the top of the track to the end block is transferred to the disk unit 13 through the data transfer unit B 125 to perform the erasing. In this manner, the control unit 122 prepares the erase data asynchronously with the data transfer from the cache memory 126 to the disk unit 13 and transfers it to the cache memory 126, and then the data is transferred from t he cache memory 126 to the disk unit 13. Figs. 5 and 6 show flow charts of the above operations. In Fig. 5, when a command is issued from the processing unit 10, the control unit 121 includes a step 400 for determining whether the command is the format writing command or not, a step 401 for recognizing, if the decision in the step 400 is YES, the logical track number from the control information at the top of the record by the control unit A121 of the control unit 12 and a step 402 for determining whether the logical track control table corresponding to the logical track number is present or not. It further includes a step 403 for preparing, when the decision in the step 402 is NO, the logical track control table, a step 404 for securing blocks on the cache memory for writing the data, a step 405 for calculating the transfer start block number on the cache memory 126 at which the write data transfer is started from the segment number of the record which is the write data, a step 406 for inputting the write data from the processing unit 10 to the data transfer unit A 124 and a step 407 for transferring the write data inputted to the data transfer unit A 124 to the cache memory 126 and writing it from the starting transfer start block determined in the step 405. It further includes a step 408 for determining whether the next instruction from the processing unit 10 is the format writing command or not, a step 409 for storing, when the decision in the step 408 is NO, the final format writing end position information 22, a step 410 for comparing the final format writing end position information 22 stored in the step 409 with the end block number in the logical track of the blocks 30 forming the logical track on the cache memory, a step 411 for setting the erase flag to "1" when the decision in the step 410 is mismatch and a step 412 for setting the erase flag to "0" when the decision in the step 410 is match. The method for determining whether the format writing command is the final format writing command or not is described below. In the step 407 of Fig. 5, the control unit 121 transfers the data to the cache memory 126 and then informs the completion of the data transfer to the processing unit 10. Then, of the next command sent from the processing unit 10 is not the format writing command, it is determined that the previous (in the step 400) format writing command from the processing unit 10 is the final format writing command and the final format writing end position is stored in the control table 127 in the step 409. Fig. 6 comprises a step 50 for determining whether the control unit A 121 or B 122 commands by itself to write data of a logical track from the cache memory 126 to the disk unit 13 or not, a step 51 for referring, when the decision in the step 50 is YES, the logical track control table of the logical track to be written into the disk unit 13, a step 52 for determining whether the erase flag referred in the step 51 is on or not, a step 53 for transferring, when the decision in the step 52 is YES (flag is on), the data from the top position of the logical track to the final format writing end position referred in the step 51, to the disk unit 13, a step 54 for setting the erase data on the data transfer unit B 125 and a step 55 for transferring the data from the block immediately after the final format writing end position information 22 referred in the step 51 to the end block, to the disk unit 13. Fig. 5 is for the processing by the processing unit A 121 and Fig. 6 is for the processing by the processing unit B 122. When the step 52 determines that the erase flag is off, the normal data processing is performed. Namely, the data from the top position of the logical track to the end position is transferred from the cache memory to the disk unit. The operation of the units when the reading and the writing of only the data in the valid area are permitted is now explained. When an access request such as a read request for data in a logical track or a write request without accompanying the format writing is issued from the processing unit 10 to the control unit, the control unit A 121 recognizes the logical track number from the access information from the processing unit 10 and determines whether the logical track control table 127 corresponding to the logical track is present in the control information memory 123 or not. If it is not present, it does not correspond to the operation of the present embodiment and the explanation thereof is omitted. When the logical track control table 127 of the logical track is present, the erase flag 21 on the logical track control table 127 is referred, and if the flag is on, the final format writing end position information 22 on the logical track control table 127 is referred. The reverse conversion of the final format writing end position information 22 into the segment number is compared with the segment number of the access field which is determined based on the access information from the processing unit 10. If the segment number of the access field is smaller than the segment number representing the final format writing end position, that is, if the access field is present before the final format writing end position (toward the top of the logical track), the presence of the record is reported and the access is granted. Otherwise, the absence of the record to be accessed is reported to the processing unit 10 and the access of the block in the area indicated by the segment number to be accessed designated by the access information is not granted. This is shown in a flow chart of Fig. 7. Fig. 7 comprises a step 60 for recognizing the logical track number for the access from the access information from the processing unit 10, a step 61 for determining whether the logical track control table 127 corresponding to the logical track recognized in the step 60 is present or not, a step 62 for determining, when the decision in the step 61 is YES, whether the erase flag 21 is on or not, a step 63 for determining, when the decision in the step 62 is YES, whether the final format writing end position is after the position of the record to be accessed by the access information from the processing unit 10 or not, a step 64 for reporting, when the decision in the step 63 is YES, the presence of the record to be accessed to the processing unit 10 and granting the access request and a step 65 for reporting, when the decision in the step 63 is NO, the absence of the record to be accessed to the processing unit and not granting the access request. In accordance with the present embodiment, the erase flag 21 and the final format writing end position information 22 are provided for each logical track in the logical track control table 127 which is set by the logical track unit of the cache memory 126, and for the writing or addition of the new record which accompanies with the format writing to the logical track, only the updating of the final format writing end position information 22 indicating the valid area of the data in the logical track and the erase flag 21 indicating the need for the erasing are needed and the erasing is not performed. When the writing is made from the cache memory 126 to the disk unit 13 by the logical track unit, the erase flag 21 corresponding to the logical track is referred and the erasing is performed only when it is needed. Accordingly, when the disk unit 12 which records the data in the fixed record length format is connected to the control unit 12 in the system including the processing unit 10 which handles the data of the variable record length format, the erasing area and the number of times of execution can be minimized. For the access request such as the updating or reading of the existing record on the logical track which does not accompany with the format writing, the segment number designated by the access request is compared with the final format writing end position information 22 and the access to the invalid area from the position indicated by the final format writing end position information 22 in the logical track to the track end is rejected so that the erroneous operation of reading the data which is to be erased or handling it as the data to be overwritten is prevented. Since the number of logical track control tables 127 is at most as many as the number of logical tracks present in the cache memory 126, the capacity of the control information memory 123 in which the logical track control table 127 is set may be saved compared to when the information for controlling the erasing for the track of the disk unit 13 is provided as it is in the prior art. While the preferred embodiment of the present invention has been described specifically, it should be understood that the present invention is not limited to the above embodiment and various modifications thereof may be made without departing from the spirit of the invention. For example, in the present invention, the position information in the logical track handled in the control unit is not limited to the segment number and the block number shown in the embodiment but the data length per se may be used. - In accordance with the control method and apparatus for the external storage subsystem of the present embodiment, the area of the erasing and the number of times of execution are minimized and the throughput of the data transfer between the processing unit and the rotating storage device is improved. In particular, the area of the erasing and the number of times of execution are minimized without sacrificing the reliability of data. Further, the area of the erasing and the number of times of execution are minimized with less resources.

Claims: A method for controlling data transfer in a storage subsystem which comprises a rotating storage device (13) and a control unit (12) provided between said rotating storage device and a host processing unit (10) and including a cache memory (126) for temporarily holding data transferred between the processing unit and the rotating storage device, the cache memory having a memory area organised in the form of logical tracks corresponding to logical tracks of the rotating storage device, the method comprising the following steps performed by the control unit: a) writing write data from said processing unit to one of the logical tracks of the cache memory (407 in Fig. 5), b) for each of the logical tracks of the cache memory having data written therein by format writing, storing an end position of valid write data into a control memory (127) of the control unit (409 in Fig. 5), c) in reading the write data from one of the logical tracks of the cache memory, referring to the stored end position of the valid write data of said one logical track, reading the valid write data from its top to its end positions from said one logical track and transferring it to said rotating storage device (53 in Fig. 6), and d) selectively transferring to said rotating storage device erase data of a volume equal to the data volume from the position immediately after the stored end position of the valid write data read out of said one logical track of the cache memory in step c) up to the end position of said one logical track, to erase the logical track on the rotating storage device selectively based on information in the control memory (55 in Fig. 6). A method for controlling data transfer according to Claim 1 further comprising the step of: e) for each of the logical tracks of said cache memory having write data written thereon, setting in said control memory a flag indicating whether the erasing of step d) is required in transferring the write data to said rotating storage device, based on the end position of the valid write data and the end position in the logical track (410∼ 412 in Fig. 5); and f) in reading the write data from one of the logical tracks of said cache memory, referring to the flag of said control memory corresponding to the one logical track of said cache memory and performing step d) when the referred flag indicates that the erasing of step d) is required (51∼55 in Fig. 6). A method for controlling data transfer according to Claim 2 wherein step e) sets a flag indicating that the erasing is required or is not required in reading the write data, when the end position of the valid write data and the end position of each logical track match or mismatch, respectively. A method for controlling data transfer according to Claim 1 further comprising a step of: when an access request for updating or reading of data for one of the logical tracks of said cache memory is issued from said processing unit to said cache memory, granting the access request only when the position of the data to be accessed in the one logical track designated by the access request is located toward the top of the one logical track relative to the end position of the valid write data in the one logical track of said cache memory (63∼65 in Fig. 7). A method for controlling data transfer according to Claim 2 further comprising a step of: when an access request requesting the updating or the reading of data for one of the logical tracks of said cache memory is issued from said processing unit to said cache memory, referring to the flag of said control memory corresponding to said one logical track and granting the access request when the referred flag indicates that the erasing of step d) is not required (61∼65 in Fig. 7). A method for controlling data transfer according to Claim 1 wherein step b) stores the end position of the final format writing of write data in the logical track into said control memory as the valid write data end position (408∼409 in Fig. 5). A control unit (12) provided between a processing unit (10) and at least one rotating storage device (13) for converting data of variable length format from said processing unit into data of fixed length format for transfer to said rotating storage device, comprising: a cache memory (126) for temporarily holding the data transferred between said processing unit and said rotating storage device and having a memory area organised in the form of a plurality of logical tracks corresponding to logical tracks of said rotating storage device; a control memory 127) for storing information for each of the logical tracks of said cache memory; means (121), for storing an end position (22) of valid write data into said control memory when data from said processing unit is written by format writing into a logical track of said cache memory; transfer means (122, 125), in reading data from one of the logical tracks of said cache memory, for referring to the stored end position of the valid write data of said one logical track and reading the valid write data from its top to its end positions from said one logical track for transfer to said rotating storage device; and erase means (122, 125) for selectively transferring to said rotating storage device erase data of a volume equal to the data volume from the position immediately after the stored end position up to the end position of said one logical track, to erase the logical track on the rotating storage device selectively based on information in the control memory. A control unit for controlling data transfer according to Claim 7 further comprising: flag setting means (121) for setting in said control memory (127) a flag (21) indicating whether the erasing is required in transferring the data to said rotating storage device, based on the end position of the valid write data and the end position in each logical track of said cache memory having write data written thereon; said transfer means including discrimination means (Fig. 6), in reading data from one of the logical tracks of said cache memory, for referring to the flag of the control memory corresponding to said one logical track of said cache memory to determine whether the referred flag indicates that the erasing is required ; and said erase means performing the erasing when said discrimination means determines that the referred flag indicates that the erasing is required. A control unit for controlling data transfer according to Claim 8 wherein said flag setting means (121 in Fig. 5) sets a flag indicating that the erasing is required or is not required in reading the write data when the end position of the valid write data and the end position of each logical track match or do not match, respectively. A control unit for controlling data transfer according to Claim 7 further comprising: means (121 in Fig. 7) for granting an access request for updating or reading of data not accompanied by format writing for one of the logical tracks of said cache memory issued from said processing unit to said cache memory only when the position of data to be accessed in said one logical track designated by the access request is located toward the top of said one logical track relative to the end position of the valid write data in said one logical track A control unit for controlling data transfer according to Claim 8 further comprising: means (121 in Fig. 7) for referring to the flag of said control memory corresponding to said one logical track and granting an access request for updating or reading of data not accompanied by format writing to one of the logical tracks of said cache memory issued from said processing unit to said cache memory when the referred flag indicates that the erasing is not required. A storage subsystem comprising: at least one rotating storage device (13) for storing data in a fixed length format; and a control unit (12) according to any of claims 7 to 11 provided between at least one processing unit (10) and said at least one rotating storage device.

Inventors: KAWABATA HISAYOSHI, KAWAGUCHI, KUROKAWA ISAMU, ONUMA HIROAKI, TAKEUCHI HISAHARU, KAWABATA, HISAYOSHI, KUROKAWA, ISAMU, ONUMA, HIROAKI, TAKEUCHI, HISAHARU, KAWAGUCHI, MASAHIRO
Applicants: HITACHI LTD, HITACHI, LTD.
Application year: 1996
Main classification: G06F3
IPC codes: G06F3, G06F12