1<html><head><meta http-equiv="Content-Type" content="text/html; charset=ANSI_X3.4-1968"><title>vfs_setlease</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="file_locks.html" title="File Locks"><link rel="prev" href="API-generic-setlease.html" title="generic_setlease"><link rel="next" href="API-flock-lock-inode-wait.html" title="flock_lock_inode_wait"></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_setlease</span></th></tr><tr><td width="20%" align="left"><a accesskey="p" href="API-generic-setlease.html">Prev</a>&#160;</td><th width="60%" align="center">File Locks</th><td width="20%" align="right">&#160;<a accesskey="n" href="API-flock-lock-inode-wait.html">Next</a></td></tr></table><hr></div><div class="refentry"><a name="API-vfs-setlease"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>vfs_setlease &#8212; 
2     sets a lease on an open file
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_setlease </b>(</code></td><td>struct file * <var class="pdparam">filp</var>, </td></tr><tr><td>&#160;</td><td>long <var class="pdparam">arg</var>, </td></tr><tr><td>&#160;</td><td>struct file_lock ** <var class="pdparam">lease</var>, </td></tr><tr><td>&#160;</td><td>void ** <var class="pdparam">priv</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer">&#160;</div></div></div><div class="refsect1"><a name="idp1102011060"></a><h2>Arguments</h2><div class="variablelist"><dl class="variablelist"><dt><span class="term"><em class="parameter"><code>filp</code></em></span></dt><dd><p>
4     file pointer
5    </p></dd><dt><span class="term"><em class="parameter"><code>arg</code></em></span></dt><dd><p>
6     type of lease to obtain
7    </p></dd><dt><span class="term"><em class="parameter"><code>lease</code></em></span></dt><dd><p>
8     file_lock to use when adding a lease
9    </p></dd><dt><span class="term"><em class="parameter"><code>priv</code></em></span></dt><dd><p>
10     private info for lm_setup when adding a lease (may be
11     NULL if lm_setup doesn't require it)
12    </p></dd></dl></div></div><div class="refsect1"><a name="idp1102015652"></a><h2>Description</h2><p>
13   Call this to establish a lease on the file. The <span class="quote">&#8220;<span class="quote">lease</span>&#8221;</span> argument is not
14   used for F_UNLCK requests and may be NULL. For commands that set or alter
15   an existing lease, the (*lease)-&gt;fl_lmops-&gt;lm_break operation must be set;
16   if not, this function will return -ENOLCK (and generate a scary-looking
17   stack trace).
18   </p><p>
19
20   The <span class="quote">&#8220;<span class="quote">priv</span>&#8221;</span> pointer is passed directly to the lm_setup function as-is. It
21   may be NULL if the lm_setup operation doesn't require it.
22</p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="API-generic-setlease.html">Prev</a>&#160;</td><td width="20%" align="center"><a accesskey="u" href="file_locks.html">Up</a></td><td width="40%" align="right">&#160;<a accesskey="n" href="API-flock-lock-inode-wait.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top"><span class="phrase">generic_setlease</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">flock_lock_inode_wait</span></td></tr></table></div></body></html>
23