1<html><head><meta http-equiv="Content-Type" content="text/html; charset=ANSI_X3.4-1968"><title>page_cache_next_hole</title><meta name="generator" content="DocBook XSL Stylesheets V1.78.1"><link rel="home" href="index.html" title="The Linux Kernel API"><link rel="up" href="ch04s03.html" title="More Memory Management Functions"><link rel="prev" href="API---lock-page.html" title="__lock_page"><link rel="next" href="API-page-cache-prev-hole.html" title="page_cache_prev_hole"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center"><span class="phrase">page_cache_next_hole</span></th></tr><tr><td width="20%" align="left"><a accesskey="p" href="API---lock-page.html">Prev</a> </td><th width="60%" align="center">More Memory Management Functions</th><td width="20%" align="right"> <a accesskey="n" href="API-page-cache-prev-hole.html">Next</a></td></tr></table><hr></div><div class="refentry"><a name="API-page-cache-next-hole"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>page_cache_next_hole — 2 find the next hole (not-present entry) 3 </p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><div class="funcsynopsis"><table border="0" class="funcprototype-table" summary="Function synopsis" style="cellspacing: 0; cellpadding: 0;"><tr><td><code class="funcdef">pgoff_t <b class="fsfunc">page_cache_next_hole </b>(</code></td><td>struct address_space * <var class="pdparam">mapping</var>, </td></tr><tr><td> </td><td>pgoff_t <var class="pdparam">index</var>, </td></tr><tr><td> </td><td>unsigned long <var class="pdparam">max_scan</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer"> </div></div></div><div class="refsect1"><a name="idp1124108340"></a><h2>Arguments</h2><div class="variablelist"><dl class="variablelist"><dt><span class="term"><em class="parameter"><code>mapping</code></em></span></dt><dd><p> 4 mapping 5 </p></dd><dt><span class="term"><em class="parameter"><code>index</code></em></span></dt><dd><p> 6 index 7 </p></dd><dt><span class="term"><em class="parameter"><code>max_scan</code></em></span></dt><dd><p> 8 maximum range to search 9 </p></dd></dl></div></div><div class="refsect1"><a name="idp1124111972"></a><h2>Description</h2><p> 10 Search the set [index, min(index+max_scan-1, MAX_INDEX)] for the 11 lowest indexed hole. 12</p></div><div class="refsect1"><a name="idp1124112668"></a><h2>Returns</h2><p> 13 the index of the hole if found, otherwise returns an index 14 outside of the set specified (in which case 'return - index >= 15 max_scan' will be true). In rare cases of index wrap-around, 0 will 16 be returned. 17 </p><p> 18 19 page_cache_next_hole may be called under rcu_read_lock. However, 20 like radix_tree_gang_lookup, this will not atomically search a 21 snapshot of the tree at a single point in time. For example, if a 22 hole is created at index 5, then subsequently a hole is created at 23 index 10, page_cache_next_hole covering both indexes may return 10 24 if called under rcu_read_lock. 25</p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="API---lock-page.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="ch04s03.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="API-page-cache-prev-hole.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top"><span class="phrase">__lock_page</span> </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> <span class="phrase">page_cache_prev_hole</span></td></tr></table></div></body></html> 26