'\" t .\" Title: replace_page_cache_page .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 .\" Date: January 2017 .\" Manual: Memory Management in Linux .\" Source: Kernel Hackers Manual 4.8.15 .\" Language: English .\" .TH "REPLACE_PAGE_CACHE_P" "9" "January 2017" "Kernel Hackers Manual 4\&.8\&." "Memory Management in Linux" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" replace_page_cache_page \- replace a pagecache page with a new one .SH "SYNOPSIS" .HP \w'int\ replace_page_cache_page('u .BI "int replace_page_cache_page(struct\ page\ *\ " "old" ", struct\ page\ *\ " "new" ", gfp_t\ " "gfp_mask" ");" .SH "ARGUMENTS" .PP \fIold\fR .RS 4 page to be replaced .RE .PP \fInew\fR .RS 4 page to replace with .RE .PP \fIgfp_mask\fR .RS 4 allocation mode .RE .SH "DESCRIPTION" .PP 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\&. .PP The remove + add is atomic\&. The only way this function can fail is memory allocation failure\&. .SH "COPYRIGHT" .br