---
name: "page_cache_prev_hole"
section: "9"
platform: "linux"
package: "linux-manual-4.9"
version: "4.9.228-1"
release: "Debian 9 (Stretch)"
platforms: ["linux"]
url: "https://new.carta.tech/page_cache_prev_hole"
---

# page\_cache\_prev\_hole(9)

find the prev hole (not-present entry)

## NAME

page\_cache\_prev\_hole - find the prev hole (not-present entry)

## SYNOPSIS

**pgoff\_t page\_cache\_prev\_hole(struct address\_space \*** *mapping***, pgoff\_t** *index***, unsigned long** *max\_scan***);**

## ARGUMENTS

*mapping*

mapping

*index*

index

*max\_scan*

maximum range to search

## DESCRIPTION

Search backwards in the range \[max(index-max\_scan+1, 0), index\] for the first hole.

## RETURN

the index of the hole if found, otherwise returns an index outside of the set specified (in which case 'index - return \>= max\_scan' will be true). In rare cases of wrap-around, ULONG\_MAX will be returned.

page\_cache\_prev\_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 10, then subsequently a hole is created at index 5, page\_cache\_prev\_hole covering both indexes may return 5 if called under rcu\_read\_lock.

## COPYRIGHT
