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

vn_get Kernel Service

Purpose

Allocates a virtual node.

Syntax

#include <sys/types.h>
#include <sys/errno.h>
int vn_get (vfsp, gnp, vpp)
struct vfs *vfsp;
struct gnode *gnp;
struct vnode **vpp;

Parameters

vfsp Points to a vfs structure describing the virtual file system that is to contain the v-node. Any returned v-node belongs to this virtual file system.
gnp Points to the g-node for the object. This pointer is stored in the returned v-node. The new v-node is added to the list of v-nodes in the g-node.
vpp Points to the place in which to return the v-node pointer. This is set by the vn_get kernel service to point to the newly allocated v-node.

Description

The vn_get kernel service provides a mechanism for allocating v-node objects for use within the virtual file system environment. A v-node is first allocated from an effectively infinite pool of available v-nodes.

Upon successful return from the vn_get kernel service, the pointer to the v-node pointer provided (specified by the vpp parameter) has been set to the address of the newly allocated v-node.

The fields in this v-node have been initialized as follows:

v_count Set to 1.
v_vfsp Set to the value in the vfsp parameter.
v_gnode Set to the value in the gnp parameter.
v_next Set to list of others v-nodes with the same g-node.

All other fields in the v-node are zeroed.

Execution Environment

The vn_get kernel service can be called from the process environment only.

Return Values

0 Indicates successful completion.
ENOMEM Indicates that the vn_get kernel service could not allocate memory for the v-node. (This is a highly unlikely occurrence.)

Implementation Specifics

The vn_get kernel service is part of Base Operating System (BOS) Runtime.

Related Information

The vn_free kernel service.

Virtual File System Overview and Virtual File System (VFS) Kernel Services in AIX Kernel Extensions and Device Support Programming Concepts.


[ Previous | Next | Contents | Home | Search ]