.\" This manpage has been automatically generated by docbook2man
.\" from a DocBook document. This tool can be found at:
.\"
.\" Please send any bug reports, improvements, comments, patches,
.\" etc. to Steve Cheng .
.TH "FIND_OR_CREATE_PAGE" "" "06 October 2005" "" ""
.SH NAME
find_or_create_page \- locate or add a pagecache page
.SH SYNOPSIS
"SYNOPSIS"
.sp
\fB
.sp
struct page * find_or_create_page (struct address_space * \fImapping\fB, unsigned long \fIindex\fB, unsigned int \fIgfp_mask\fB);
\fR
.SH "ARGUMENTS"
.TP
\fB\fImapping\fB\fR
-- undescribed --
.TP
\fB\fIindex\fB\fR
-- undescribed --
.TP
\fB\fIgfp_mask\fB\fR
-- undescribed --
.SH "DESCRIPTION"
.PP
.PP
\fImapping\fR - the page's address_space
\fIindex\fR - the page's index into the mapping
\fIgfp_mask\fR - page allocation mode
.PP
Locates a page in the pagecache. If the page is not present, a new page
is allocated using \fIgfp_mask\fR and is added to the pagecache and to the VM's
LRU list. The returned page is locked and has its reference count
incremented.
.PP
\fBfind_or_create_page\fR may sleep, even if \fIgfp_flags\fR specifies an atomic
allocation!
.PP
\fBfind_or_create_page\fR returns the desired page's address, or zero on
memory exhaustion.