vfs_cntl Entry Point

Purpose

Implements control operations for a file system.

Syntax

int vfs_cntl (vfsp, cmd, arg, argsize, crp)
struct vfs * vfsp;
int  cmd;
caddr_t  arg;
unsigned long  argsize;
struct ucred * crp;

Parameters

Item Description
vfsp Points to the file system for which the control operation is to be issued.
cmd Specifies which control operation to perform.
arg Identifies data specific to the control operation.
argsize Identifies the length of the data specified by the arg parameter.
crp Points to the cred structure. This structure contains data that the file system can use to validate access permission.

Description

The vfs_cntl entry point is invoked by the logical file system to request various control operations on the underlying file system. A file system implementation can define file system-specific cmd parameter values and corresponding control functions. The cmd parameter for these functions should have a minimum value of 32768. These control operations can be issued with the fscntl subroutine.

Note: The only system-supported control operation is FS_EXTENDFS. This operation increases the file system size and accepts an arg parameter that specifies the new size. The FS_EXTENDFS operation ignores the argsize parameter.

Execution Environment

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

Return Values

Item Description
0 Indicates success.

Non-zero return values are returned from the /usr/include/sys/errno.h file to indicate failure. Typical values include:

Item Description
EINVAL Indicates that the cmd parameter is not a supported control, or the arg parameter is not a valid argument for the command.
EACCES Indicates that the cmd parameter requires a privilege that the current process does not have.