| United States-English |
|
|
|
![]() |
Communicator 3000 MPE/iX Release 6.5 (Non-Platform Software Release C.65.00): HP 3000 MPE/iX Computer Systems > Chapter 3 Growth SolutionMPE/iX Large Files Overview |
|
by Craig Fairchild This document describes the changes to the MPE/iX operating system as a result of the initial addition of Large File functionality. In this document, Large Files are defined as any file greater than 4GB - 64KB (4,294,901,760 bytes) which was the maximum file size prior to release 6.5. For the sake of brevity, this value is referred to somewhat inaccurately as "4GB" for the rest of this document. The addition of Large File support to MPE/iX increases the maximum file size supported by MPE/iX from the former limit of 4GB to 128GB for release 6.5. In the future, additional increases in supported file size can be expected as customer needs demand. In this first release of Large File support, two types of files are supported for file sizes beyond 4GB. These are ordinary, fixed length record files, and a new type of KSAM file, KSAM64. A phased approach to Large File support has been taken to get Large File functionality to market in the quickest possible time frame. Several customer surveys have indicated that these two file types are the most needed for Large File support. Large File support of KSAM files requires the addition of yet another KSAM file type. Due to the internal structure of CM KSAM and KSAM XL files, these file types cannot support file sizes beyond 4GB. The implication of this was that in order to meet our customer demand of Large File KSAM support, a new KSAM file type needed to be defined. This new KSAM file type is the KSAM64 file, or file type 7. KSAM64 files have an improved, generalized internal structure that allows them to support file sizes from one record to the maximum object size of 128GB. KSAM64 files are externally identical to KSAMXL files (and support all CM KSAM intrinsic calls as well). Large File support has been added to MPE/iX as seamlessly as possible. Large File support has been implemented within the OS so that Large Files are available on all HP 3000 models. Large Files are created by simply specifying a file limit which is sufficiently large. This can be done interactively through the BUILD or FILE commands, or programmatically through the FOPEN and HPFOPEN intrinsics. Opening an existing Large File is as transparent as opening any other file. All system intrinsics will work on Large Files in the exact same manner as any normal sized file. As a matter of fact, if your program accesses files through MPE/iX intrinsics, it is highly likely that there will be no need to make any changes at all to operate on Large Files. A large part of the ease of Large File use lies in the fact that access to files in MPE/iX is done through a record-oriented interface. All interfaces to the OS still deal with signed 32-bit integers to indicate record numbers. This means that there are really two factors that serve to limit maximum file sizes, the maximum number of records in a file, and the maximum object size supported on MPE/iX. The following table shows how the record size of an ordinary fixed-length record file can affect the maximum size of file.
This document is intended to describe all the external functions, features, and changes that have been introduced with Large File support. The document itself is broken into four sections:
This section covers the compatibility issues that users need to be aware of when dealing with Large Files. In most cases applications and users are unaware that the file that they are operating on is a Large File. Even though Large Files are highly transparent, there are some rare situations that can produce results that are either incompatible or in error when dealing with Large Files instead of normally-sized files. The following sections highlight and describe the issues that can affect access to Large Files. MPE/iX currently supports two types of user-mapped access to files; short-mapped access and long-mapped access. Short-mapped access provides a 32-bit pointer for a user application to directly access a file. There are several limitations to short-mapped access. For example, a file must be 4MB or less and the total of all short-mapped access files for a process must be less than 6MB. Long-mapped access provides a 64-bit pointer to access a file of any size, up to the previous maximum file size of 4GB. Due to the way that existing MPE/iX compilers emit instructions to access memory, problems can result when accessing Large Files with a Large File pointer. Long pointers on PA-RISC hardware are defined to have two separate parts; a space ID, and an offset within that space. This also corresponds to the way virtual memory is defined in PA-RISC -- a 64-bit address broken down into the high 32-bits defining the space of the address, and the lower 32-bits defining the offset within that space. When building instructions to access memory, the space ID must first be loaded into a space register. The offset portion of the address is then loaded into a general register and the space register/general register pair is used to de-reference virtual memory. When adding to the pointer, the general register is incremented and then used in conjunction with the space register that was previously loaded. When the maximum file size supported on the system was 4GB (the size of each space), all valid file offsets were found within a single space, and there was no need to change the space ID. The advent of Large Files makes it possible for a single file to cross multiple space ID boundaries. This presents a problem for existing code which uses long-mapped access. When the general register holding the offset is incremented to the point that it overflows, logically it should reference the first word in the next space. However, because the space ID is held in a separate space register, the overflow of the general register is lost. The net effect is that access loops back to the beginning of the current space rather than moving on to the next space as intended. In order to prevent applications from inadvertently stumbling across this data access problem, normal long-mapped access to Large Files has been made illegal. Any attempt to open a Large File for long-mapped access (HPFOPEN option 21) results in an error. In order to open a Large File for user-mapped access, a new large-mapped option must be passed (HPFOPEN option 87). This new large-mapped option works on both Large Files as well as normal-sized files. In programs that wish to continue to access Large Files through user-mapped access, all instances of HPFOPEN calls for long-mapped access (option 21) need to be changed to large-mapped access (option 87). The pointer that is returned is still a 64-bit pointer which is equivalent in every way to the pointer type returned by the long-mapped option. By specifying this new large-mapped access option, the option assumes that the caller is indicating their awareness of cross space ID problem and ensures that the program logic correctly handles any cross space ID buffer. The workaround to this problem is actually fairly simple. Any access that would normally span a space ID boundary needs to be broken into two separate accesses, one for each side of the space ID boundary. This can be done within the calling application directly, or by calling the new intrinsics described in section 3 of this document. In order to open a Large File for user-mapped access, the new HOP_OPTION_LARGE_MAPPED (87) option must be passed instead of the long-mapped option. Two current items of the FLABELINFO intrinsic are unable to return information on some Large Files. These items are described in the following table:
There are a number of FFILEINFO, FGETINFO and FLABELINFO items that return information on the maximum file size of a file, or the current size of a file. While each of these items (with the exception noted above) works without change on Large Files, it is possible that programs that perform arithmetic on the values returned from these functions could experience integer overflow traps when dealing with very large files. An example of such an operation is multiplying the number of records in a file by the record size to get an estimation of the total size of a file. With normal-sized files, the result of this multiplication is guaranteed to never overflow an unsigned 32-bit integer. However, with Large Files, the result of this multiplication could be a value up to 128 GB, which could be much larger than a value that can be represented in 32-bits. In such cases, the result of the multiplication would need to be assigned to a 64-bit integer. If any of the items listed above are used in mathematical computations, especially when a record number item is multiplied by a record or block size, care must be taken to determine whether or not it is possible to overflow a 32-bit integer. The Architected Interfaces for operating system information (AIF:OS) are a set of privileged routines that provide a supported means of accessing and altering internal system data structures. Because of the need to enhance these data structures to provide Large File support, some corresponding changes to a few AIF:OS routines are required. Each of the affected AIF:OS items follows a similar form. A 32-bit value is currently being returned, which cannot express the capacity of a Large File. In each case a new item number has been defined which works with a 64-bit value and can be used safely for either large or normal sized files. The following table describes each of the AIF:OS items that return errors for Large Files, as well as the new items that have been added to supplant the older items: As a side effect of adding support for the KSAM64 file type, a new file type value, 7, has been allocated for KSAM64 files. The foptions structure is a 16-bit value made up of various bit fields. Several intrinsics accept or return foptions including FOPEN, FFILEINFO, FLABELINFO, and FGETINFO. The definitions of the foptions are:
The addition of KSAM64 support in no way alters the format of the foptions structure. Rather, a previously undefined value in the file type field, 7, is now defined. The list of defined file types which can be returned in the foptions is:
In general, the definition of this previously undefined value will not cause any compatibility issues for programs. The only time that issues could arise is if code performed some type of validity check on the file type field of the foptions. In the case that user code is checking and rejecting a value of 7 in the file type field, the workaround would be to eliminate this check, or add 7 to the list of valid values. Although the impact of Large Files is negligible on most CI commands, there are several minor enhancements to a few commands. All CI commands work on Large Files in the exact same manner as they do for normal sized files. RENAME still renames Large Files, PURGE still purges them, and so on. The commands documented in this section have been enhanced to support some Large File features. With the first release of Large File support, only two file types are being supported for Large File sizes; ordinary, fixed length record files, and KSAM files. Because of inherent limitations in the internal format of KSAMXL and CM KSAM files, it is necessary to introduce a new type of KSAM file, KSAM64 files, in order to go beyond a 4GB sized KSAM file. The internal format of the KSAM64 index area is structured so that file sizes from 1 record all the way to 1TB can be easily supported.While unfortunately, this means that MPE/iX supports three different varieties of KSAM files (CM KSAM, KSAMXL and KSAM64), the good news is that all three of these file types are functionally equivalent and can be used interchangeably by programs. The only external difference between KSAMXL and KSAM64 files is that a different file type must be used to create them. Other than this, all other KSAM options are specified identically. The only change to the BUILD command is the addition of the KSAM64 file type keyword. This keyword can be included in the BUILD command as a replacement for the KSAMXL keyword. KSAM64 files may be of any file size, but are the only KSAM file type that can be larger than 4GB. The new syntax for the BUILD command is: BUILD filereference [F] In order to create a Large File, all that is required is to specify a file limit of a sufficiently large number. For example, to create a ordinary, fixed length record file with 80 byte records that had a maximum capacity of about 8GB, a file limit of 100,000,000 records would need to be specified. For example, the following command could be used: BUILD TESTFILE;REC=-80,,F,ASCII;DISC=100000000 Specifying a file limit that is greater than 4GB for any type of file other than ordinary fixed length record files and KSAM64 files will result in an error. The FILE and BUILD command syntaxes always mirror each other. It follows, then, that the new KSAM64 file type keyword is also being added to the FILE command, in the exact same way as the BUILD command. The new FILE syntax is included below: =*formaldesignator The LISTF, LISTFILE, and LISTFTEMP commands all can be used to display information about Large Files. All of the various LISTF and LISTFILE formats continue to work with normal sized files as well as Large Files. File type information about KSAM64 files is displayed in the LISTF family of commands as a lowercase 'k'. In order to display information about Large Files, two new file format options have been introduced. The LISTF, LISTFILE, and LISTFTEMP commands now support options 10 (SUMMARYWIDE) and 11 (DISCWIDE). File format option 10 is the Large File equivalent of file option "1", containing all the same information, but in a new format that allows for the expression of larger values. Similarly, the format option 11 is the Large File equivalent of file option "2". Again, the same basic information is displayed, but the format has been changed to allow for a greater range of values to be displayed. The syntax of the LISTF, LISTFILE, and LISTFTEMP commands has not been changed with the addition of the new 10 and 11 format options. The same syntax can be used with the new values of 10 and 11 as the format. The output of the new formats varies depending on whether or not MPE/iX syntax names are being displayed or HFS syntax names are being displayed. The format for each of the MPE/iX and HFS syntax varieties of the new formats 10 and 11 can be seen from the examples shown below: :listf @,10 ACCOUNT= SYS GROUP= EXAMPLE Name Access FCode RecSiz Type EOF File Limit -------- ERWS ----- ------ ----- ------------- ------------- BIGFILE 1024 FA 0 1023456789 :listfile ./@,10 Access FCode RecSiz Type EOF File Limit Name :listf @,11 Name Access FCode RecSiz Type EOF File Limit Disk Usage Exts :listfile ./@,11 The display for the format options 10 and 11 is the same for each of the LISTF, LISTFILE, and LISTFTEMP commands. One of the unique additions of these two new options is the "ERWS" column. This column indicates whether or not the file is currently opened, and if so, for what type of access. An "E" in the E column indicates that the file is opened for Exclusive access, the "R" in the R column indicates that the file is opened for Read access, the "W" in the W column indicates that the file is opened for Write access, and the "S" in the S column indicates that the file is being Stored by the STORE or TurboSTORE utility. The column may have one or more of these characters specified, or none, depending on how the file is currently accessed. As part of the addition of Large File support to MPE/iX several intrinsics changes have been introduced. This encompasses both the modification of existing intrinsics, as well as the introduction of a new set of intrinsics. This chapter describes all of the intrinsics changes that have been implemented as a part of Large File support. Relatively few changes have been necessary to the existing file system intrinsics in order to implement Large Files. The majority of these changes are in support of adding 64-bit return values for file byte offsets. As described in the section "User-Mapped Access to Files", when performing user-mapped access to Large Files, care must be taken to not attempt to dereference a buffer that crosses a SID boundary. In order to ensure that programs are aware of this caveat, traditional attempts to open a Large File for user-mapped access will fail. In order to open a Large File for user-mapped access, a new HOP_OPTION_LARGE_MAPPED option (item number 87) must be used, as described in the following table:
Three new items will be supported by the FLABELINFO intrinsic. These new options are described in the table below:
Two new items have been added to the FFILEINFO intrinsic. These items are described in the table below:
The following new intrinsics are being added to aid in the support of user-mapped file access. These intrinsics can be used for pointer manipulation and data movement on any user-mapped file; short-mapped, long-mapped, or large-mapped. They are especially recommended for use with the large-mapped HPFOPEN option. NM callable only.This routine can be used to perform arithmetic on a 64-bit pointer value. Byte offsets can be added to or subtracted from a pointer by specifying either a positive or negative offset value. Syntax
Parameters
This routine can be used to efficiently move data from a source buffer to a target buffer. Syntax
Parameters
This routine can be used to efficiently move data from a source buffer to a target buffer. If the source and target buffers were viewed horizontally, like a line of text, the data movement is performed by starting at leftmost position of the source buffer (to the leftmost position of the target buffer) and proceeding to the rightmost. Syntax
Parameters
This routine can be used to efficiently move data from a source buffer to a target buffer. If the source and target buffers were viewed horizontally, like a line of text, the data movement is performed by starting at the rightmost position of the source buffer (to the rightmost position of the target buffer) and proceeding to the leftmost. Syntax
Parameters
This routine can be used to efficiently initialize a buffer with a specified character value. Syntax
Parameters
This section covers several issues that are related to Large Files that may be of interest to the reader. The STORE and RESTORE utilities have been modified to handle Large Files. This enhancement was accomplished in such a fashion that STORE tapes with Large Files are completely compatible with previous versions of the operating system. A STORE tape created on release 6.5 can be taken to any other MPE/iX system and be successfully restored. On systems prior to 6.5, any Large File on the tape is not recognized as a valid file and will not be restored onto the system. Although Large Files are skipped over in this scheme, all other files will be able to be restored. Any attempt to store a Large File using the ;TRANSPORT STORE option results in an error at store time. In addition to the STORE/RESTORE and TurboSTORE products all supporting Large Files, most, if not all, 3rd party backup products have also been enhanced to support Large Files. If you rely on 3rd party backup tools, please refer to your vendor for information regarding the proper updates and procedures for using these tools on release 6.5. If for some reason it is necessary to "backdate" your system from the 6.5 release to a prior MPE/iX release, very little extra work is required due to Large Files. Before attempting the backdate operation, the 6.5 system must be shut down completely with the CNTRL-A SHUTDOWN command. You must also wait for the final system shutdown message to appear before resetting the system and beginning the UPDATE command on the earlier MPE/iX release. Any Large Files that are in the directory structure of the system are unusable once the system is backdated to a release earlier than 6.5. The Large Files can be purged from the older system via the :PURGELINK command. Any other attempt to open or manipulate a Large File results in an error. Once the system is again updated to release 6.5 or beyond, the Large Files are once again accessible. Nearly all utilities and subsystems support Large Files without change. This runs the spectrum from FCOPY to SORT. The only word of caution is that not all utilities and subsystems support file sizes that are less than 4GB. This includes such things as EDITOR or HPEDIT. The general rule of thumb is if it doesn't work on a 3GB file, it won't work on a Large File. One exception of note is the DSCOPY subsystem. DSCOPY has not been enhanced to be able to transfer Large Files, or the new KSAM64 files. The FTP utility has been enhanced to do network transfers of these files, and is the preferred utility for network file transfer. The introduction of Large Files has had no impact on the IMAGE/SQL product. Large database support is still accomplished by use of Jumbo Datasets. Therefore there are no compatibility issues to be concerned with in regards to changes in your IMAGE/SQL databases. Version A.01.29 of HP SRC does not support KSAM64 files. If an attempt is made to check in a KSAM64 file, error 387 will be reported. Java programs will be able to access large MPE/iX files by using Java Native Interface (JNI) to call MPE/iX intrinsics, but will not be able to access Large Files via the java.io APIs. The java.io APIs treat all files as bytestream files and access these files through the POSIX C language APIs. The first release of Large Files for MPE/iX does not include support for bytestream files larger than 2GB in size; therefore, there can be no Large Files that are also bytestream files in this release. HPSearch/iX has been changed to provide for searching of Large Files. Additionally, it has been enhanced to search KSAM64 and KSAMXL files. HPGlancePlus/iX has been changed to display file information about Large Files. Also, KSAM64 files are included in the File Display on the Process Screen and will show a type of KSM64. HPEdit/iX does not support files of 2,000,000 records or more, and so, does not support Large Files. COBOL II/iX supports Large Files. No changes are necessary to existing COBOL II/iX programs to read, write, and update Large Files. KSAM64 files are supported by the Indexed I-O module. When you open a file with indexed organization, that file is permitted to be an existing KSAM64 file. When COBOL II/iX creates a file with indexed organization, by default it will create a KSAM XL file. However, you may override the default by issuing a FILE command specifying KSAM64 as the file type. COBOL II/CM does not support KSAM64 files. An attempt to open or create a KSAM64 file with a CM COBOL program will result in file status 39 and, typically, a program abort with COBOL error 648. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||