[ Previous | Next | Contents | Home | Search ]
AIX Version 4.3 Kernel and Subsystems Technical Reference, Volume 1

vn_remove Entry Point

Purpose

Unlinks a file or directory.

Syntax

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

Parameters

vp Points to a virtual node (v-node). The v-node indicates which file to remove and is held over the duration of the vn_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 vn_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 vn_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 vn_remove entry point calls the vn_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 vn_remove entry point can be called from the process environment only.

Return Values

0 Indicates success.

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

Related Information

The unlink subroutine.

The vn_rele entry point.

Virtual File System Overview, Virtual File System Kernel Extensions Overview, Logical File System Overview, Understanding Virtual Nodes (V-nodes) in AIX Kernel Extensions and Device Support Programming Concepts.

List of Virtual File System Operations.


[ Previous | Next | Contents | Home | Search ]