<?xml version="1.0" encoding="ANSI_X3.4-1968" standalone="no"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><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-new-inode.html" title="unlock_new_inode" /><link rel="next" href="API-iget-locked.html" title="iget_locked" /></head><body><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-new-inode.html">Prev</a> </td><th width="60%" align="center">Inode Handling</th><td width="20%" align="right"> <a accesskey="n" href="API-iget-locked.html">Next</a></td></tr></table><hr /></div><div class="refentry"><a id="API-iget5-locked"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>iget5_locked — obtain an inode from a mounted file system </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 * <strong class="fsfunc">iget5_locked </strong>(</code></td><td>struct super_block * <var class="pdparam">sb</var>, </td></tr><tr><td> </td><td>unsigned long <var class="pdparam">hashval</var>, </td></tr><tr><td> </td><td>int (*<var class="pdparam">test</var>) <code>(</code>struct inode *, void *<code>)</code>, </td></tr><tr><td> </td><td>int (*<var class="pdparam">set</var>) <code>(</code>struct inode *, void *<code>)</code>, </td></tr><tr><td> </td><td>void * <var class="pdparam">data</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer"> </div></div></div><div class="refsect1"><a id="idm139881796175440"></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> super block of file system </p></dd><dt><span class="term"><em class="parameter"><code>hashval</code></em></span></dt><dd><p> hash value (usually inode number) to get </p></dd><dt><span class="term"><em class="parameter"><code>test</code></em></span></dt><dd><p> callback used for comparisons between inodes </p></dd><dt><span class="term"><em class="parameter"><code>set</code></em></span></dt><dd><p> callback used to initialize a new struct inode </p></dd><dt><span class="term"><em class="parameter"><code>data</code></em></span></dt><dd><p> opaque data pointer to pass to <em class="parameter"><code>test</code></em> and <em class="parameter"><code>set</code></em> </p></dd></dl></div></div><div class="refsect1"><a id="idm139881796163440"></a><h2>Description</h2><p> 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, and if present it is return it with an increased reference count. This is a generalized version of <code class="function">iget_locked</code> for file systems where the inode number is not sufficient for unique identification of an inode. </p><p> If the inode is not in cache, allocate a new inode and return it locked, hashed, and with the I_NEW flag set. The file system gets to fill it in before unlocking it via <code class="function">unlock_new_inode</code>. </p><p> 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 sleep. </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-new-inode.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="inode_handling.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="API-iget-locked.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top"><span class="phrase">unlock_new_inode</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">iget_locked</span></td></tr></table></div></body></html>