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

vn_map Entry Point

Purpose

Validates file mapping requests.

Syntax

int vn_map (vp, addr, length, offset, flags, crp)
struct vnode *vp;
caddr_t addr;
uint length;
uint offset;
uint flags;
struct ucred *crp;

Parameters

Note: The addr, offset, and length parameters are unused in the current implementation. The file system is expected to store the segment ID with the file in the gn_seg field of the g-node for the file.
vp Points to the virtual node (v-node) of the file.
addr Identifies the location within the process address space where the mapping is to begin.
length Specifies the maximum size to be mapped.
offset Specifies the location within the file where the mapping is to begin.
flags Identifies what type of mapping to perform. This value is composed of bit values defined in the /usr/include/sys/shm.h file. The following values are of particular interest to file system implementations:
SHM_RDONLY The virtual memory object is read-only.
SHM_COPY The virtual memory object is copy-on-write. If this value is set, updates to the segment are deferred until an fsync operation is performed on the file. If the file is closed without an fsync operation, the modifications are discarded. The application that called the vn_map entry point is also responsible for calling the vn_fsync entry point.
Note: Mapped segments do not reflect modifications made to a copy-on-write segment.
crp Points to the cred structure. This structure contains data that applications can use to validate access permission.

Description

The vn_map entry point is called by the logical file system to validate mapping requests resulting from the mmap or shmat subroutines. The logical file system creates the virtual memory object (if it does not already exist) and increments the object's use count.

Execution Environment

The vn_map 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 shmat subroutine, vn_fsync 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 ]