---
name: "pagecache_get_page"
section: "9"
platform: "linux"
package: "linux-manual-4.9"
version: "4.9.228-1"
release: "Debian 9 (Stretch)"
platforms: ["linux"]
url: "https://new.carta.tech/pagecache_get_page"
---

# pagecache\_get\_page(9)

find and get a page reference

## NAME

pagecache\_get\_page - find and get a page reference

## SYNOPSIS

**struct page \* pagecache\_get\_page(struct address\_space \*** *mapping***, pgoff\_t** *offset***, int** *fgp\_flags***, gfp\_t** *gfp\_mask***);**

## ARGUMENTS

*mapping*

the address\_space to search

*offset*

the page index

*fgp\_flags*

PCG flags

*gfp\_mask*

gfp mask to use for the page cache data page allocation

## DESCRIPTION

Looks up the page cache slot at *mapping* & *offset*.

PCG flags modify how the page is returned.

FGP\_ACCESSED: the page will be marked accessed FGP\_LOCK: Page is return locked FGP\_CREAT: If page is not present then 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. 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.

## COPYRIGHT
