replace_page_cache_page(9)

replace_page_cache_page9

Replace a pagecache page with a new one

Usage

int replace_page_cache_page(struct page * old, struct page * new, gfp_t gfp_mask);

Arguments

old

page to be replaced

new

page to replace with

gfp_mask

allocation mode

Overview

This function replaces a page in the pagecache with a new one. On success it acquires the pagecache reference for the new page and drops it for the old page. Both the old and new pages must be locked. This function does not add the new page to the LRU, the caller must do that.

The remove + add is atomic. The only way this function can fail is memory allocation failure.

Releases

3 releases since Debian 7 (Wheezy); the text changed 2 times.

  1. 7
  2. 8
  3. 9

From linux-manual-4.9 4.9.228-1 in Debian 9 (Stretch). Parsed by carta from the page's man source.