---
name: "page_cache_readahead"
section: "9"
platform: "linux"
package: "linux-manual-2.6.18"
version: "2.6.18.dfsg.1-26etch2"
release: "Debian 4.0 (Etch)"
platforms: ["linux"]
url: "https://new.carta.tech/page_cache_readahead"
---

# page\_cache\_readahead(9)

generic adaptive readahead

## NAME

page\_cache\_readahead - generic adaptive readahead

## SYNOPSIS

**unsigned long page\_cache\_readahead(struct address\_space \*** *mapping***, struct file\_ra\_state \*** *ra***, struct file \*** *filp***, pgoff\_t** *offset***, unsigned long** *req\_size***);**

## ARGUMENTS

*mapping*

address\_space which holds the pagecache and I/O vectors

*ra*

file\_ra\_state which holds the readahead state

*filp*

passed on to -\>**readpage** and -\>**readpages**

*offset*

start offset into *mapping*, in PAGE\_CACHE\_SIZE units

*req\_size*

hint: total size of the read which the caller is performing in PAGE\_CACHE\_SIZE units

## DESCRIPTION

**page\_cache\_readahead** is the main function. If performs the adaptive readahead window size management and submits the readahead I/O.

Note that *filp* is purely used for passing on to the -\>readpage\[s\]()

## HANDLER

it may refer to a different file from *mapping* (so we may not use *filp*-\>f\_mapping or *filp*-\>f\_dentry-\>d\_inode here). Also, *ra* may not be equal to &*filp*-\>f\_ra.

## COPYRIGHT
