Previous topic |
Next topic |
Contents |
Contact z/OS |
Library |
PDF
Getting and setting attributes z/OS UNIX System Services File System Interface Reference SA23-2285-00 |
|
The PFS is responsible for storing file attributes with its files. POSIX users can read these attributes with such functions as stat(), and set various attributes through such functions as chmod(). A VFS server does the same things with v_getattr() and v_setattr(). All of this is passed through to the PFS when the LFS calls the vn_getattr or vn_setattr service with the ATTR structure (BPXYATTR). The ATTR structure is the file attribute interface between the LFS and the PFS. It contains all the fields of the POSIX STAT structure, plus z/OS UNIX extensions that the PFS may support if it can. A file's attributes are logically split between the security-related and non-security-related attributes. The security-related attributes are kept in the file security packet, IRRPIFSP, or FSP for short. The FSP is stored with the attributes of the file by the PFS, but it is created and changed only through SAF-defined routines. The FSP contains the file's mode bits, UID, and GID; it may also contain other information that is defined by the security product. The FSP is the file attribute interface between the PFS and SAF. Refer to Security responsibilities and considerations and Creating files for more details on SAF and the FSP. Serialization: The vn_getattr service is invoked with a shared vnode latch, and the vn_setattr service with an exclusive latch. vn_getattr and vn_setattr do not require vn_open, although the file may be open for read or write at the time of these calls. Reads and writes would not be in progress at the time of the get or set. All times in the ATTR structure are specified in POSIX format, which is "Seconds Since the Epoch" (00:00:00 January 1, 1970, Coordinated Universal Time). The PFS may keep time values internally in any format, but they must be in POSIX format across the LFS-PFS interface. The ATTR structure's header is initialized with the ATTR's length before any get or set call. The vn_getattr protocol is as follows:
The vn_setattr protocol is as follows:
Note: To optimize performance for VFS servers, several of the
vnode operations, such as vn_lookup and vn_rdwr, pass an ATTR structure
pointer in the OSI structure and expect an implicit vn_getattr to
be performed at the end of the current operation. If the PFS cannot
support this, the LFS calls vn_getattr after the operation in question.
This flow has poorer performance when accessing files owned by this
PFS.
|
Copyright IBM Corporation 1990, 2014
|