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


PFS processing

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

During these operations the PFS must:
  1. Fail the operation if the object already exists—that is, if the name is already in the directory.
  2. Otherwise, create the object and add an entry to the parent directory.

    A unique nonzero inode number that corresponds to the st_ino value of POSIX must be assigned to this object. This value only has to be unique within this file system and at this time. It may be reused after the object is deleted. For additional information about reusing file identifiers, see Exporting files to a VFS server.

    A directory object should be initialized by the PFS with the "." and ".." entries. For a root, ".." refers to itself, but for any other directory ".." refers to its parent directory. These entries are not strictly required by POSIX.

  3. Store at least the file's type, major number, and minor number from the passed ATTR structure with the stored attributes of the file. Whenever osi_getvnode is called, the PFS must construct and pass an ATTR structure, as would be returned by vn_getattr, so that the vnode can be built properly.
  4. Call SAF to create the FSP. The user credentials and ATTR mode bits from the interface and the FSP of the parent directory are passed to SAF, so that it can construct the FSP and do any auditing that is necessary. See Security responsibilities and considerations.
  5. Store the FSP with the rest of the attributes of the file.
  6. For vn_create and vn_mkdir, build an inode-vnode pair, as it would for a vn_lookup of this object, and return the corresponding vnode token.

The PFS is responsible for link counts, which must be initialized here. The link count of an object is the number of directory entries within the file system that point to the object. It is reported to a caller via vn_getattr, and changed by vn_link, vn_remove, vn_rmdir, and vn_rename.

Special consideration must be made for the "." and ".." entries when creating directories. "." implies that a directory's initial link count would be two. ".." implies that a directory's parent directory's link count has to be incremented when the child directory is created and decremented when it is deleted.

vn_link creates a new node in the file hierarchy, but it does not create a new object.

The LFS does not allow the creation of links (vn_link) to a directory.

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014