smbd: Remove unused KOPLOCK flags
authorChristof Schmitt <cs@samba.org>
Fri, 24 Aug 2018 05:12:23 +0000 (22:12 -0700)
committerChristof Schmitt <cs@samba.org>
Sat, 25 Aug 2018 01:23:05 +0000 (03:23 +0200)
This effectively reverts commit 17eba16b. It looks like these flags have
been introduced as part of the onefs support which has been removed
again. As there is no other use for the flags, remove them.

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Christof Schmitt <cs@samba.org>
Autobuild-Date(master): Sat Aug 25 03:23:05 CEST 2018 on sn-devel-144

source3/include/smb.h
source3/smbd/oplock.c

index 5b3846f8715a950f50606a86148a96ed5655edb1..89469fc143320fbde4dc067ca1733e6ca947b1ad 100644 (file)
@@ -660,26 +660,9 @@ enum smbd_capability {
     DAC_OVERRIDE_CAPABILITY
 };
 
-/*
- * Kernel oplocks capability flags.
- */
-
-/* Level 2 oplocks are supported natively by kernel oplocks. */
-#define KOPLOCKS_LEVEL2_SUPPORTED              0x1
-
-/* The kernel notifies deferred openers when they can retry the open. */
-#define KOPLOCKS_DEFERRED_OPEN_NOTIFICATION    0x2
-
-/* The kernel notifies smbds when an oplock break times out. */
-#define KOPLOCKS_TIMEOUT_NOTIFICATION          0x4
-
-/* The kernel notifies smbds when an oplock is broken. */
-#define KOPLOCKS_OPLOCK_BROKEN_NOTIFICATION    0x8
-
 struct kernel_oplocks_ops;
 struct kernel_oplocks {
        const struct kernel_oplocks_ops *ops;
-       uint32_t flags;
        void *private_data;
 };
 
index 3e6d1d421be265b8d164587ae0c332247ac9c0d6..1495269efb46a9158c0b1cdf3e13c249696f745b 100644 (file)
@@ -59,13 +59,10 @@ NTSTATUS set_file_oplock(files_struct *fsp)
        bool use_kernel = lp_kernel_oplocks(SNUM(fsp->conn)) &&
                        (koplocks != NULL);
 
-       if (fsp->oplock_type == LEVEL_II_OPLOCK) {
-               if (use_kernel &&
-                   !(koplocks->flags & KOPLOCKS_LEVEL2_SUPPORTED)) {
-                       DEBUG(10, ("Refusing level2 oplock, kernel oplocks "
-                                  "don't support them\n"));
-                       return NT_STATUS_NOT_SUPPORTED;
-               }
+       if (fsp->oplock_type == LEVEL_II_OPLOCK && use_kernel) {
+               DEBUG(10, ("Refusing level2 oplock, kernel oplocks "
+                          "don't support them\n"));
+               return NT_STATUS_NOT_SUPPORTED;
        }
 
        if ((fsp->oplock_type != NO_OPLOCK) &&
@@ -747,20 +744,6 @@ static void oplock_timeout_handler(struct tevent_context *ctx,
 
 static void add_oplock_timeout_handler(files_struct *fsp)
 {
-       struct smbd_server_connection *sconn = fsp->conn->sconn;
-       struct kernel_oplocks *koplocks = sconn->oplocks.kernel_ops;
-       bool use_kernel = lp_kernel_oplocks(SNUM(fsp->conn)) &&
-                       (koplocks != NULL);
-
-       /*
-        * If kernel oplocks already notifies smbds when an oplock break times
-        * out, just return.
-        */
-       if (use_kernel &&
-           (koplocks->flags & KOPLOCKS_TIMEOUT_NOTIFICATION)) {
-               return;
-       }
-
        if (fsp->oplock_timeout != NULL) {
                DEBUG(0, ("Logic problem -- have an oplock event hanging "
                          "around\n"));
@@ -877,7 +860,7 @@ static void process_oplock_break_message(struct messaging_context *msg_ctx,
 
        use_kernel = lp_kernel_oplocks(SNUM(fsp->conn)) &&
                        (koplocks != NULL);
-       if (use_kernel && !(koplocks->flags & KOPLOCKS_LEVEL2_SUPPORTED)) {
+       if (use_kernel) {
                DEBUG(10, ("Kernel oplocks don't allow level2\n"));
                break_to &= ~SMB2_LEASE_READ;
        }