[ Bottom of Page | Previous Page | Next Page | Contents | Index | Library Home | Legal | Search ]

Technical Reference: Kernel and Subsystems, Volume 1

lookupvp Kernel Service

Purpose

Retrieves the v-node that corresponds to the named path.

Syntax

#include <sys/types.h>
#include <sys/errno.h>


int lookupvp ( namep, flags, vpp, crp)
char *namep;
int flags;
struct vnode **vpp;
struct ucred *crp;

Parameters

crp Points to the cred structure. This structure contains data that the file system can use to validate access permission.
namep Points to a character string path name.
flags Specifies lookup directives, including these six flags:
L_LOC
The path-name resolution must not cross a mount point into another file system implementation.
L_NOFOLLOW
If the final component of the path name resolves to a symbolic link, the link is not to be traversed.
L_NOXMOUNT
If the final component of the path name resolves to a mounted-over object, the mounted-over object, rather than the root of the next virtual file system, is to be returned.
L_CRT
The object is to be created.
L_DEL
The object is to be deleted.
L_EROFS
An error is to be returned if the object resides in a read-only file system.
vpp Points to the location where the v-node pointer is to be returned to the calling routine.

Description

The lookupvp kernel service provides translation of the path name provided by the namep parameter into a virtual file system node. The lookupvp service provides a flexible interface to path-name resolution by regarding the flags parameter values as directives to the lookup process. The lookup process is a cooperative effort between the logical file system and underlying virtual file systems (VFS). Several v-node and VFS operations are employed to:

The lookupvp kernel service determines the process's current and root directories by consulting the u_cdir and u_rdir fields in the u structure. Information about the virtual file system and file system installation for transient v-nodes is obtained from each name component's vfs or gfs structure.

Execution Environment

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

Return Values

0 Indicates a successful operation.
errno Indicates an error. This number is defined in the /usr/include/sys/errno.h file.

Related Information

Understanding Data Structures and Header Files for Virtual File Systems in AIX 5L Version 5.2 Kernel Extensions and Device Support Programming Concepts.

Virtual File System Overview in AIX 5L Version 5.2 Kernel Extensions and Device Support Programming Concepts.

Virtual File System (VFS) Kernel Services in AIX 5L Version 5.2 Kernel Extensions and Device Support Programming Concepts.

[ Top of Page | Previous Page | Next Page | Contents | Index | Library Home | Legal | Search ]