vnop_fclear Entry Point

Purpose

Releases portions of a file.

Syntax

int vnop_fclear (vp, flags, offset, len, vinfo, crp)
struct vnode * vp;
int  flags;
offset_t  offset;
offset_t  len;
caddr_t  vinfo;
struct ucred * crp;

Parameters

Item Description
vp Points to the virtual node (v-node) of the file.
flags Identifies the flags from the open file structure.
offset Indicates where to start clearing in the file.
len Specifies the length of the area to be cleared.
vinfo This parameter is unused.
crp Points to the cred structure. This structure contains data that the file system can use to validate access permission.

Description

The vnop_fclear entry point is called from the logical file system to clear bytes in a file, returning whole free blocks to the underlying file system. This entry point performs the clear regardless of whether the file is mapped.

Upon completion of the vnop_fclear entry point, the logical file system updates the file offset to reflect the number of bytes cleared. Also upon completion, if either the starting or ending offset is past the starting end of file, the file is extended.

Execution Environment

The vnop_fclear 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.