1<html><head><meta http-equiv="Content-Type" content="text/html; charset=ANSI_X3.4-1968"><title>page_cache_prev_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-page-cache-next-hole.html" title="page_cache_next_hole"><link rel="next" href="API-find-get-entry.html" title="find_get_entry"></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_prev_hole</span></th></tr><tr><td width="20%" align="left"><a accesskey="p" href="API-page-cache-next-hole.html">Prev</a> </td><th width="60%" align="center">More Memory Management Functions</th><td width="20%" align="right"> <a accesskey="n" href="API-find-get-entry.html">Next</a></td></tr></table><hr></div><div class="refentry"><a name="API-page-cache-prev-hole"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>page_cache_prev_hole — 2 find the prev 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_prev_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="idp1124119740"></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="idp1124123372"></a><h2>Description</h2><p> 10 Search backwards in the range [max(index-max_scan+1, 0), index] for 11 the first hole. 12</p></div><div class="refsect1"><a name="idp1124124060"></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 'index - return >= 15 max_scan' will be true). In rare cases of wrap-around, ULONG_MAX 16 will be returned. 17 </p><p> 18 19 page_cache_prev_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 10, then subsequently a hole is created at 23 index 5, page_cache_prev_hole covering both indexes may return 5 if 24 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-page-cache-next-hole.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-find-get-entry.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top"><span class="phrase">page_cache_next_hole</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">find_get_entry</span></td></tr></table></div></body></html> 26