---
name: "page_cache_next_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_next_hole"
---

# page\_cache\_next\_hole(9)

find the next hole (not-present entry)

## NAME

page\_cache\_next\_hole - find the next hole (not-present entry)

## SYNOPSIS

**pgoff\_t page\_cache\_next\_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 the set \[index, min(index+max\_scan-1, MAX\_INDEX)\] for the lowest indexed hole.

## RETURN

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

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.

## COPYRIGHT
