pagecache_get_page — find and get a page reference
struct page * pagecache_get_page ( | struct address_space * mapping, |
pgoff_t offset, | |
int fgp_flags, | |
gfp_t cache_gfp_mask, | |
gfp_t radix_gfp_mask) ; |
mapping
the address_space to search
offset
the page index
fgp_flags
PCG flags
cache_gfp_mask
gfp mask to use for the page cache data page allocation
radix_gfp_mask
gfp mask to use for radix tree node allocation
Looks up the page cache slot at mapping
& offset
.
PCG flags modify how the page is returned.
If page is not present then a new page is allocated using
cache_gfp_mask
and added to the page cache and the VM's LRU
list. If radix tree nodes are allocated during page cache
insertion then radix_gfp_mask
is used. The page is returned
locked and with an increased refcount. Otherwise, NULL
is
returned.
If FGP_LOCK or FGP_CREAT are specified then the function may sleep even if the GFP flags specified for FGP_CREAT are atomic.
If there is a page cache page, it is returned with an increased refcount.