find_or_create_page — locate or add a pagecache page
struct page * find_or_create_page ( | struct address_space * mapping, |
pgoff_t index, | |
gfp_t gfp_mask) ; |
mapping
the page's address_space
index
the page's index into the mapping
gfp_mask
page allocation mode
Looks up the page cache slot at mapping
& offset
. If there is a
page cache page, it is returned locked and with an increased
refcount.
If the page is not present, a new page is allocated using gfp_mask
and added to the page cache and the VM's LRU list. The page is
returned locked and with an increased refcount.
On memory exhaustion, NULL
is returned.
find_or_create_page
may sleep, even if gfp_flags
specifies an
atomic allocation!