1<html><head><meta http-equiv="Content-Type" content="text/html; charset=ANSI_X3.4-1968"><title>locks_mandatory_area</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-posix-lock-inode-wait.html" title="posix_lock_inode_wait"><link rel="next" href="API---break-lease.html" title="__break_lease"></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">locks_mandatory_area</span></th></tr><tr><td width="20%" align="left"><a accesskey="p" href="API-posix-lock-inode-wait.html">Prev</a>&#160;</td><th width="60%" align="center">File Locks</th><td width="20%" align="right">&#160;<a accesskey="n" href="API---break-lease.html">Next</a></td></tr></table><hr></div><div class="refentry"><a name="API-locks-mandatory-area"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>locks_mandatory_area &#8212; 
2     Check for a conflicting lock
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">locks_mandatory_area </b>(</code></td><td>int <var class="pdparam">read_write</var>, </td></tr><tr><td>&#160;</td><td>struct inode * <var class="pdparam">inode</var>, </td></tr><tr><td>&#160;</td><td>struct file * <var class="pdparam">filp</var>, </td></tr><tr><td>&#160;</td><td>loff_t <var class="pdparam">offset</var>, </td></tr><tr><td>&#160;</td><td>size_t <var class="pdparam">count</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer">&#160;</div></div></div><div class="refsect1"><a name="idp1101968100"></a><h2>Arguments</h2><div class="variablelist"><dl class="variablelist"><dt><span class="term"><em class="parameter"><code>read_write</code></em></span></dt><dd><p>
4     <code class="constant">FLOCK_VERIFY_WRITE</code> for exclusive access, <code class="constant">FLOCK_VERIFY_READ</code>
5     for shared
6    </p></dd><dt><span class="term"><em class="parameter"><code>inode</code></em></span></dt><dd><p>
7     the file to check
8    </p></dd><dt><span class="term"><em class="parameter"><code>filp</code></em></span></dt><dd><p>
9     how the file was opened (if it was)
10    </p></dd><dt><span class="term"><em class="parameter"><code>offset</code></em></span></dt><dd><p>
11     start of area to check
12    </p></dd><dt><span class="term"><em class="parameter"><code>count</code></em></span></dt><dd><p>
13     length of area to check
14    </p></dd></dl></div></div><div class="refsect1"><a name="idp1101973996"></a><h2>Description</h2><p>
15   Searches the inode's list of locks to find any POSIX locks which conflict.
16   This function is called from <code class="function">rw_verify_area</code> and
17   <code class="function">locks_verify_truncate</code>.
18</p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="API-posix-lock-inode-wait.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---break-lease.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top"><span class="phrase">posix_lock_inode_wait</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">__break_lease</span></td></tr></table></div></body></html>
19