vnop_remove Entry Point

Purpose

Unlinks a file or directory.

Syntax

int vnop_remove ( vp,  dvp,  name,  crp)
struct vnode *vp;
struct vnode *dvp;
char *name;
struct ucred *crp;

Parameters

Item Description
vp Points to a virtual node (v-node). The v-node indicates which file to remove and is held over the duration of the vnop_remove entry point.
dvp Points to the v-node of the parent directory. This directory contains the file to be removed. The directory's v-node is held for the duration of the vnop_remove entry point.
name Identifies the name of the file.
crp Points to the cred structure. This structure contains data that the file system can use to validate access permission.

Description

The vnop_remove entry point is called by the logical file system to remove a directory entry (or link) as the result of a call to the unlink subroutine.

The logical file system assumes that the vnop_remove entry point calls the vnop_rele entry point. If the link is the last reference to the file in the file system, the disk resources that the file is using are released.

The logical file system ensures that the directory specified by the dvp parameter does not reside in a read-only file system.

Execution Environment

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