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


Query phase

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

In the Query phase of select processing, the LFS queries the PFSs by calling vn_select(Query) with the vnode that is represented by each file descriptor.

During vn_select(Query), the PFS must:
  1. Return status information without taking any other action, if any requested event is immediately available.
  2. Otherwise, save the select token (16 bytes) and the Select_Options in a select-pending structure that is chained from its inode.

The Query phase ends as soon as any PFS reports immediate status. The remaining PFSs are contacted during the Cancel phase, so the user can receive the most information available at this time.

The LFS may omit recalling the PFS for the Cancel phase if:
  1. The PFS does not set any of the PFS_work_tokens, and
  2. For vfs_batsel, status is returned in the array entries.

If the PFS is dependent on being recalled for Cancel whenever it has been recalled for Query, it must set a PFS_work_token to some nonzero value. For optimal performance, the PFS should not have this dependence when it is able to report immediate status to the Query request.

If no PFS reports immediate status, the LFS waits for one of the PFSs to call osi_selpost, or for the time limit to expire.

Event occurrence: Eventually an event occurs asynchronously within a PFS for a given file. The PFS process or thread that handles these events notices that the file has selects pending for it. Examples of such events are: data arriving for a read, buffers freeing up for a write, or sessions terminating for an exceptional condition.

When such an event occurs, the PFS is expected to do the following:
  1. Scan through the select-pending structures that are chained from the inode for those that are waiting for this type of status.

    The PFS must serialize this with its own processing for Cancel; see Cancel phase.

  2. For each pending select that is satisfied:
    1. The PFS removes the select-pending structure, or marks it as "posted". The PFS must ensure that it never calls osi_selpost more than once for a particular vn_select(Query) request or select token.
    2. The osi_selpost routine is called with the select token saved during the Query phase.
The osi_selpost routine uses the select token to find the waiting process and thread and post it.
Note: The identity of the event that occurred is not passed to osi_selpost. This information is picked up by the LFS during the Cancel phase.

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014