[SCM] Samba Shared Repository - branch master updated

Christof Schmitt cs at samba.org
Sat Aug 25 01:24:02 UTC 2018


The branch, master has been updated
       via  e5e6619 smbd: Remove unused KOPLOCK flags
      from  7c89edf Fix uClibc build on 64bit platforms by including stdint.h

https://git.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit e5e66191f214b521f67a19401a72171d9952616a
Author: Christof Schmitt <cs at samba.org>
Date:   Thu Aug 23 22:12:23 2018 -0700

    smbd: Remove unused KOPLOCK flags
    
    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 at samba.org>
    Reviewed-by: Ralph Boehme <slow at samba.org>
    
    Autobuild-User(master): Christof Schmitt <cs at samba.org>
    Autobuild-Date(master): Sat Aug 25 03:23:05 CEST 2018 on sn-devel-144

-----------------------------------------------------------------------

Summary of changes:
 source3/include/smb.h | 17 -----------------
 source3/smbd/oplock.c | 27 +++++----------------------
 2 files changed, 5 insertions(+), 39 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/include/smb.h b/source3/include/smb.h
index 5b3846f..89469fc 100644
--- a/source3/include/smb.h
+++ b/source3/include/smb.h
@@ -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;
 };
 
diff --git a/source3/smbd/oplock.c b/source3/smbd/oplock.c
index 3e6d1d4..1495269 100644
--- a/source3/smbd/oplock.c
+++ b/source3/smbd/oplock.c
@@ -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;
 	}


-- 
Samba Shared Repository



More information about the samba-cvs mailing list