summaryrefslogtreecommitdiff
path: root/source3/locking
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2019-09-10 21:21:01 +0200
committerJeremy Allison <jra@samba.org>2019-09-17 22:49:37 +0000
commitf69310672501c0e2d0afe638a18a0e21fec17298 (patch)
tree5dff45c1ec7bf8350b0902394273183d70c1b6f9 /source3/locking
parent4955481a678eb69df380c3c915cef95feec92443 (diff)
downloadsamba-f69310672501c0e2d0afe638a18a0e21fec17298.tar.gz
smbd: Stop passing "share_mode_lock" via share_mode_forall_leases()
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>
Diffstat (limited to 'source3/locking')
-rw-r--r--source3/locking/locking.c8
-rw-r--r--source3/locking/proto.h3
-rw-r--r--source3/locking/share_mode_lock.c3
3 files changed, 5 insertions, 9 deletions
diff --git a/source3/locking/locking.c b/source3/locking/locking.c
index a8b05a40ea9..ae42058e605 100644
--- a/source3/locking/locking.c
+++ b/source3/locking/locking.c
@@ -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;
diff --git a/source3/locking/proto.h b/source3/locking/proto.h
index ae8768e68e9..32f6c64965c 100644
--- a/source3/locking/proto.h
+++ b/source3/locking/proto.h
@@ -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);
diff --git a/source3/locking/share_mode_lock.c b/source3/locking/share_mode_lock.c
index 3e805d47d48..b6de20ef4e3 100644
--- a/source3/locking/share_mode_lock.c
+++ b/source3/locking/share_mode_lock.c
@@ -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;