PACKING VARIABLE LENGTH RECORD IN FIXED BLOCKS

Abstract: A system for packing variable size user data records (44) into fixed size physical blocks (38) on a storage medium. The invention receives the variable size user data records (44) with error detection and correction information (46) and creates a data page for each record (44). A map entry (52) of record packing information is created for each records data page (44). The map entry (52) contains the location of the record page (44) and may contain further information such as the type, size and compression status of the record contained on the record page (44). The data page is stored on the same physical block (38) as the map entry (52). The physical structure is stored on a structure consisting of logical blocks (72) on an entity (70).

Description: PACKING VARIABLE LENGTH RECORD IN FIXED BLOCKS BACKSRQTOP QF IBS INVENTION. Magnetic tapes continue to provide low-cost input/output capability for computer data interchange and off-line storage. To improve performance different schemes have been used to maximize tape area usage, primarily through data compression schemes and record packing schemes that reduce tape wastage between records on tape. In the past, if a user data record ended in the middle of a tape block the rest of the tape block had to be padded so that the next user data record could be written at the next tape block. This led to significant wastage of tape due to padding between records. Before the use of data compression schemes, a smart and efficient user would choose data records that were multiples of the native tape block size. With that choice of records, tape blocks were used in full without padding. However, with the advent of data compression schemes, user data gets compressed to variable sizes thereby using up fractions of tape blocks, hence causing wastage. In order to overcome the problem of wasted area on tapes while using data compression schemes, record packing techniques are used. One such scheme uses super tape blocks of variable size capable of containing multiple user data records. This scheme requires the use of variable size headers for each variable size super tape block to describe the partition of user data records within each block. Such a scheme is not suitable for systems using fixed size tape blocks. Further, for systems using block ECC codes variable block sizes are not efficient. Another record packing scheme is used with the Digital Audio Tape (DAT) fixed block tape format. The DAT is a helical scan tape having diagonal tracks. Data records are written in groups of about 20 tracks. In the last track of each group an index is maintained that describes the partition of the tracks in the group. Having the index in the last track of the group makes appending to data records in DAT difficult. Further, if the index is irrecoverable for some reason the amount of data lost is significant. There is a need for a record packing scheme that uses fixed sized tape blocks to store variable size user data records while using data compression techniques to maximize tape utilization. SUMMARY OF THE INVENTTON The present invention is a method and an apparatus for packing variable size user data records into fixed size blocks on a storage medium. An object of the invention is a method and apparatus for improving magnetic tape capacity through record packing by reducing the wastage of tape between data records. Another object of the invention is to ensure that data is appended at the proper physical location on the tape, thus providing an advantageous decrease in soft error rate encountered during read and append operations. These and other objects are attained, in a broad sense, through the use of various features of the invention. The invention includes the steps of receiving user data of variable record lengths along with error detection information; creating one or more data pages for each user data record; building a map of record packing information for each data page; and storing each data page and its associated map within the same physical record on a storage medium. In a narrower sense the objects of the invention are attained by the use of a storage medium that has physical blocks of pre-determined fixed size, where each physical block further comprises a data field and a map field. The data field comprises pages of user data and the map field comprises record packing information for each page of user data in said data field. In yet another sense the objects of the invention are attained by locating the page and map entries within each physical block, locating the map entry at the bottom of the physical block, and by building the page and map entries from opposite directions. It is an advantage of this invention that tape area usage is maximized using a record packing scheme that reduces tape wastage between records on tape. It is yet another advantage of this invention that the map entry for each data page is co-located with it's associated data page within the same physical block thereby providing a data integrity guarantee during append operations such that if an append operation is unsuccessful, all data objects located prior to the append location are fully recoverable. The foregoing and additional objects, features and advantages of the present invention will become apparent to those skilled in the art from a more detailed consideration of the preferred embodiment thereof, taken in conjunction with the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS Figure 1 is a block diagram of a computer system incorporating a tape drive according to the principles of the invention; Figure 2 is a simplified block diagram of the format of stored information on a tape according to the principles of the invention; Figure 2a is an exploded view of a physical block stored on a tape according to the principles of the invention; and Figure 3 is a detailed diagram of the format of the physical block of Fig 2a. DETATIJ5D DESCRIPTION OF THE INVENTION Figure 1 is an example of a computer system 10 according to the invention that includes a tape system 12. The computer system 10 includes among other components a CPU 14, memory 16, and I/O bus adapter 18 all coupled to a system bus 20. Coupled to the I/O bus adapter 18 is an I/O bus 22, which supports various peripheral devices 24 and a tape drive controller 26, which controls data transfers to and from a tape 28 within a tape drive 30. The tape controller 26 further includes a memory 31, control logic 32, and a digital to analog convertor 34. The tape drive 30 includes a tape head 36 and the tape 28. In order to write data to the tape 28, data passes through the I/O adapter 18 from the system bus 20 to the I/O bus 22. The tape controller 26 stores the data in the memory 31. When an entire "record" of information has been stored in the memory 31, it is then transferred by direct memory access (DMA) to the tape 28. In a conventional manner, the digital to analog convertor 34 converts the data to the analog form suitable for tape storage, while the control logic 32 provides the proper control signals to the tape head 36 in the tape drive 30. More specifically, data records are written on the tape 28 in entities as shown in figure 2. Each entity 70 includes ten logical blocks 72, eight data blocks 74 and two ECC blocks 76. Each logical block 72 has two physical blocks 38, written on two tracks. There are gaps between the each physical block. Further as shown in Figure 2a, each physical block 38 comprises data pages 44, error detection information in the form of CRC checksums 46 for each page of data, together defining data field 40. Also as shown in Figure 2a, each physical block 38 also comprises map field 52 of map entries 53 of record packing information for each data page 44, Error Detection Code (EDC). 50 and control block 48. Further as shown in detail in Figure 3, according to the principles of the invention, each physical block 38 comprises of 4140 bytes. As shown, part of the physical block 38, shown as section 40, is DMA'ed from memory, while the remainder, shown as 42, is added in memory at the end of the block. Section 40 of the physical block includes data fields 44, or pages, containing the actual stored data, and CRC checksums 46 for each page of data. As shown in Figure 3, the data field 40, filler 50 and the map field 52 together add up to 4108 bytes. The map field 52 has 1 to 100 map entries 53, each map entry 53 being 8 bytes. Therefore, if there is only one map entry 53 then the maximum size of the data field 40 is 4100 bytes. Similarly, if there are 100 map entries 53, i.e. 800 bytes of map entries in map field 52, then the maximum size of the data field 40 is 3208 bytes. As shown in Figure 3, the data field 40 of each physical block 38 comprises data pages 44. A data page 44 is a group of data bytes inside a physical tape block 38. All data bytes in a page 44 belong to one record. A record may have started in a previous physical block and may continue to the next physical block, hence a data record maybe be written in one or more pages 4 . As explained above, a data page 44 may have 0 to 4100 bytes of data. If a data page 44 is the last page for a record it has two bytes of CRC 46 following the data page 44. As shown in Figures 2a and 3, after the two bytes of CRC 46 another data page 44 may begin with data belonging to the next user record. In Figure 3, Page 0, Page 1, and Page 2 are data pages 44 belonging to different data records and are each followed by two bytes of CRC 46. As shown in Figure 3, the two bytes of CRC 46 is written in even offset. Therefore, if the page byte count is odd there is a pad byte, i.e., one byte of zero (indicated by reference numeral 45 in Figure 3) between the data page 44 and the CRC 46. As shown in Figure 3, Page 0 has an odd page byte count and therefore has a pad byte 45 of zero between the end of data page 0 and the two bytes of CRC 46 following data page 0. Further, as shown in Figure 3, if the page byte count is even the CRC 46 immediately follows the last data byte of the data page 44. As shown in Figure 3, Page 2 has an even page byte count and therefore has no pad byte 45 of zero between the end of data page 2 and the two bytes of CRC 46 following data page 2. Also, as shown in Figure 3, a data page 44 must begin in a 4*N offset. Therefore, if a previous data page CRC 46 doesn't end in 4*N offset, two bytes of zeros 47 are appended after the CRC to enable the following data page to begin with a 4*N offset. For example, as shown in Figure 3, CRC 46 for data page 1 doesn't end in 4*N offset, and therefore two bytes of zeros 47 are appended after the CRC 46 to enable the following data page 44, i.e. page 2, to begin with a 4*N offset. However, as shown in Figure 3, if the data pages 44 and the map field entries 53 don't add up to 4108 bytes then the remaining bytes in the data field 40 up to the beginning of the map field 52 is filled with zeros. This entry is called a filler and is denoted by reference numeral 50 in Figure 3. Further, as shown in Figure 3, each physical block 38 comprises a map field 52 of map entries 53 of record packing information for each data page 44, according to the principles of the invention. As shown, the logically first map entry 53, i.e., the map entry 53 belonging to the first data page 44, is physically the last map entry 53 in the physical block 38. For example, as shown in Figure 3, the map entry E0, represented by reference numeral 53, belonging to the first data page 44, denoted by page 0, is physically the last map entry 53 in the physical block 38, but logically the first map entry 53. Similarly, as shown in Figure 3, map entry El, belonging to data page 1, is physically the second from last map entry 53 in the physical block 38. Further, as shown in Figure 3, each map entry 53 is eight bytes long and comprises several sub-fields. The first sub-field is the "compress" field 80 which occupies 1 bit in each map entry and is denoted by C:l in each map entry 53 (E0 ... EN) of Figure 3. If the compress field bit is set to '1' it indicates that the data in the corresponding data page 44 is stored in compressed format. The next map entry/sub-field is the "type" field 82. As shown in Figure 3, each "type" field 82 occupies 3 bits and is denoted by Etype:3 in each map entry 53 (E0 ... EN) . Each map entry 53 either describes either a data page, a tape mark or a filler. The type field 82 using three bits indicates the type of data in the data field 40 that the map entry 53 represents. According to the principles of the invention, when a map entry 53 represents a corresponding data page 44 having user data, the three bits of "type" field 82 are set to indicate a user data page 44. When a map entry 53 represents a file demarker, the three bits of "type" field 82 are set to indicate a tape mark. Similarly, when a physical block 38 has no data pages, the corresponding map entry 53 has the "type" field 82 set to represent filler 50. Further, when data pages 44 and the map field entries 53 don't add up to 4108 bytes, the remaining bytes in the data field 40 up to the beginning of the map sub-field 52 is also occupied by filler 50. However, fillers of this type don't have any associted map entry. Further, as shown in Figure 3, each map entry 53 has a "next" sub-field 84 which occupies 1 bit, and is denoted by N:l in each map entry 53 (E0 ... EN) . If the "next" sub-field bit 84 is set to '1' it indicates that a user data record continues on to the next physical block.38. Also as indicated in Figure 3, another sub-field 5 in a map entry 53 is the "previous" field 86 which also occupies 1 bit, and is denoted by P:l in each map entry 53 (EO ... EN) . If the "previous" field bit 86 is set to '1' it indicates that the record in a data page 44 is a continuation of a record from a previous physical 0 block 38. Further, as shown in Figure 3, another sub-field in each map entry 53 is the "last" field 88 which occupies 1 bit and, and is denoted by L:l in each map entry 53 (EO ... EN). The "last" field 88 indicates 5 whether a particular map entry is the last logical map entry. Further, as shown in Figure 3, there are also nine reserved bits in each map entry 53 which are always set to zeros. These reserved bits are indicated by (u) :9 in Figure 3. Also, as shown each map entry 53 contains a page byte count 90 that occupies two bytes. The page byte count 90, represented as page_byte_cnt:16 in Figure 3, indicates the size of the corresponding data page 44, or tape mark, or filler 50. The page byte count 90 does not including the pad bytes 45 or the CRC 46. Also included in each map entry 53 is a record byte count 92 that occupies four bytes. The record byte count 92 indicates the size of the user record in the corresponding data page 44 before compression. Further, as shown in Figures 2a and 3, following the data field 40 and the map field 52, i.e., at byte location 4108 in each physical block is the EDC 51. As shown, the EDC 51 (EDC:16) occupies 2 bytes and is used to check the integrity of each physical block 38 in read and write modes. Further as shown in Figures 2a and 3, each physical block 38 also includes a control field 48 containing bits representing various characteristics of the physical block 38, such as format codes, tape markers, data types, compression types, etc. As shown in Figure 3, a logical block number field 52 is also included, representing the logical position of the physical block 38 on the tape relative to other physical blocks 38. Further, as shown, the control field 48 of each physical block 38 also includes the backlink field 54, used during appends to determine the physical location of the append target block. The control block 48 and it's various sub-fields are used to ensure that data is appended at the proper physical location on tape. According to the principles of the invention, as shown in Figures 2a and 3, having each map entry 53 and it's associated data page 44 co-located within the same physical block 38 provides a data integrity guarantee during append operations. If an append operation is unsuccessful, the record packing format allows all data objects located prior to the append location to be fully recoverable as their map entries 53 are physically co-located with the data pages 44 on the media, according to the principles of the invention. It is apparent that, within the scope of the invention, modifications and different arrangements may be made other than herein disclosed. The present disclosure is merely illustrative, the invention comprehending all variations thereof.

