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


Close processing

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

The open_flags passed on vn_close indicate which access and deny counters need to be decremented. These counters can include flags that originated on more than one vn_open. The type of open that is being closed is indicated in the ts_sysd1 field, as follows:
VNOPEN_FILE
Used for POSIX close() and NFS V4 v_close().
VNOPEN_NLM_SHR
Used for a Network Lock Manager UnShare.
VNOPEN_INTERNAL
Used for an internal LFS close that bypasses all Share processing

When Share Reservations are released and a deny counter goes to zero there can be blocked vn_opens that need to be posted.

The total count of vn_opens for any given file can not equal the total count of vn_closes for that file, due to the upgrades and downgrades of a client's open context. For example, the following sequences are possible:
vn_open(Read),  vn_open(Write),  vn_close(Read, Write) 
vn_open(Read),  vn_open(DenyWrt),  vn_close(DenyWrt), vn_open(Write), vn_close(Read,Write)
vn_open(Read,Write),  vn_open(Read), vn_close(Write),  vn_close(Read), vn_close(Read)   

The sum of all vn_closes for any one type of access or reservation will equal the sum of all vn_opens that requested that type of access or reservation. For example, in the third sequence, the sum of all vn_opens that specified O_RDONLY equal the sum of all vn_closes with O_RDONLY on.

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014