'\" t .\" Title: page_cache_next_hole .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 .\" Date: June 2017 .\" Manual: Memory Management in Linux .\" Source: Kernel Hackers Manual 4.11.3 .\" Language: English .\" .TH "PAGE_CACHE_NEXT_HOLE" "9" "June 2017" "Kernel Hackers Manual 4\&.11\&" "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" page_cache_next_hole \- find the next hole (not\-present entry) .SH "SYNOPSIS" .HP \w'pgoff_t\ page_cache_next_hole('u .BI "pgoff_t page_cache_next_hole(struct\ address_space\ *\ " "mapping" ", pgoff_t\ " "index" ", unsigned\ long\ " "max_scan" ");" .SH "ARGUMENTS" .PP \fIstruct address_space * mapping\fR .RS 4 mapping .RE .PP \fIpgoff_t index\fR .RS 4 index .RE .PP \fIunsigned long max_scan\fR .RS 4 maximum range to search .RE .SH "DESCRIPTION" .PP Search the set [index, min(index+max_scan\-1, MAX_INDEX)] for the lowest indexed hole\&. .SH "RETURN" .PP the index of the hole if found, otherwise returns an index outside of the set specified (in which case \*(Aqreturn \- index >= max_scan\*(Aq will be true)\&. In rare cases of index wrap\-around, 0 will be returned\&. .PP page_cache_next_hole may be called under rcu_read_lock\&. However, like radix_tree_gang_lookup, this will not atomically search a snapshot of the tree at a single point in time\&. For example, if a hole is created at index 5, then subsequently a hole is created at index 10, page_cache_next_hole covering both indexes may return 10 if called under rcu_read_lock\&. .SH "COPYRIGHT" .br