Manual Reference Pages - VOP_GETPAGES (9)
- read or write VM pages from a file
VOP_GETPAGES struct vnode *vp vm_page_t *ma int count int reqpage vm_ooffset_t offset
VOP_PUTPAGES struct vnode *vp vm_page_t *ma int count int sync int *rtvals vm_ooffset_t offset
method is called to read in pages of virtual memory which are backed by
If other adjacent pages are backed by adjacent regions of the same file,
is requested to read those pages as well, although it is not required to
method does the converse; that is to say, it writes out adjacent dirty
pages of virtual memory.
On entry, the vnode lock is held but neither the page queue nor VM object
locks are held.
Both methods return in the same state on both success and error returns.
The arguments are:
The file to access.
Pointer to the first element of an array of pages representing a
contiguous region of the file to be read or written.
The number of bytes that should be read into the pages of the array.
if the write should be synchronous.
An array of VM system result codes indicating the status of each
page written by
The index in the page array of the requested page; i.e., the one page which
the implementation of this method must handle.
Offset in the file at which the mapped pages begin.
The status of the
method is returned on a page-by-page basis in the array
The possible status values are as follows:
The page was successfully written.
The implementation must call
to mark the page as clean.
The page was scheduled to be written asynchronously.
When the write completes, the completion callback should
to clear the busy flag and awaken any other threads waiting for this page,
in addition to calling
The page was entirely beyond the end of the backing file.
This condition should not be possible if the vnodes file system
is correctly implemented.
The page could not be written because of an error on the underlying storage
medium or protocol.
Treated identically to
The page was not handled by this request.
method is expected to release any pages in
that it does not successfully handle, by calling
When it succeeds,
must set the valid bits appropriately.
It must unbusy all other successfully handled pages and put them
on appropriate page queue(s).
may either activate a page (if its wanted bit is set)
or deactivate it (otherwise), and finally call
to arouse any threads currently waiting for the page to be faulted in.
If it successfully reads
By convention, the return value of
This manual page was written by
.An Doug Rabson
and then substantially rewritten by
.An Garrett Wollman .
Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.