1REPLACE_PAGE_CACHE_P(9) Memory Management in Linux REPLACE_PAGE_CACHE_P(9)
2
3
4
6 replace_page_cache_page - replace a pagecache page with a new one
7
9 int replace_page_cache_page(struct page * old, struct page * new,
10 gfp_t gfp_mask);
11
13 old
14 page to be replaced
15
16 new
17 page to replace with
18
19 gfp_mask
20 allocation mode
21
23 This function replaces a page in the pagecache with a new one. On
24 success it acquires the pagecache reference for the new page and drops
25 it for the old page. Both the old and new pages must be locked. This
26 function does not add the new page to the LRU, the caller must do that.
27
28 The remove + add is atomic. The only way this function can fail is
29 memory allocation failure.
30
32Kernel Hackers Manual 3.10 June 2019 REPLACE_PAGE_CACHE_P(9)