1 <samba:parameter xmlns:samba="http://samba.org/common">
2 <term><anchor id="LEVEL2OPLOCKS"/>level2 oplocks (S)</term>
3 <listitem><para>This parameter controls whether Samba supports
4 level2 (read-only) oplocks on a share.</para>
6 <para>Level2, or read-only oplocks allow Windows NT clients
7 that have an oplock on a file to downgrade from a read-write oplock
8 to a read-only oplock once a second client opens the file (instead
9 of releasing all oplocks on a second open, as in traditional,
10 exclusive oplocks). This allows all openers of the file that
11 support level2 oplocks to cache the file for read-ahead only (ie.
12 they may not cache writes or lock requests) and increases performance
13 for many accesses of files that are not commonly written (such as
14 application .EXE files).</para>
16 <para>Once one of the clients which have a read-only oplock
17 writes to the file all clients are notified (no reply is needed
18 or waited for) and told to break their oplocks to "none" and
19 delete any read-ahead caches.</para>
21 <para>It is recommended that this parameter be turned on
22 to speed access to shared executables.</para>
24 <para>For more discussions on level2 oplocks see the CIFS spec.</para>
26 <para>Currently, if <link linkend="KERNELOPLOCKS"><parameter moreinfo="none">kernel
27 oplocks</parameter></link> are supported then level2 oplocks are
28 not granted (even if this parameter is set to <constant>yes</constant>).
29 Note also, the <link linkend="OPLOCKS"><parameter moreinfo="none">oplocks</parameter>
30 </link> parameter must be set to <constant>yes</constant> on this share in order for
31 this parameter to have any effect.</para>
33 <para>See also the <link linkend="OPLOCKS"><parameter moreinfo="none">oplocks</parameter>
34 </link> and <link linkend="OPLOCKS"><parameter moreinfo="none">kernel oplocks</parameter>
35 </link> parameters.</para>
37 <para>Default: <command moreinfo="none">level2 oplocks = yes</command></para>