1<html><head><meta http-equiv="Content-Type" content="text/html; charset=ANSI_X3.4-1968"><title>vfs_link</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="other_functions.html" title="Other Functions"><link rel="prev" href="API-vfs-unlink.html" title="vfs_unlink"><link rel="next" href="API-vfs-rename.html" title="vfs_rename"></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">vfs_link</span></th></tr><tr><td width="20%" align="left"><a accesskey="p" href="API-vfs-unlink.html">Prev</a> </td><th width="60%" align="center">Other Functions</th><td width="20%" align="right"> <a accesskey="n" href="API-vfs-rename.html">Next</a></td></tr></table><hr></div><div class="refentry"><a name="API-vfs-link"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>vfs_link — 2 create a new link 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">int <b class="fsfunc">vfs_link </b>(</code></td><td>struct dentry * <var class="pdparam">old_dentry</var>, </td></tr><tr><td> </td><td>struct inode * <var class="pdparam">dir</var>, </td></tr><tr><td> </td><td>struct dentry * <var class="pdparam">new_dentry</var>, </td></tr><tr><td> </td><td>struct inode ** <var class="pdparam">delegated_inode</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer"> </div></div></div><div class="refsect1"><a name="idp1102220060"></a><h2>Arguments</h2><div class="variablelist"><dl class="variablelist"><dt><span class="term"><em class="parameter"><code>old_dentry</code></em></span></dt><dd><p> 4 object to be linked 5 </p></dd><dt><span class="term"><em class="parameter"><code>dir</code></em></span></dt><dd><p> 6 new parent 7 </p></dd><dt><span class="term"><em class="parameter"><code>new_dentry</code></em></span></dt><dd><p> 8 where to create the new link 9 </p></dd><dt><span class="term"><em class="parameter"><code>delegated_inode</code></em></span></dt><dd><p> 10 returns inode needing a delegation break 11 </p></dd></dl></div></div><div class="refsect1"><a name="idp1102224756"></a><h2>Description</h2><p> 12 The caller must hold dir->i_mutex 13 </p><p> 14 15 If vfs_link discovers a delegation on the to-be-linked file in need 16 of breaking, it will return -EWOULDBLOCK and return a reference to the 17 inode in delegated_inode. The caller should then break the delegation 18 and retry. Because breaking a delegation may take a long time, the 19 caller should drop the i_mutex before doing so. 20 </p><p> 21 22 Alternatively, a caller may pass NULL for delegated_inode. This may 23 be appropriate for callers that expect the underlying filesystem not 24 to be NFS exported. 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-vfs-unlink.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="other_functions.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="API-vfs-rename.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top"><span class="phrase">vfs_unlink</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">vfs_rename</span></td></tr></table></div></body></html> 26