1FIND_OR_CREATE_PAGE(9) Memory Management in Linux FIND_OR_CREATE_PAGE(9)
2
3
4
6 find_or_create_page - locate or add a pagecache page
7
9 struct page * find_or_create_page(struct address_space * mapping,
10 pgoff_t index, gfp_t gfp_mask);
11
13 mapping
14 the page´s address_space
15
16 index
17 the page´s index into the mapping
18
19 gfp_mask
20 page allocation mode
21
23 Locates a page in the pagecache. If the page is not present, a new page
24 is allocated using gfp_mask and is added to the pagecache and to the
25 VM´s LRU list. The returned page is locked and has its reference count
26 incremented.
27
28 find_or_create_page may sleep, even if gfp_flags specifies an atomic
29 allocation!
30
31 find_or_create_page returns the desired page´s address, or zero on
32 memory exhaustion.
33
35Kernel Hackers Manual 2.6. June 2019 FIND_OR_CREATE_PAGE(9)