vnop_close Entry Point

Purpose

Closes a file associated with a v-node (virtual node).

Syntax

int vnop_close ( vp,  flag,  vinfo,  crp)
struct vnode *vp;
int flag;
caddr_t vinfo;
struct ucred *crp;

Parameters

Item Description
vp Points to the v-node.
flag Identifies the flag word from the file pointer.
vinfo This parameter is not used.
crp Points to the cred structure. This structure contains data that the file system can use to validate access permission.

Description

The vnop_close entry point is used by the logical file system to announce that the file associated with a given v-node is now closed. The v-node continues to remain active but will no longer receive read or write requests through the vnop_rdwr entry point.

A vnop_close entry point is called only when the use count of an associated file structure entry goes to 0 (zero).

Note: The v-node is held over the duration of the vnop_close entry point.

Execution Environment

The vnop_close entry point can be called from the process environment only.

Return Values

Item Description
0 Indicates success.

Nonzero return values are returned from the /usr/include/sys/errno.h file to indicate failure.

Note: The vnop_close entry point may fail and an error will be returned to the application. However, the v-node is considered closed.