Claims: He claim: 1. A method for packing variable size user data records into fixed size blocks on a storage medium comprising: receiving user data of variable record lengths; formatting the user data and associated map entry of record packing information into fixed physical blocks of pre-determined size; grouping said physical blocks in groups to define logical blocks, groups of said logical blocks defining an entity; and storing said entity on a storage medium. 2. The method of Claim 1 wherein the step of formatting user data into fixed physical blocks further comprises the steps of: building a map of record packing information for each data page; creating data pages for each user data record; storing each data page and its associated map within the same physical record on a storage medium. 5 3. The method of Claim 2 wherein the step of building a map of record packing information for each data page further comprises the steps of: storing information that indicates if a data page O is compressed; storing information that indicates the type of data in the associated data page of the map; storing information that indicates if an user record continues into a subsequent physical block; 5 storing information that indicates if an user record is a continuation of a record from a previous physical block; storing information that indicates if a particular map is the last map entry in a physical block; storing information that indicates the size of the associated data page; and storing information that indicates the size of the user record before compression. 4. A method for packing variable size user data records into fixed size blocks on a storage medium comprising: receiving user data of variable record lengths along with error detection information; creating a data page for each user data record; building a map of record packing information for each data page; storing each data page and its associated map within the same physical record on a storage medium. 5. The method of Claim 1 wherein the step of formatting user data into fixed physical blocks comprises formatting user data into physical blocks of 4140 bytes. 6. The method of Claim 1 wherein the step of grouping said physical blocks in groups to define logical blocks comprises grouping two physical blocks to define one logical block. 7. The method of Claim 1 wherein said entity comprises eight logical blocks. 8. A storage medium comprising : an entity; said entity comprising groups of logical blocks; each of said logical blocks comprising physical blocks of pre-determined fixed size; each of said physical block further comprising a data field and a map field; said data field comprising pages of user data; said map field comprising map entries of record packing information for each page of user data in said data field. 9. The storage medium of Claim 8 wherein each said map entry of said map field further comprises: a compress field that indicates if a data page is compressed; a type field that indicates the type of data in the associated data page of the map; a next field that indicates if an user record continues into a subsequent physical block; a previous field that indicates if an user record is a continuation of a record from a previous physical block; a last field that indicates if a particular map is the last map entry in a physical block; a page byte count field that indicates the size of the associated data page; and a record byte count field that indicates the size of the user record before compression. 10. The storage medium of Claim 8 wherein said physical block is 4140 bytes long. 11. The storage medium of Claim 8 wherein said logical block comprises two physical blocks. 12. The storage medium of Claim 8 wherein said entity comprises eight logical blocks. 13. The storage medium of Claim 8 wherein said map entry comprises 8 bytes.

Inventors: BITNER HAIM, HALL DANA, BITNER, HAIM, HALL, DANA
Applicants: QUANTUM CORP, QUANTUM CORPORATION
Application year: 1995
Main classification: G06F12
IPC codes: G06F3, G11B20