__mount (BPX2MNT, BPX4MNT) — Make a file system available

Function

The __mount callable service mounts a file system, making the files in it available for use.

Requirements

Operation Environment
Authorization: Supervisor state or problem state, any PSW key
Dispatchable unit mode: Task
Cross memory mode: PASN = HASN
AMODE (BPX2MNT): 31-bit
AMODE (BPX4MNT): 64-bit
ASC mode: Primary mode
Interrupt status: Enabled for interrupts
Locks: Unlocked
Control parameters: All parameters must be addressable by the caller and in the primary address space.

Format

The syntax format is as follows:

AMODE 64 callers use BPX4MNT with the same parameters.

Parameters

Mnte_length
Supplied parameter
Type:
Integer
Length:
Fullword

The name of a fullword that contains the length of Mnte and its associated data structures, such as parameter string length.

Mnte
Supplied parameter
Type:
Character string
Character set:
No restriction
Length:
Specified by the Mnte_length parameter

The MNTE data structure. This is composed of a header field, the body field and an additional area for the parameter string if one is being used. This structure is mapped by BPXYMNTE (see BPXYMNTE — Map response and element structure of w_getmntent). See the usage notes for the fields in this data structure that must be set for the different __mount requests.

Return_value
Returned parameter
Type:
Integer
Length:
Fullword

The name of a fullword in which the __mount service returns 0 or 1 if the request is successful, or -1 if it is not successful. A Return_value of 1 indicates that the mount will complete asynchronously.

Return_code
Returned parameter
Type:
Integer
Length:
Fullword
The name of a fullword in which the __mount service stores the return code. The __mount service always returns Return_code if Return_value is -1. For a complete list of possible return code values, see z/OS UNIX System Services Messages and Codes. The __mount service can return one of the following values in the Return_code parameter:
Return_code Explanation
EACCESS The user who is doing this nonprivileged mount does not have access to either the mount point or root. The following reason code can accompany the return code: JRNoMntPtAccess, JRNoRootAccess.
EBUSY The file system to be mounted is quiesced; or no more locks are available. The following reason codes can accompany the return code: JROutOfLocks, JRQuiesced.
EINVAL There was a parameter error. Verify the Mount_mode and File_system_type (specified in the MNTE data structure). Other reasons for this error include:
  • The mount point is a root of a file system.
  • The file system is already mounted.
  • The parm_length is too long.
  • A mounted file system has a real or alias name that conflicts with this mount request. One of these situations occurred:
    • A file system was previously mounted using an alias data set name, and the corresponding real data set name conflicts with the file system name specified by this mount request.
    • The file system name specified on this mount request is an alias data set name that has a real data set name which conflicts with the name of a previously mounted file system. Resolve the duplicate file system names.

    Resolve the duplicate file system names and reissue the mount request.

The following reason codes can accompany the return code if it is a nonprivileged user mount: JRNotSupportedForFileType, JRFileSystemMigrated, JRSecurityConflict, JRNoSetUID, JRSysNameNotAllowed, JRPFSNotSupported.

The following reason codes can accompany the return code: JROutOfLocks, JRQuiesced, JRIsMountedRealName.

EIO An I/O error occurred.
ELOOP A loop exists in symbolic links that were encountered during resolution of the Pathname argument. This error is issued if more than 24 symbolic links are detected in the resolution of Pathname.
ENOENT The mount point does not exist. The following reason code can accompany the return code: JRMountPt.
ENOMEM There is not enough storage space available to mount this file system.
ENOTDIR The mount point is not a directory. The following reason code can accompany this return code: JRMountPt.
ENOTEMPTY The mount point directory is not empty for the nonprivileged user mount.
EPERM Insufficient authority to do the mount.
Reason_code
Returned parameter
Type:
Integer
Length:
Fullword

The name of a fullword in which the __mount service stores the reason code. The __mount service returns Reason_code only if Return_value is -1. Reason_code further qualifies the Return_code value. For the reason codes, see z/OS UNIX System Services Messages and Codes.

Usage notes

  1. The caller must be APF-authorized or must be running for a user with mount authority.
  2. The __mount service effectively creates a virtual file system. After a file system is mounted, references to the path name that is mounted refer to the root directory on the mounted file system.
  3. A file system can be mounted at only one point.
  4. Parameter specifics for the HFS physical file system:
    • The File_system_name value must be uppercase, and must be the name of the data set.
  5. The physical file system may complete the __mount operation asynchronously, which is indicated by a Return_value of 1. The w_getmntent callable service can then be used to determine if the file system has been mounted.
  6. The MNTE eye-catcher must be set to MNT2. Additionally, the length of the body following the header must be set into MNTEHBLEN, the body length field in the header.
    • When setting character string values like SYSNAME or FROMSYSNAME, in general, these fields are set with the strings left justified and blank padded. Should data in these fields be unrequired or absent, the values should be set to nulls. Consult the data structure definition for specifics.
    • When requesting a change to an already mounted file systems, the MNTENTCHANGE bit must be set on. Additionally, when requesting that the AUTOMOVE setting be changed, the MNTENTNEWAUTO bit must be set on.
    • When requesting a mount of a file system, as opposed to a change, none of the MNTENTRFLAGS are expected to be set on.
    • When requesting that a collection of file systems be moved from one system to another, the following fields must be set: FROMSYS (to indicate where the file systems are to be moved from); SYSNAME (to indicate where the file systems are to be relocated); and Rflags (to indicate that this is a change mount request). The other fields will be ignored.
    • When requesting a single file system move, the mount point or the file system name must be specified. Do not specify both. Additionally, the name of the system that the file system should be moved to should be specified in SYSNAME. If you plan to change an AUTOMOVE setting, set the new value in the bit of the FSmode word. The Rflags setting will specify that MNTENTCHANGE=ON, which indicates that the change is a chmount request. You should set MNTENTNEWAUTO only if the request intends to change the AUTOMOVE setting to what is reflected in the MNTENTFSNOAUTOMOVE value.

      For more information about SYSNAME and AUTOMOVE, see Customizing BPXPRMxx for a shared file system in z/OS UNIX System Services Planning. The chmount command is explained in the chmount command description inz/OS UNIX System Services Command Reference.

    • When requesting a mount on a system other than the one the mount command is executed on, the MNTENTSYSNAME field will denote the system that will "own" the file system. Fields that must be set to request a mount are: Filemode settings (such as read or write), FILESYSNAME, FILESYSTYPE, and pathname. Other fields that can be optionally set are: parameter string and systemname.

Characteristics and restrictions

  1. In order to mount a file system, the caller must be an authorized program, or must be running for a user with mount authority. For more information about mount authorization, see z/OS UNIX System Services Planning.
  2. A file system cannot be moved while it is being exported by the DFS server. It must first be unexported from DFS.
  3. Typically, an EBUSY signal is returned when a file system is quiesced. In a sysplex, however, the __mount() syscall suspends until the file system becomes unquiesced.

Examples

For an example using this callable service, see BPX2MNT (__mount) example.