121642577SAlfred Perlstein.\" 221642577SAlfred Perlstein.\" Copyright (C) 2001 Chad David <davidc@acns.ab.ca>. All rights reserved. 321642577SAlfred Perlstein.\" 421642577SAlfred Perlstein.\" Redistribution and use in source and binary forms, with or without 521642577SAlfred Perlstein.\" modification, are permitted provided that the following conditions 621642577SAlfred Perlstein.\" are met: 721642577SAlfred Perlstein.\" 1. Redistributions of source code must retain the above copyright 821642577SAlfred Perlstein.\" notice(s), this list of conditions and the following disclaimer as 921642577SAlfred Perlstein.\" the first lines of this file unmodified other than the possible 1021642577SAlfred Perlstein.\" addition of one or more copyright notices. 1121642577SAlfred Perlstein.\" 2. Redistributions in binary form must reproduce the above copyright 1221642577SAlfred Perlstein.\" notice(s), this list of conditions and the following disclaimer in the 1321642577SAlfred Perlstein.\" documentation and/or other materials provided with the distribution. 1421642577SAlfred Perlstein.\" 1521642577SAlfred Perlstein.\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER(S) ``AS IS'' AND ANY 1621642577SAlfred Perlstein.\" EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 1721642577SAlfred Perlstein.\" WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 1821642577SAlfred Perlstein.\" DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) BE LIABLE FOR ANY 1921642577SAlfred Perlstein.\" DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 2021642577SAlfred Perlstein.\" (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 2121642577SAlfred Perlstein.\" SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 2221642577SAlfred Perlstein.\" CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 2321642577SAlfred Perlstein.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 2421642577SAlfred Perlstein.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH 2521642577SAlfred Perlstein.\" DAMAGE. 2621642577SAlfred Perlstein.\" 2721642577SAlfred Perlstein.\" $FreeBSD$ 2821642577SAlfred Perlstein.\" 2921642577SAlfred Perlstein.Dd August 7, 2001 3021642577SAlfred Perlstein.Dt VM_PAGE_GRAB 9 3121642577SAlfred Perlstein.Os 3221642577SAlfred Perlstein.Sh NAME 3321642577SAlfred Perlstein.Nm vm_page_grab 3421642577SAlfred Perlstein.Nd "returns a page from an object" 3521642577SAlfred Perlstein.Sh SYNOPSIS 3621642577SAlfred Perlstein.In sys/param.h 3721642577SAlfred Perlstein.In vm/vm.h 3821642577SAlfred Perlstein.In vm/vm_page.h 3921642577SAlfred Perlstein.Ft vm_page_t 4021642577SAlfred Perlstein.Fn vm_page_grab "vm_object_t object" "vm_pindex_t pindex" "int allocflags" 4121642577SAlfred Perlstein.Sh DESCRIPTION 4221642577SAlfred PerlsteinThe 4321642577SAlfred Perlstein.Fn vm_page_grab 4421642577SAlfred Perlsteinfunction returns the page at 4521642577SAlfred Perlstein.Fa pindex 4621642577SAlfred Perlsteinfrom the given object. 471f620c2eSRuslan ErmilovIf the page exists and is busy, 4821642577SAlfred Perlstein.Fn vm_page_grab 4921642577SAlfred Perlsteinwill sleep while waiting for it. 501f620c2eSRuslan ErmilovIf the page does not exist, it is allocated. 5121642577SAlfred Perlstein.Pp 5221642577SAlfred PerlsteinIf 5321642577SAlfred Perlstein.Dv VM_ALLOC_RETRY 5421642577SAlfred Perlsteinis not set in 5521642577SAlfred Perlstein.Fa allocflags 5621642577SAlfred Perlsteinand the function sleeps, either getting the page from the object 5721642577SAlfred Perlsteinor while allocating it, 5821642577SAlfred Perlstein.Dv NULL 5921642577SAlfred Perlsteinis returned. 6021642577SAlfred Perlstein.Sh RETURN VALUES 611f620c2eSRuslan ErmilovIf successful, 6221642577SAlfred Perlstein.Fn vm_page_grab 631f620c2eSRuslan Ermilovreturns the page; otherwise, 6421642577SAlfred Perlstein.Dv NULL 6521642577SAlfred Perlsteinis returned. 6621642577SAlfred Perlstein.Sh SEE ALSO 6721642577SAlfred Perlstein.Xr vm_page_alloc 9 6821642577SAlfred Perlstein.Sh AUTHORS 69571dba6eSHiten PandyaThis manual page was written by 7021642577SAlfred Perlstein.An Chad David Aq davidc@acns.ab.ca . 71