vm_ioaccessp Kernel Service

Purpose

Initiates asynchronous page-in or page-out for the range of pages specified.

Syntax

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

int vm_ioaccessp ( bsid, pfirst, npages, modifier)
vmid_t bsid;
vpn_t pfirst;
vpn_t npages;
uint modifier;

Parameters

Item Description
bsid Identifies the base segment.
pfirst The first page number within the range.
npages The number of pages to access starting from the pfirst value. All pages must be in the same segment.
modifier Flags passed in by the user. These flags are detailed below.

Description

The vm_ioaccessp kernel service routine enables a client file system with a thread-level strategy routine to access the pages specified. This call is strictly advisory and might return without having done anything. If you want to actually move the data, call the vm_uiomove kernel service. If you want to pre-page the target, then call the vm_readp kernel service.

The flags passed in through the modifier parameter determine what type of action taken by the vm_ioaccessp kernel service. For details of each flag's purpose, see the table below.

The flags carry certain restrictions. You cannot request both a make and a flush operation. Also, if the VM_IOACCESSP_WAITONLY flag is declared then you must specify at least one type of wait operation. Finally, you cannot request a make or a flush operation if the VM_IOACCESSP_WAITONLY flag is declared.

Flags

Value Name Purpose
0x0001 VM_IOACCESSP_MAKE Creates new pages in the page-in state in the specified range. Can only make up to 1MB of pages.
0x0002 VM_IOACCESSP_FLUSH Flushes pages in the specified range.
0x0004 VM_IOACCESSP_PGINWAIT If a page in the specified range is in page-in state, then block until page-in is complete.
0x0008 VM_IOACCESSP_PGOUTWAIT If a page in the specified range is in page-out state, then block until page-out is complete.
0x0010 VM_IOACCESSP_WAITONLY Returns once the specified wait is complete. The VM_IOACCESSP_PGINWAIT flag and the VM_IOACCESSP_PGOUTWAIT flag must also be specified.

Execution Environment

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

Return Values

Item Description
0 Indicates the completion of the I/O access operations.
EINVAL Indicates one of the following errors:
  • pfirst < 0.
  • npages < 0.
  • Page interval not in one segment.
  • Invalid sid parameter.
  • Page make requests > 1MB.
  • Not a client file system.
  • Unsupported flag used.
  • Both the VM_IOACCESSP_MAKE and the VM_IOACCESSP_FLUSH flags are set.
  • The VM_IOACCESSP_WAITONLY flag is set and the VM_IOACCESSP_PGINWAIT flag or the VM_IOACCESSP_PGOUTWAIT flag is not set.
  • The VM_IOACCESSP_WAITONLY flag and the VM_IOACCESSP_MAKE flag or the VM_IOACCESSP_FLUSH flag are set.