s3:param: Add "smb2 leases" parameter. Default "false".
authorJeremy Allison <jra@samba.org>
Tue, 14 Oct 2014 17:34:53 +0000 (10:34 -0700)
committerJeremy Allison <jra@samba.org>
Thu, 4 Dec 2014 04:45:10 +0000 (05:45 +0100)
This is currently marked as experimental!

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
docs-xml/smbdotconf/locking/kerneloplocks.xml
docs-xml/smbdotconf/locking/oplocks.xml
docs-xml/smbdotconf/locking/smb2leases.xml [new file with mode: 0644]
lib/param/param_table.c
source3/param/loadparm.c

index 8e3bba512268cd9b98954de3b97e90f1d533143f..d8fe22321e9098febcaa95b2accd3d112bd01dd8 100644 (file)
@@ -25,5 +25,6 @@
 
 <related>oplocks</related>
 <related>level2 oplocks</related>
+<related>smb2 leases</related>
 <value type="default">no</value>
 </samba:parameter>
index a56e9214104baf4e40d53df0ea0a6eb3ae15462c..a5e163ba74bad39cff7089d97188bbc9a69bb5d5 100644 (file)
@@ -25,5 +25,6 @@
 
 <related>kernel oplocks</related>
 <related>level2 oplocks</related>
+<related>smb2 leases</related>
 <value type="default">yes</value>
 </samba:parameter>
diff --git a/docs-xml/smbdotconf/locking/smb2leases.xml b/docs-xml/smbdotconf/locking/smb2leases.xml
new file mode 100644 (file)
index 0000000..0a734ec
--- /dev/null
@@ -0,0 +1,28 @@
+<samba:parameter name="smb2 leases"
+                 context="G"
+                                type="boolean"
+                 xmlns:samba="http://www.samba.org/samba/DTD/samba-doc">
+<description>
+       <para>
+       This boolean option tells <command moreinfo="none">smbd</command> whether to
+       globally negotiate SMB2 leases on file open requests. Leasing is an SMB2-only
+       feature which allows clients to aggressively cache files locally above and
+       beyond the caching allowed by SMB1 oplocks. This (experimental) parameter is
+       set to off by default until the SMB2 leasing code is declared fully stable.
+       </para>
+
+       <para>
+       This is only available with <smbconfoption name="oplocks">yes</smbconfoption>
+       and <smbconfoption name="kernel oplocks">no</smbconfoption>.
+       </para>
+
+       <para>
+       The Samba implementation of leases is currently marked as experimental!
+       </para>
+</description>
+
+<related>oplocks</related>
+<related>kernel oplocks</related>
+<related>level2 oplocks</related>
+<value type="default">no</value>
+</samba:parameter>
index 5dbcda8f9437ec158f7417486a1190c02ca5d637..18b0628791c4f1a7bbe122e975bfe3a59d077f9e 100644 (file)
@@ -3022,6 +3022,15 @@ struct parm_struct parm_table[] = {
                .enum_list      = NULL,
                .flags          = FLAG_ADVANCED | FLAG_SHARE | FLAG_GLOBAL,
        },
+       {
+               .label          = "smb2 leases",
+               .type           = P_BOOL,
+               .p_class        = P_GLOBAL,
+               .offset         = GLOBAL_VAR(smb2_leases),
+               .special        = NULL,
+               .enum_list      = NULL,
+               .flags          = FLAG_ADVANCED,
+       },
        {
                .label          = "locking",
                .type           = P_BOOL,
index 8494c3f54bd837ac77514fa1bdfc3cd23d8fc768..da50e3a58247acf0af9e5c89123779a27e2b6426 100644 (file)
@@ -855,6 +855,7 @@ static void init_globals(struct loadparm_context *lp_ctx, bool reinit_globals)
        Globals.smb2_max_write = DEFAULT_SMB2_MAX_WRITE;
        Globals.smb2_max_trans = DEFAULT_SMB2_MAX_TRANSACT;
        Globals.ismb2_max_credits = DEFAULT_SMB2_MAX_CREDITS;
+       Globals.smb2_leases = false;
 
        string_set(Globals.ctx, &Globals.ncalrpc_dir, get_dyn_NCALRPCDIR());