---
name: "add_to_page_cache"
section: "9"
platform: "linux"
package: "linux-manual-2.6.26"
version: "2.6.26-29"
release: "Debian 5.0 (Lenny)"
platforms: ["linux"]
url: "https://new.carta.tech/add_to_page_cache"
---

# add\_to\_page\_cache(9)

add newly allocated pagecache pages

## NAME

add\_to\_page\_cache - add newly allocated pagecache pages

## SYNOPSIS

**int add\_to\_page\_cache(struct page \*** *page***, struct address\_space \*** *mapping***, pgoff\_t** *offset***, gfp\_t** *gfp\_mask***);**

## ARGUMENTS

*page*

page to add

*mapping*

the page´s address\_space

*offset*

page index

*gfp\_mask*

page allocation mode

## DESCRIPTION

This function is used to add newly allocated pagecache pages; the page is new, so we can just run **SetPageLocked** against it. The other page state flags were set by **rmqueue**.

This function does not add the page to the LRU. The caller must do that.

## COPYRIGHT
