1<html><head><meta http-equiv="Content-Type" content="text/html; charset=ANSI_X3.4-1968"><title>iget5_locked</title><meta name="generator" content="DocBook XSL Stylesheets V1.78.1"><link rel="home" href="index.html" title="Linux Filesystems API"><link rel="up" href="inode_handling.html" title="Inode Handling"><link rel="prev" href="API-unlock-two-nondirectories.html" title="unlock_two_nondirectories"><link rel="next" href="API-iget-locked.html" title="iget_locked"></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">iget5_locked</span></th></tr><tr><td width="20%" align="left"><a accesskey="p" href="API-unlock-two-nondirectories.html">Prev</a>&#160;</td><th width="60%" align="center">Inode Handling</th><td width="20%" align="right">&#160;<a accesskey="n" href="API-iget-locked.html">Next</a></td></tr></table><hr></div><div class="refentry"><a name="API-iget5-locked"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>iget5_locked &#8212; 
2     obtain an inode from a mounted file system
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">struct inode * <b class="fsfunc">iget5_locked </b>(</code></td><td>struct super_block * <var class="pdparam">sb</var>, </td></tr><tr><td>&#160;</td><td>unsigned long <var class="pdparam">hashval</var>, </td></tr><tr><td>&#160;</td><td>int (*<var class="pdparam">test</var>)
4     <code>(</code>struct inode *, void *<code>)</code>, </td></tr><tr><td>&#160;</td><td>int (*<var class="pdparam">set</var>)
5     <code>(</code>struct inode *, void *<code>)</code>, </td></tr><tr><td>&#160;</td><td>void * <var class="pdparam">data</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer">&#160;</div></div></div><div class="refsect1"><a name="idp1101716916"></a><h2>Arguments</h2><div class="variablelist"><dl class="variablelist"><dt><span class="term"><em class="parameter"><code>sb</code></em></span></dt><dd><p>
6     super block of file system
7    </p></dd><dt><span class="term"><em class="parameter"><code>hashval</code></em></span></dt><dd><p>
8     hash value (usually inode number) to get
9    </p></dd><dt><span class="term"><em class="parameter"><code>test</code></em></span></dt><dd><p>
10     callback used for comparisons between inodes
11    </p></dd><dt><span class="term"><em class="parameter"><code>set</code></em></span></dt><dd><p>
12     callback used to initialize a new struct inode
13    </p></dd><dt><span class="term"><em class="parameter"><code>data</code></em></span></dt><dd><p>
14     opaque data pointer to pass to <em class="parameter"><code>test</code></em> and <em class="parameter"><code>set</code></em>
15    </p></dd></dl></div></div><div class="refsect1"><a name="idp1101723156"></a><h2>Description</h2><p>
16   Search for the inode specified by <em class="parameter"><code>hashval</code></em> and <em class="parameter"><code>data</code></em> in the inode cache,
17   and if present it is return it with an increased reference count. This is
18   a generalized version of <code class="function">iget_locked</code> for file systems where the inode
19   number is not sufficient for unique identification of an inode.
20   </p><p>
21
22   If the inode is not in cache, allocate a new inode and return it locked,
23   hashed, and with the I_NEW flag set. The file system gets to fill it in
24   before unlocking it via <code class="function">unlock_new_inode</code>.
25   </p><p>
26
27   Note both <em class="parameter"><code>test</code></em> and <em class="parameter"><code>set</code></em> are called with the inode_hash_lock held, so can't
28   sleep.
29</p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="API-unlock-two-nondirectories.html">Prev</a>&#160;</td><td width="20%" align="center"><a accesskey="u" href="inode_handling.html">Up</a></td><td width="40%" align="right">&#160;<a accesskey="n" href="API-iget-locked.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top"><span class="phrase">unlock_two_nondirectories</span>&#160;</td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top">&#160;<span class="phrase">iget_locked</span></td></tr></table></div></body></html>
30