s3/smbd: update exclusive oplock optimisation to the lease area
authorRalph Boehme <slow@samba.org>
Thu, 20 Apr 2017 19:37:37 +0000 (21:37 +0200)
committerRalph Boehme <slow@samba.org>
Sat, 6 May 2017 17:01:15 +0000 (19:01 +0200)
This is similar to 9533a55ee5ffe430589dcea845851b84876ef656 but this
time in the contend_level2_oplocks_begin_default() function.

The idea of the optimisation is to avoid expensive db queries in
locking.tdb if we *know* we're the only open.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=12766

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/smbd/oplock.c

index 417eda530e397c8c8690b835f89d0cf805ee9f80..cd92c8334f0b05875a0778c09ee87d2c6b99e3cf 100644 (file)
@@ -1044,7 +1044,7 @@ static void contend_level2_oplocks_begin_default(files_struct *fsp,
         * the shared memory area whilst doing this.
         */
 
-       if (EXCLUSIVE_OPLOCK_TYPE(fsp->oplock_type)) {
+       if (fsp_lease_type_is_exclusive(fsp)) {
                /*
                 * There can't be any level2 oplocks, we're alone.
                 */