z/OS UNIX System Services File System Interface Reference
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


vfs_sync — Harden all file data for a file system

z/OS UNIX System Services File System Interface Reference
SA23-2285-00

Function

The vfs_sync operation writes to disk (or otherwise stabilizes) all changed data in a buffer cache for files in a mounted file system.

Environment on entry and exit

See Environment for PFS operations.

Input parameter format

vfs_sync    (Token_structure,
             OSI_structure,
             Audit_structure,
             Return_value,
             Return_code,
             Reason_code)

Parameters

Token_structure
Supplied parameter
Type:
TOKSTR
Length:
Specified by TOKSTR.ts_hdr.cblen.

The Token_structure represents the file system (VFS) being operated on. It contains the PFS's initialization token and mount token. Refer to LFS/PFS control block structure for a discussion of this structure, and to the TOKSTR typedef in BPXYPFSI in Interface structures for C language servers and clients for its mapping.

OSI_structure
Supplied and returned parameter
Type:
OSI
Length:
Specified by OSI.osi_hdr.cblen.

The OSI_structure contains information used by the OSI operations that may be called by the PFS. See OSI services for more information.

It also contains MVS-specific information that needs to be passed to the PFS, including SMF accounting fields, a work area, a recovery area, and an optional pointer to an output ATTR structure. For more details on the OSI structure, see The OSI structure.

This area is mapped by the OSI typedef in BPXYPFSI in Interface structures for C language servers and clients.

Audit_structure
Supplied parameter
Type:
CRED
Length:
Specified by CRED.cred_hdr.cblen.

The Audit_structure contains information used by the security product for access checks and auditing. It is passed to most SAF routines that are invoked by the PFS.

Refer to Security responsibilities and considerations for a discussion of security processing, and to the CRED typedef in BPXYPFSI in Interface structures for C language servers and clients for the mapping of this structure.

Return_value
Returned parameter
Type:
Integer
Length:
Fullword
A fullword where the vfs_sync service returns the results of the operation as one of the following:
Return_value
Meaning
-1
The operation was not successful. The Return_code and Reason_Code values must be filled in by the PFS when Return_value is -1.
0
The operation was successful.
Return_code
Returned parameter
Type:
Integer
Length:
Fullword

A fullword in which the vfs_sync service stores the return code. The vfs_sync service returns Return_code only if Return_value is -1. See z/OS UNIX System Services Messages and Codes for a complete list of supported return code values.

The vfs_sync service should support at least the following error values:
Return_code Explanation
EROFS The file system is mounted read-only.
Reason_code
Returned parameter
Type:
Integer
Length:
Fullword

A fullword in which the vfs_sync service stores the reason code. The vfs_sync service returns Reason_code only if Return_value is -1. Reason_code further qualifies the Return_code value. These reason codes are documented by the PFS product.

Implementation notes

  • Overview of vfs_sync processing

    vfs_sync writes to non-volatile storage (usually disk) all modified data for each file in the mounted file system that is indicated by the mount token in the input token_structure. The PFS can use the synch daemon to synchronize modified data at regular intervals, by specifying the desired interval in the MTAB during the mount operation.

    A PFS could perform vfs_sync processing asynchronously, although this is not recommended. The osi_usersync flag in the OSI can be set to indicate to the PFS that the vfs_sync request is the result of a user request, rather than a timer pop. If this bit is set, the PFS must complete vfs_sync processing before it returns from the call.

    To allow for timer-driven cleanup, vfs_sync is called for readonly file systems also.

  • Specific processing notes

    Data should be completely hardened before vfs_sync returns to its caller.

  • Serialization provided by the LFS

    The vfs_sync operation is invoked with an exclusive latch held on the mounted file system.

  • Security calls to be made by the PFS: None.

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014