diff options
author | Volker Lendecke <vl@samba.org> | 2019-09-10 21:17:34 +0200 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2019-09-17 22:49:37 +0000 |
commit | 4955481a678eb69df380c3c915cef95feec92443 (patch) | |
tree | 2bc757f5dcd2fb1622e8ff6dba07600d3b26de11 /source3/locking | |
parent | f82aebe943534d5ab9b89dcec2150f985b574115 (diff) | |
download | samba-4955481a678eb69df380c3c915cef95feec92443.tar.gz |
smbd: Avoid "share_mode_lock" dependency cleanup_disconnected_lease()
share_mode_forall_leases() will stop passing "lck" soon.
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/share_mode_lock.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/source3/locking/share_mode_lock.c b/source3/locking/share_mode_lock.c index fada7e5691e..3e805d47d48 100644 --- a/source3/locking/share_mode_lock.c +++ b/source3/locking/share_mode_lock.c @@ -1073,14 +1073,18 @@ int share_entry_forall(int (*fn)(struct file_id fid, return share_mode_forall(share_entry_traverse_fn, &state); } +struct cleanup_disconnected_lease_state { + struct file_id fid; +}; + static bool cleanup_disconnected_lease(struct share_mode_lock *lck, struct share_mode_entry *e, void *private_data) { - struct share_mode_data *d = lck->data; + struct cleanup_disconnected_lease_state *state = private_data; NTSTATUS status; - status = leases_db_del(&e->client_guid, &e->lease_key, &d->id); + status = leases_db_del(&e->client_guid, &e->lease_key, &state->fid); if (!NT_STATUS_IS_OK(status)) { DBG_DEBUG("leases_db_del failed: %s\n", @@ -1093,6 +1097,7 @@ static bool cleanup_disconnected_lease(struct share_mode_lock *lck, bool share_mode_cleanup_disconnected(struct file_id fid, uint64_t open_persistent_id) { + struct cleanup_disconnected_lease_state state = { .fid = fid }; bool ret = false; TALLOC_CTX *frame = talloc_stackframe(); unsigned n; @@ -1147,7 +1152,7 @@ bool share_mode_cleanup_disconnected(struct file_id fid, } } - ok = share_mode_forall_leases(lck, cleanup_disconnected_lease, NULL); + ok = share_mode_forall_leases(lck, cleanup_disconnected_lease, &state); if (!ok) { DBG_DEBUG("failed to clean up leases associated " "with file (file-id='%s', servicepath='%s', " |