[SCM] Samba Shared Repository - branch master updated

Jeremy Allison jra at samba.org
Wed Nov 13 21:42:02 UTC 2019


The branch, master has been updated
       via  231397f45ee smbd: Make share_mode_do_locked() pass TDB_DATA instead of a record
      from  5343cec5f0a gitlab-ci: Run samba-fileserver-heimdalkrb5

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


- Log -----------------------------------------------------------------
commit 231397f45ee7a328ea41214b1367632298339e44
Author: Volker Lendecke <vl at samba.org>
Date:   Fri Nov 1 12:33:23 2019 +0100

    smbd: Make share_mode_do_locked() pass TDB_DATA instead of a record
    
    No callback used (and should not use) the record directly, this is all
    handled within share_mode_lock.c
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    
    Autobuild-User(master): Jeremy Allison <jra at samba.org>
    Autobuild-Date(master): Wed Nov 13 21:41:09 UTC 2019 on sn-devel-184

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

Summary of changes:
 source3/locking/locking.c         |  2 +-
 source3/locking/proto.h           |  4 +++-
 source3/locking/share_mode_lock.c | 20 ++++++++++----------
 3 files changed, 14 insertions(+), 12 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/locking/locking.c b/source3/locking/locking.c
index 52309e5fc81..7822c2b3665 100644
--- a/source3/locking/locking.c
+++ b/source3/locking/locking.c
@@ -247,7 +247,7 @@ struct do_lock_state {
 };
 
 static void do_lock_fn(
-	struct db_record *rec,
+	TDB_DATA value,
 	bool *modified_dependent,
 	void *private_data)
 {
diff --git a/source3/locking/proto.h b/source3/locking/proto.h
index fe171ea5012..fc11ef8863c 100644
--- a/source3/locking/proto.h
+++ b/source3/locking/proto.h
@@ -23,6 +23,8 @@
 #ifndef _LOCKING_PROTO_H_
 #define _LOCKING_PROTO_H_
 
+#include <tdb.h>
+
 /* The following definitions come from locking/brlock.c  */
 
 void brl_init(bool read_only);
@@ -142,7 +144,7 @@ bool file_has_read_lease(struct files_struct *fsp);
 struct db_record;
 NTSTATUS share_mode_do_locked(
 	struct file_id id,
-	void (*fn)(struct db_record *rec,
+	void (*fn)(TDB_DATA value,
 		   bool *modified_dependent,
 		   void *private_data),
 	void *private_data);
diff --git a/source3/locking/share_mode_lock.c b/source3/locking/share_mode_lock.c
index 4fcca861e48..234dd90c1d0 100644
--- a/source3/locking/share_mode_lock.c
+++ b/source3/locking/share_mode_lock.c
@@ -225,10 +225,9 @@ struct fsp_update_share_mode_flags_state {
 };
 
 static void fsp_update_share_mode_flags_fn(
-	struct db_record *rec, bool *modified_dependent, void *private_data)
+	TDB_DATA value, bool *modified_dependent, void *private_data)
 {
 	struct fsp_update_share_mode_flags_state *state = private_data;
-	TDB_DATA value = dbwrap_record_get_value(rec);
 	DATA_BLOB blob = { .data = value.dptr, .length = value.dsize };
 	uint64_t seq;
 
@@ -715,7 +714,7 @@ static int share_mode_lock_destructor(struct share_mode_lock *lck)
 }
 
 struct share_mode_do_locked_state {
-	void (*fn)(struct db_record *rec,
+	void (*fn)(TDB_DATA value,
 		   bool *modified_dependent,
 		   void *private_data);
 	void *private_data;
@@ -727,6 +726,7 @@ static void share_mode_do_locked_fn(struct db_record *rec,
 	struct share_mode_do_locked_state *state = private_data;
 	bool modified_dependent = false;
 	bool reset_static_share_mode_record = false;
+	TDB_DATA value = dbwrap_record_get_value(rec);
 
 	if (static_share_mode_record == NULL) {
 		static_share_mode_record = rec;
@@ -736,7 +736,7 @@ static void share_mode_do_locked_fn(struct db_record *rec,
 		SMB_ASSERT(static_share_mode_record == rec);
 	}
 
-	state->fn(rec, &modified_dependent, state->private_data);
+	state->fn(value, &modified_dependent, state->private_data);
 
 	if (modified_dependent) {
 		dbwrap_watched_wakeup(rec);
@@ -749,7 +749,7 @@ static void share_mode_do_locked_fn(struct db_record *rec,
 
 NTSTATUS share_mode_do_locked(
 	struct file_id id,
-	void (*fn)(struct db_record *rec,
+	void (*fn)(TDB_DATA value,
 		   bool *modified_dependent,
 		   void *private_data),
 	void *private_data)
@@ -759,7 +759,7 @@ NTSTATUS share_mode_do_locked(
 
 	if (static_share_mode_record != NULL) {
 		bool modified_dependent = false;
-		TDB_DATA static_key;
+		TDB_DATA static_key, static_value;
 		int cmp;
 
 		static_key = dbwrap_record_get_key(static_share_mode_record);
@@ -771,9 +771,9 @@ NTSTATUS share_mode_do_locked(
 			return NT_STATUS_INVALID_LOCK_SEQUENCE;
 		}
 
-		fn(static_share_mode_record,
-		   &modified_dependent,
-		   private_data);
+		static_value = dbwrap_record_get_value(static_share_mode_record);
+
+		fn(static_value, &modified_dependent, private_data);
 
 		if (modified_dependent) {
 			dbwrap_watched_wakeup(static_share_mode_record);
@@ -798,7 +798,7 @@ NTSTATUS share_mode_do_locked(
 	return NT_STATUS_OK;
 }
 
-static void share_mode_wakeup_waiters_fn(struct db_record *rec,
+static void share_mode_wakeup_waiters_fn(TDB_DATA value,
 					 bool *modified_dependent,
 					 void *private_data)
 {


-- 
Samba Shared Repository



More information about the samba-cvs mailing list