IMPROVED METHOD FOR PROVIDING VARIABLE SECTOR-FORMAT OPERATION TO A COMPUTER SYSTEM

Abstract: An improved method for enabling a computer system in which data is arranged internally in logical sectors to read and write data to a sector-formatted storage medium arranged in physical sectors, wherein the size of a logical sector is less than the size of a physical sector, comprises filling consecutive physical sectors of the sector-formatted storage medium with consecutive logical sectors of data of the computer system, such that each consecutive N physical sectors holds P consecutive logical sectors stored sequentially within the N physical sectors, with a remaining portion at the end of each consecutive N physical sectors being unfilled and the beginning of every P<th> logical sector being aligned with the beginning of every respective N<th> physical sector, P being greater than N.

Description: IMPROVED METHOD FOR PROVIDING VARIABLE SECTOR-FORMAT OPERATION TO A COMPUTER SYSTEM Inventors: Craig F. Russ Jeffery A. Stell Michael J. Saunders COPYRIGHT NOTICE A portion of the disclosure of this patent document contains material that is subject to copyright protection. The copyright owner has no objection to the facsimile reproduction by anyone of the patent document or the patent disclosure as it appears in the United States Patent & Trademark Office patent file or records, but otherwise reserves all copyright rights whatsoever. BACKGROUND Field of the Invention The present invention generally relates to computer data storage, and more particularly, to an improved method for enabling a computer system having a predetermined logical sector format to read from and write to a sector-formatted storage medium that has a physical sector format that differs from the logical sector format of the computer system. Description of the Prior Art As the computer industry has continued to mature, it appears that an "unofficial" standard is emerging with respect to the physical sector size of sector- formatted storage media, such as magnetic disk media. Specifically, the industry now appears to be settling on a standard physical sector size of 512 bytes, due in large part to the high volume of 512 byte sector disks being used with open system environments. These open system environments, based on operating systems such as Unix and Microsoft Windows NT, typically read and write data in blocks of 512 bytes, and thus work well with disks having 512 bytes physical sectors. Disk vendors have tuned disk performance to this sector size, including the management of look- ahead disk buffers. They have also designed disk "on-the-fly" error correction algorithms to this sector size. Despite this emerging, unofficial standard, many earlier computer systems, and their respective operating systems, were architected around a different physical sector size for sector-formatted storage media. Data is arranged internally within these computer systems in logical sectors having a size that matches the physical sector size around which they were architected. Consequently, in most cases, there is an incompatibility between the logical sector size of these earlier computer systems and the standard 512 byte physical sector format that has emerged. For example, Unisys A Series and Clearpath HMP NX computer systems, which run the Unisys MCP operating system, were originally architected around a physical sector size of 180 bytes. Consequently, these computers and the MCP operating system arrange data internally in logical sectors of 180 bytes. Similarly, Unisys 2200 and Clearpath HMP IX computer systems, which run the Unisys 2200 operating system, were originally architected around a physical sector size of 504 bytes, and hence, data is arranged internally in logical sectors of 504 bytes. Industry standard disk technology, based on a 512 byte physical sector, offers several advantages over the proprietary formats of older computer systems, such as the 180 byte sector utilized in Unisys A Series/Clearpath HMP NX computer systems and the 504 byte sector utilized in Unisys 2200/Clearpath HMP IX computer systems. Disks based on the larger 512 byte physical sector format can hold more data on the same disk, resulting in a lower cost per megabyte. Also, since each disk on a bus will contain more data, there is more storage capacity served by a given host I/O bus. Additionally, because more data can be stored on each disk, fewer disks may be required, resulting in a smaller data footprint, and lower power & cooling requirements. Because of the advantages of using industry standard disk technology, and also because it is becoming increasingly difficult to find disk vendors willing to support non-standard disk sector sizes, Unisys has developed methods to enable both its A Series/Clearpath HMP NX (180 byte sectors) and 2200/Clearpath HMP IX (504 byte sectors) computer systems to operate with storage media having a 512 bytes physical sector format, in addition to their existing proprietary formats. In Unisys 2200 and Clearpath HMP IX computer systems, because the 504 byte logical sectors internal to the computer system are close in size to the 512 byte physical sectors of an industry standard disk, the 504 byte logical sectors are made to correspond one-to-one with respective 512 byte physical sectors on an attached storage device. When a logical sector (504 bytes) of user defined data is written to the storage device, the I/O channel simply adds eight (8) extra ("pad") bytes to the logical sector as the data is transferred from the host to the storage device. When reading a physical sector of data from the storage device, the I/O channel strips the last eight (8) pad bytes from the incoming data before passing the first 504 bytes into a corresponding logical sector buffer. With Unisys A Series and Clearpath HMP NX computer systems, in which data is arranged internally in logical sectors of 180 bytes, it is not practical to provide a one-to-one correspondence with the 512 byte physical sectors of a standard storage device. Indeed, this would result in 332 wasted bytes per physical sector. Consequently, Unisys developed a different method for enabling its A Series and Clearpath HMP NX computer systems to operate with industry standard storage media having 512 byte sectors. This method is described in detail in co-pending patent application serial no. 08/758,836, filed December 2, 1996, which is a divisional of serial no. 08/288,465, filed August 10, 1994, now abandoned. Co-pending application serial no. 08/758,836 has received a Notice of Allowance, and it is hereby incorporated herein by reference in its entirety. Figure 1 illustrates the manner in which 180 byte logical sectors of the Unisys A Series and Clearpath HMP NX are mapped to the 512 byte physical sectors of a storage medium in accordance with the method described in application serial no. 08/758,836. As shown, in accordance with this method, starting with logical sector 0 in physical sector 0, logical sectors are stored one after the other within the physical sectors on the disk, completely filling each successive physical sector. As a result, some logical sectors (e.g., logical sector 2) will span two physical sectors (e.g., physical sectors 0 and 1). While this method makes maximum use of the available capacity in each physical sector, it does result in a performance loss during certain write operations in which the logical sectors to be written do not begin and end on a physical sector boundary. Specifically, in such a situation, a read-modify- write process must be performed in order to write the logical sectors to the disk. Figure 2 illustrates the read-modify- write process as implemented on an MCP server 10 (i.e., a Unisys A Series or Clearpath HMP NX computer system executing the MCP operating system). In this example, assume that it is desired to write four logical sectors of data from an application program buffer 12 to a 512 byte sector disk 14, beginning at logical sector 1. The MCP server 10 will make a write request addressed to logical sector 1, with a specified length of four logical sectors. The logical sector request is mapped to the corresponding physical sectors of the disk - in this example, physical sectors 0 and 1. As illustrated, the write request will begin in the middle of physical sector 0 of the disk 14. This presents a problem, because disks typically are designed such that they must read or write an entire physical sector of data at a time. Consequently, when a write request begins in the middle of a physical sector, the data at the beginning of the physical sector must somehow be preserved during the write process. In this example, the data from logical sector 0 (the striped area preceding logical sector 1) must be preserved. The same issue exists at the end of the request in physical sector 1, where part of logical sector 5 (the striped area following logical sector 4) must also be preserved since it is not part of the data to be written. According to the method described in co-pending application serial no. 08/758,836, in order to preserve the data at logical sectors 0 and 5, physical sectors 0 and 1 are automatically pre-read into physical sector buffers 16 and 18, respectively, as shown at step 20. A "merge" cycle is then begun in which the data that formerly resided at logical sector 0 is re- written to physical sector 0 from its buffer 16 (step 22). Then, the data in the application program buffer 12 is aligned beginning at logical sector 1, through logical sector 4, overwriting what previously resided there on the disk (step 24). Finally, in step 26, the trailing data (i.e., part of logical sector 5) that formerly resided at the end of physical sector 1 is merged to complete the contents of physical sector 1. A successful completion status is then presented to the MCP server 10. With this method, the MCP server 10 is able to interoperate with the 512 byte/sector disk 14 in a manner that is transparent to the operating system and to any applications that need to read and write data to the disk 14. While the foregoing method effectively allows an MCP server to interoperate with a disk having a 512 byte sector format, the need for the read-modify- write process, or "merge cycle," on certain write operations impacts the write performance of the system. Another disadvantage of this method is that often the boundary between space allocated to different files will fall within a physical sector. A failed write of such a physical sector will not only leave the file that has been updated in an indeterminate state, but also will leave the other file in an indeterminate state. The program issuing the write will be informed of the failure, but the user or application owning the other file will receive no notification that part of that file is now in an indeterminate state. In view of the foregoing disadvantages of prior art methods, there is a need for an improved method of enabling a computer system in which data is arranged in logical sectors to interoperate with a sector-formatted storage medium having a different, larger physical sector size. The present invention satisfies this need. SUMMARY OF THE INVENTION The present invention is directed to an improved method for enabling a computer system having a predetermined logical sector format to read from and write to a sector-formatted storage medium that has a different, larger physical sector format than the logical sector format of the computer system. More specifically, the present invention provides an improved method for enabling a computer system in which data is arranged internally in logical sectors to read and write data to a sector-formatted storage medium arranged in physical sectors, wherein the size of a logical sector is less than the size of a physical sector such that a plurality P of logical sectors of the computer system will fit consecutively within a number N of physical sectors of the sector-formatted memory, P being greater than N. According to the present invention, consecutive physical sectors of the sector-formatted storage medium are filled with consecutive logical sectors of data of the computer system, such that each consecutive N physical sectors holds P consecutive logical sectors stored sequentially within the N physical sectors, with a remaining portion at the end of each consecutive N physical sectors being unfilled and the beginning of every Pth logical sector being aligned with the beginning of every respective Nth physical sector. As explained more fully below, this manner of laying out logical sectors within the physical sectors of the storage medium eliminates the need to perform a read-modify-write process on certain write operations, thus improving the write performance of the computer system. Further according to the invention, additional performance enhancements can be achieved, in combination with this method, by (i) aligning file rows within the computer system on logical sector boundaries defined by every Pth logical sector, (ii) aligning directory structures within the computer system on logical sector boundaries that are multiples of P logical sectors, and accessing the directory structures in multiples of P logical sectors beginning on those boundaries, (iii) setting a file size attribute, which controls the amount of data physically written to the storage medium at a time, to be a multiple of P logical sectors, and/or (iv) altering certain application programs so that they issue write requests in multiples of P logical sectors. While in a preferred embodiment, the remaining portion at the end of each N physical sectors is unfilled by, for example, padding it with all zeroes, all ones, or some predetermined pattern, in other embodiments, the remaining portion can be used to hold an error checking code, an error correcting code, an indication of a status of the N physical sectors of which it is a part, or other information concerning the N physical sectors of which it is a part. Additional features and advantages of the present invention will become evident hereinafter. BRIEF DESCRIPTION OF THE DRAWINGS The foregoing summary, as well as the following detailed description of the preferred embodiment, is better understood when read in conjunction with the appended drawings. For the purpose of illustrating the invention, there is shown in the drawings an embodiment that is presently preferred, it being understood, however, that the invention is not limited to the specific methods and instrumentalities disclosed. In the drawings: Figure 1 shows a prior art method in which logical sectors of data are stored in physical sectors of a storage medium; Figure 2 illustrates a read-modify-write process that must be performed during write operations in accordance with the prior art method shown in Figure 1 ; Figure 3 is a block diagram of an exemplary computer system in which the present invention may be implemented; Figure 4 illustrates a preferred embodiment of the method of the present invention, as implemented in a computer system in which data is arranged in logical sectors of 180 bytes and which is attached to a storage medium having physical sectors of 512 bytes; Figure 5 illustrates a write operation in accordance with the embodiment illustrated in Figure 4; Figure 6 illustrates a read operation in accordance with the embodiment illustrated in Figure 4; Figure 7 illustrates further aspects of the method of the present invention; Figure 8 illustrates still further aspects of the method of the present invention; and Figure 9 illustrates an alternate embodiment of the method of the present invention. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENT The present invention is directed to an improved method for enabling a computer system having a predetermined logical sector format to read from and write to a sector- formatted storage medium that has a different, larger physical sector format than the logical sector format of the computer system. The present invention may be embodied in the form of hardware, software, or a combination of both hardware and software. When embodied in the form of software, the invention may take the form of program code (i.e., instructions) embodied in tangible media, such as floppy diskettes, CD-ROMs, hard drives, or any other machine-readable storage medium, wherein, when the program code is loaded into and executed by a machine, such as a computer, the machine becomes an apparatus for practicing the invention. The methods and apparatus of the present invention may also be embodied in the form of program code that is transmitted over some transmission medium, such as over electrical wiring or cabling, through fiber optics, or via any other form of transmission, wherein, when the program code is received and loaded into and executed by a machine, such as a computer, the machine becomes an apparatus for practicing the invention. When implemented on a general-purpose processor, the program code combines with the processor to provide a unique apparatus that operates analogously to specific logic circuits. Referring to the drawings, wherein like numerals represent like elements throughout, Figure 3 shows an exemplary computer system in which the present invention may be implemented. As is typical of most computer systems, the computer system 30 has an operating system 32 on which one or more application programs 34 may be running. The computer system 30 also has an I/O processing subsystem 36, which may comprise hardware and/or software, for performing I/O processing. A storage medium 40, such as a magnetic disk medium, is attached to the I/O processing subsystem 36 via an interface 38, such as SCSI, Fibre Channel, or the like. Application programs 34 and/or the operating system 32 make use of logical sector buffers 42 to prepare data for transfer to the storage medium via the I/O processing subsystem 36 and interface 38. As used herein, the term "logical sector" means a unit of data of which the computer system is capable of transferring to a sector-formatted storage medium, or other sector-formatted input/output medium, in which data is arranged in physical sectors on the medium. Ideally, the size of a logical sector is the same as the size of a corresponding physical sector on the medium. For example, in Unisys A Series and Clearpath HMP NX computer systems, a logical sector has a size of 180 bytes, and storage media specifically designed for such computer systems have corresponding physical sectors of the same size. However, as explained above, it has become desirable to be able to attach storage medium to such computer system wherein the size of a physical sector on the storage medium is different than the size of a logical sector within the computer system. The present invention provides an improved method of achieving this capability. With reference to Figure 3, the present invention can be implemented as part of the operating system 32 and/or I/O processing subsystem 36. More specifically, the present invention provides an improved method for enabling a computer system in which data is arranged internally in logical sectors to read and write data to a sector-formatted storage medium arranged in physical sectors, wherein the size of a logical sector is less than the size of a physical sector such that a plurality P of logical sectors of the computer system will fit consecutively within a number N of physical sectors of the sector- formatted memory, P being greater than N. According to the present invention, consecutive physical sectors of the sector- formatted storage medium are filled with consecutive logical sectors of data of the computer system, such that each consecutive N physical sectors holds P consecutive logical sectors stored sequentially within the N physical sectors, with a remaining portion at the end of each consecutive N physical sectors being unfilled and the beginning of every Pth logical sector being aligned with the beginning of every respective Nth physical sector. As explained more fully below, this manner of laying out logical sectors within the physical sectors of the storage medium eliminates the need to perform a read-modify-write process on certain write operations, thus improving the write performance of the computer system. Further according to the invention, additional performance enhancements can be achieved, in combination with this method, by (i) aligning file rows within the computer system on logical sector boundaries defined by every Pth logical sector, (ii) aligning directory structures within the computer system on logical sector boundaries that are multiples of P logical sectors and accessing the directory structures in multiples of P logical sectors beginning on those boundaries, (iii) setting a file size attribute, which controls the amount of data physically written to the storage medium at a time, to be a multiple of P logical sectors, and/or (iv) altering certain application programs so that they issue write requests in multiples of P logical sectors. Figure 4 illustrates a preferred embodiment of the method of the present invention, as implemented in a computer system in which data is arranged in logical sectors of 180 bytes and which is attached to a storage medium having physical sectors of 512 bytes. Such a computer system might, for example, be a Unisys A Series or Clearpath HMP NX computer system running the Unisys MCP operating system (i.e., an MCP server). As shown, in this embodiment, consecutive physical sectors of the sector-formatted storage medium are filled with consecutive logical sectors of data of the computer system, such that each consecutive physical sector holds two (2) consecutive logical sectors stored sequentially within the physical sector, with a remaining 152 byte portion at the end of each physical sector being unfilled - the I/O processing subsystem preferably "pads" out these bytes during a write operation. The beginning of every even-numbered logical sector (i.e., every 2 nd logical sector) is aligned with the beginning of the next respective physical sector. Thus, in this embodiment, P equals 2, and N equals 1. Figure 5 illustrates a write operation in accordance with the embodiment illustrated in Figure 4, as implemented in an MCP server 50. In this example, assume that it is desired to write four logical sectors of data from an application program buffer 52 to a 512 byte sector disk 54, beginning at logical sector 0. The MCP server 50 will make a write request addressed to logical sector 0, with a specified length of four logical sectors. The logical sector request is mapped to the corresponding physical sectors of the disk - in this example, physical sectors 0 and 1. The write request will begin at the beginning of physical sector 0, as shown. Because of this, there is no need to preserve any leading data prior to writing the user data. And, since the end of the write request is aligned where the end of useable data is located within physical sector 1 (the striped "pad" area is ignored), there is no need to preserve any trailing data prior to writing the user data. This is where the present method provides a significant improvement in performance over the prior art method. Specifically, when the beginning and end of a write request is aligned with the useable data within the physical sectors, no read-modify-write process has to be performed. The data can simply be written to disk. Still referring to Figure 5, the write operation is performed as follows. First, at step 56, the user data in logical sectors 0 and 1 is aligned with the beginning of physical sector 0, and then written to that sector, overwriting what previously resided there on the disk. The I/O processing subsystem (not shown) then automatically pads the end of physical sector 0 as the data is being transferred to the disk (step 58), as illustrated by the striped area following logical sector 1. In this embodiment, the pad is 152 bytes in length. Next, the user write data for logical sectors 2 and 3 is aligned at the start of the next physical sector, physical sector 1, overwriting what previously resided there on the disk (step 60). Finally, the I/O processing subsystem again automatically pads the end of physical sector 1 (step 62). A successful completion status is then presented to the MCP server. This method is completely transparent to the operating system and any application programs running on it. Figure 6 illustrates a read operation in accordance with the present embodiment. Assume in this example, that the MCP server 50 makes a read request addressed to logical sector 0 that is four sectors in length. According to the method of the present invention, the I/O subsystem will recognize the request as being directed to the 512 byte sector disk 54, and will map the logical sector request into the physical sectors of the disk 54 - in this case, physical sectors 0 and 1. A disk read operation will then be performed, beginning at physical sector 0, for 2 physical sectors. As illustrated at step 64, logical sector 0 will be aligned into the beginning of the applications buffer 52, followed by logical sector 1. When the "pad" area at the end of physical sector 0 is read, this data is discarded, or stripped out (step 66). Logical sectors 2 and 3 are then read out of physical sector 1 and assembled into the application's buffer 52 behind logical sectors 0 and 1 (step 68). Again, the pad area at the end of physical sector 1 is discarded (step 70). A successful completion status is then presented to the MCP server 50, completing the read operation. As with the write operation, the handling of the pad areas and the assembly of the logical sectors into the application's buffer 52 are transparent to the application program and operating system. As mentioned above, the performance benefits of this new method will be achieved immediately whenever the beginning and end of a write request is aligned with the useable data within the physical sectors, such that no read-write-modify process is required. However, in accordance with further aspects of the present invention, certain system functions and application programs can be tuned to take advantage of the benefits of this method more directly. According to one such additional aspect of the present invention, file rows within the computer system are aligned on logical sector boundaries defined by every Pth logical sector. Additionally, file row size is preferably set to a multiple of P logical sectors. A file row is the quantity by which disk space is assigned to files. A file row size can be defined by the user in several ways, e.g., blocks per row or records per row, but is converted by the operating system into logical sectors per row. In the embodiment illustrated in Figures 4, 5, and 6, for example, where P equals 2, file rows would be aligned on even numbered logical sector boundaries (i.e., every 2 nd logical sector), and would have a size that is a multiple of 2 logical sectors. As another additional aspect of the present invention, a file size attribute in the operating system environment, which controls the amount of data physically written to the storage medium at a time, can be set to a multiple of P logical sectors (e.g., 2 logical sectors in the present embodiment). For example, in the MCP operating system, a user specified logical file attribute, denoted BLOCKSIZE, controls how much data is physically written to disk at a time. A disk file in the MCP environment consists of records, and groups of records form blocks. BLOCKSIZE controls the size of these blocks. In the MCP environment, a write operation is only initiated when enough logical records have been written by the application program to fill up a block. For example, suppose a disk file contained 180 byte records, with 10 records per block. The first nine sequential writes to the file would only result in the data being put into system I/O buffers in main memory; a request to write the 10 th record would cause the operating system to physically write the entire block to disk. Aligning file rows on logical sector boundaries defined by every Pth logical sector, and setting the size attribute (e.g., BLOCKSIZE) of blocks of data to be written to disk to a multiple of P logical sectors, ensures that write operations begin and end on those logical sector boundaries, thus eliminating the need in many (but not necessarily all) cases for read-modify-write operations. This results in improved performance. Figure 7 further illustrates the file row alignment and block size optimization techniques described above, as they would be implemented in the embodiment of Figures 4-6 in which two logical sectors are stored in each physical sector of the disk, i.e., P = 2, N=l. As shown in this example, in accordance with the file row alignment technique of the present invention, file rows have been allocated by the operating system on even numbered logical sector boundaries, i.e., every Pth logical sector. Two rows of a file are shown, "ROW 1" and "ROW 2". The block size optimization technique is also illustrated. In this example, the block size attribute, which controls the amount of data physically written to disk at a time (i.e., one block), has been set equal to two (2) logical sectors - a multiple of P. Any other multiple of P logical sectors could equally have been used. When the block size attribute is set to a multiple of P logical sectors, as shown here, all blocks begin and end on Pth logical sector boundaries. In this example, all of the blocks are 2 logical sectors in size, numbered "BLOCK 1" through "BLOCK 6", and they each begin on respective even numbered logical sector boundaries (i.e., every 2 nd logical sector). According to yet another aspect of the present invention, further optimization can be achieved by aligning directory structures on logical sector boundaries that are multiples of P logical sectors, and by accessing the structures in multiples of P logical sectors beginning on those boundaries. This aspect of the present invention is illustrated in Figure 8, as implemented in the embodiment illustrated in Figures 4-6, where P equals 2 and N equals 1. As shown, in accordance with this aspect of the present invention, sections of disk allocated for use by the disk directory are allocated by the operating system on evenly numbered logical sector boundaries, i.e., logical sector boundaries defined by multiples of P logical sectors. These sections are called "rows" of the directory. Within the directory row, items of data within the directory are created by the operating system in even numbers of logical sectors, i.e., multiples of P logical sectors, resulting in all items beginning and ending on even numbered logical sector boundaries. An "item" within a directory row can be a disk file header (describing the location and attributes of a user or system file) or a system maintained data structure. They are generically referred to as "data" in the Figure. In this example, "DATA 1" represents a disk directory data item which is 4 logical sectors in size, and "DATA 2" represents a second item that is 2 logical sectors in size. "DATA 1 " and "DATA 2" are contained within "ROW 1 " of the directory. "DATA 3", a third item that is 6 logical sectors in size, is contained within "ROW 2" of the directory. Additional performance improvements can be achieved by altering certain application programs so that they issue write requests in multiples of P logical sectors. For example, application programs written for the MCP operating system can make use of a DIRECT I O feature of the MCP operating system. DIRECT I/O gives the application program explicit control over buffer allocation and over buffer mapping on I/O operations to a file's logical sector oriented address space. These applications can be made to perform better in accordance with the present invention by configuring them to issue DIRECT I/O write requests that are multiple of P logical sectors and begin at file relative logical sector addresses that are multiples of P. Figure 9 illustrates an alternate embodiment of the method of the present invention, again as implemented in a computer system in which data is arranged in logical sectors of 180 bytes and which is attached to a storage medium having physical sectors of 512 bytes. As shown, in this embodiment, consecutive physical sectors of the sector-formatted storage medium are filled with consecutive logical sectors of data of the computer system, such that every two (2) consecutive physical sectors holds five (5) consecutive logical sectors stored sequentially within the two physical sectors, with a remaining 124 byte portion at the end of every pair of physical sectors being unfilled - the I/O processing subsystem preferably "pads" out these bytes during a write operation. Starting with logical sector 0 and physical sector 0, the beginning of every 5th logical sector is aligned with the beginning of every respective 2 nd physical sector. Thus, in this embodiment, P equals 5, and N equals 2. As in the embodiment illustrated in Figures 4-6, performance in the embodiment illustrated in Figure 9 can be enhanced by (i) aligning file rows within the computer system on logical sector boundaries defined by every 5th logical sector, (ii) aligning directory structures within the computer system on logical sector boundaries that are multiples of five (5) logical sectors and accessing the directory structures in multiples of five logical sectors beginning on those boundaries, (iii) setting a file size attribute, which controls the amount of data physically written to the storage medium at a time, to be a multiple of five (5) logical sectors, and/or (iv) altering certain application programs so that they issue write requests in multiples of five (5) logical sectors. Another embodiment (not shown) for use in a 180 byte logical sector/512 byte physical sector environment, may comprise filling every three physical sectors (N = 3) with eight logical sectors (P=8). This would reduce the size of the unfilled pad at the end of every N physical sectors, but would preclude supporting a physical disk with a sector size of 1024 bytes and would increase the allocation granularity of file rows. Other embodiments are also possible. While in the embodiments described above, the unfilled remaining portion at the end of every N physical sectors is simply padded out during data transfer to the physical sectors, with, for example, all zeroes, all ones, or some predetermined pattern, the remaining portion can alternatively be used to include meaningful information. For example, the remaining portion could be used to provide some form of status indication about the N physical sectors to which it belongs, such as, for example, "unused" or "in use." Alternatively, or in addition, the remaining portion could be used to hold an error check on the P logical sectors within the N physical sectors, such as a 32 bit checksum, a 64 bit checksum, a cyclic redundancy check (CRC), or an error correcting code (ECC). In addition to providing an additional layer of error check and/or correction, this would allow detection (on subsequent read) of the case where N is greater than 1 and a write of N physical sectors is interrupted (by power failure or hardware failure) after one or more physical sectors were written but before all N physical sectors were written. As yet another alternative, alone or in combination, the remaining portion could also include information such as a sector number on a particular physical pack. This would allow the computer system to check for data that has been written to the wrong place due to outboard hardware errors. To allow the present invention to work in computing environments in which both native storage media (physical sector size matches internal logical sector size) and non-native storage media (physical sector size is different from internal logical sector size), a mechanism is needed to enable the computer system to recognize those storage media for which the present invention must be employed. In the embodiment illustrated in Figures 4-6, as implemented in a Unisys MCP server, this mechanism takes the form of a system console command that allows a system operator to designate a 512 byte sector disk to be accessed using the method of the present invention. The code that implements support for this command is part of the MCP operating system, although in other embodiments, it could comprise a separate utility. When the system console command, called INITIALIZE, is executed, data is placed within various specific locations in logical sectors 0 through 27 (the first 28 logical sectors) of the 512 byte sector disk. This corresponds to physical sectors 0 through 13. There are two locations that uniquely identify a disk as being accessible via the method of the present invention. A "NOL2" field contains a specific 4 byte pattern that causes the MCP to inform the I/O processor and channel to manage the physical sectors by packing 2 logical sectors within a physical sector. A "NOLI" field contains a specific 4 byte pattern that causes the MCP to allocate the directory and file rows of that disk so that write access is optimized in the manner described above. As the foregoing illustrates, the present invention is directed to an improved method for enabling a computer system in which data is arranged internally in logical sectors to read and write data to a sector-formatted storage medium arranged in physical sectors, wherein the size of a logical sector is less than the size of a physical sector such that a plurality P of logical sectors of the computer system will fit consecutively within a number Ν of physical sectors of the sector-formatted memory, P being greater than Ν. It is understood that changes may be made to the embodiments described above without departing from the broad inventive concepts thereof. For example, while each of the embodiments described above involve logical sectors of 180 bytes and physical sectors of 512 bytes, it is understood that the present invention may be employed in any environment wherein the size of a logical sector is less than that of a physical sector. Accordingly, the present invention is not limited to the particular embodiments disclosed, but is intended to cover all modifications that are within the spirit and scope of the invention as defined by the appended claims.

