smbd: Stop passing "share_mode_lock" via share_mode_forall_leases()
authorVolker Lendecke <vl@samba.org>
Tue, 10 Sep 2019 19:21:01 +0000 (21:21 +0200)
committerJeremy Allison <jra@samba.org>
Tue, 17 Sep 2019 22:49:37 +0000 (22:49 +0000)
Why? Next commit will make share_mode_forall_leases() use
share_mode_forall_entries(), and that does not necessarily have to
depend on "share_mode_lock". And as we can pass the required
information via "private_data", don't embed the "share_mode_lock"
reference into this lowlevel library routine.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/locking/locking.c
source3/locking/proto.h
source3/locking/share_mode_lock.c
source3/smbd/oplock.c

index a8b05a40ea955abfbaf63e5371dedc36aedcec41..ae42058e6055a9166a5d41db5e752272249b9b9b 100644 (file)
@@ -478,8 +478,7 @@ struct rename_share_filename_state {
        struct file_rename_message msg;
 };
 
-static bool rename_lease_fn(struct share_mode_lock *lck,
-                           struct share_mode_entry *e,
+static bool rename_lease_fn(struct share_mode_entry *e,
                            void *private_data)
 {
        struct rename_share_filename_state *state = private_data;
@@ -1371,8 +1370,7 @@ bool share_mode_forall_entries(
 
 bool share_mode_forall_leases(
        struct share_mode_lock *lck,
-       bool (*fn)(struct share_mode_lock *lck,
-                  struct share_mode_entry *e,
+       bool (*fn)(struct share_mode_entry *e,
                   void *private_data),
        void *private_data)
 {
@@ -1425,7 +1423,7 @@ bool share_mode_forall_leases(
                        continue;
                }
 
-               stop = fn(lck, e, private_data);
+               stop = fn(e, private_data);
                if (stop) {
                        TALLOC_FREE(leases);
                        return true;
index ae8768e68e91be96c9b6cd7db2a93bb2ca45e933..32f6c64965c1871ef586203475a34a5825496539 100644 (file)
@@ -218,8 +218,7 @@ bool share_mode_cleanup_disconnected(struct file_id id,
                                     uint64_t open_persistent_id);
 bool share_mode_forall_leases(
        struct share_mode_lock *lck,
-       bool (*fn)(struct share_mode_lock *lck,
-                  struct share_mode_entry *e,
+       bool (*fn)(struct share_mode_entry *e,
                   void *private_data),
        void *private_data);
 
index 3e805d47d481d293f8bf5ef6cb0134788f00f5ff..b6de20ef4e3a25e4b810e2a1fb44419e8d0acfbd 100644 (file)
@@ -1077,8 +1077,7 @@ struct cleanup_disconnected_lease_state {
        struct file_id fid;
 };
 
-static bool cleanup_disconnected_lease(struct share_mode_lock *lck,
-                                      struct share_mode_entry *e,
+static bool cleanup_disconnected_lease(struct share_mode_entry *e,
                                       void *private_data)
 {
        struct cleanup_disconnected_lease_state *state = private_data;
index 3c57e0a99f296d8b96dcd9f44ec477f367557b2e..44aeaf48a63c3a2dda1196f0f9ff6afd0c66ac8f 100644 (file)
@@ -1154,8 +1154,7 @@ struct break_to_none_state {
        size_t num_broken;
 };
 
-static bool do_break_lease_to_none(struct share_mode_lock *lck,
-                                  struct share_mode_entry *e,
+static bool do_break_lease_to_none(struct share_mode_entry *e,
                                   void *private_data)
 {
        struct break_to_none_state *state = private_data;