Claims: WHAT IS CLAIMED IS: 1. In a computer system in which data is arranged in logical sectors, a method for enabling the computer system to store and retrieve data on a sector- formatted storage medium arranged in physical sectors wherein the size of a logical sector is less than the size of a physical sector, said method comprising filling each consecutive N physical sectors of said sector-formatted memory with a plurality P of consecutive logical sectors of data of said computer system stored sequentially therein, P being greater than N, such that a remaining portion at the end of said each consecutive N physical sectors is unfilled and the beginning of every Pth logical sector is aligned with the beginning of every respective Nth physical sector. 2. The method recited in claim 1 , further comprising the step of aligning file rows within the computer system on logical sector boundaries defined by every Pth logical sector. 3. The method recited in claim 1, further comprising the steps of: aligning directory structures within the computer system on logical sector boundaries that are multiples of P logical sectors; and accessing said directory structures in multiples of P logical sectors beginning on those boundaries. 4. The method recited in claim 1, further comprising the steps of setting a file size attribute that controls the amount of data physically written to the storage medium at a time to a value equal to a multiple of P logical sectors. 5. The method recited in claim 1, further comprising the steps of altering an application program so that it issues writes requests in multiples of P logical sectors. 7. The method recited in claim 1 wherein P = 2 and N = 1. 8. The method recited in claim 1 wherein P = 5 and N = 2. 9. The method recited in claim 1 wherein the size of each logical sector is 180 bytes and the size of each physical sector is 512 bytes. 10. The method recited in claim 9 wherein P = 2 and N = 1. 11. The method recited in claim 9 wherein P = 5 and N = 2. 12. The method recited in claiml , wherein the remaining portion at the end of said each consecutive N physical sectors is used to hold one of (i) an error checking code, (ii) an error correcting code, (iii) an indication of a status of the N physical sectors of which it is a part, and (iv) other information concerning the N physical sectors of which it is a part. 13. In a computer system in which data is arranged in logical sectors, a method for enabling the computer system to store and retrieve data on a sector- formatted memory arranged in physical sectors, wherein the size of a logical sector is less than the size of a physical sector, said method comprising: filling a first N physical sectors with a first plurality P of consecutive logical sectors stored sequentially therein, the beginning of the first of said first plurality P of logical sectors being aligned with the beginning of the first of said first N physical sectors, P being greater than N; padding an unused remaining portion of the last of said first N physical sectors; and storing a next plurality P of consecutive logical sectors of data in a next N consecutive physical sectors of the sector-formatted memory, such that the beginning of the first of said next plurality P of consecutive logical sectors is aligned with the beginning of the first of said next N consecutive physical sectors. 14. The method recited in claim 13, further comprising the step of aligning file rows within the computer system on logical sector boundaries defined by every Pth logical sector. 15. The method recited in claim 13, further comprising the steps of: aligning directory structures within the computer system on logical sector boundaries that are multiples of P logical sectors; and accessing said directory structures in multiples of P logical sectors beginning on those boundaries. 16. The method recited in claim 13, further comprising the steps of setting a file size attribute that controls the amount of data physically written to the storage medium at a time to a value equal to a multiple of P logical sectors. 17. The method recited in claim 13, further comprising the steps of altering an application program so that it issues write requests in multiples of P logical sectors. 18. The method recited in claim 13 wherein P = 2 and N = 1. 19. The method recited in claim 13 wherein P = 5 and N = 2. 20. The method recited in claim 13 wherein the size of each logical sector is 180 bytes and the size of each physical sector is 512 bytes. 21. The method recited in claim 20 wherein P = 2 and N = 1. 22. The method recited in claim 20 wherein P = 5 and N = 2. 23. The method recited in claim 13, wherein the remaining portion at the end of said first N physical sectors is used to hold one of (i) an error checking code, (ii) an error correcting code, (iii) an indication of a status of the N physical sectors of which it is a part, and (iv) other information concerning the N physical sectors of which it is a part. 24. A computer system in which data is arranged in logical sectors and that is capable of storing and retrieving data on a sector-formatted storage medium arranged in physical sectors having a size that is greater than the size of the logical sectors within the computer system, said computer system operating to fill each consecutive N physical sectors of the sector-formatted memory with a plurality P of consecutive logical sectors of data stored sequentially therein, P being greater than N, such that a remaining portion at the end of said each consecutive N physical sectors is unfilled and the beginning of every Pth logical sector is aligned with the beginning of every respective Nth physical sector. 25. The computer system recited in claim 24, wherein file rows within the computer system are aligned on logical sector boundaries defined by every Pth logical sector. 26. The computer system recited in claim 24, wherein directory structures within the computer system are aligned on logical sector boundaries that are multiples of P logical sectors, and wherein said directory structures are accessed in multiples of P logical sectors beginning on those boundaries. 27. The computer system recited in claim 24, wherein an attribute that controls the amount of data that is physically written to the storage medium at a time is set equal to a multiple of P logical sectors. 28. The computer system recited in claim 24, wherein an application program issues write requests in multiples of P logical sectors. 29. The computer system recited in claim 24, wherein the remaining portion at the end of said each consecutive N physical sectors is used to hold one of (i) an error checking code, (ii) an error correcting code, (iii) an indication of a status of the N physical sectors of which it is a part, and (iv) other information concerning the N physical sectors of which it is apart.

Inventors: RUSS CRAIG F, SAUNDERS MICHAEL J, STELL JEFFERY A, RUSS, CRAIG, F., SAUNDERS, MICHAEL, J., STELL, JEFFERY, A.
Applicants: UNISYS CORP, UNISYS CORPORATION
Application year: 1999
Main classification: G11B20
IPC codes: G06F3, G11B20