From: Volker Lendecke Date: Mon, 26 Aug 2019 14:51:56 +0000 (+0200) Subject: smbd: Pass share_mode_lock to remove_lease_if_stale() X-Git-Tag: talloc-2.3.1~786 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=4d512f40f9f6c1689cc4e0ace541079fda98c611;p=thirdparty%2Fsamba.git smbd: Pass share_mode_lock to remove_lease_if_stale() We'll want to use share_mode_forall_entries next Signed-off-by: Volker Lendecke Reviewed-by: Jeremy Allison --- diff --git a/source3/locking/locking.c b/source3/locking/locking.c index 71701a134df..c5bbb6d502b 100644 --- a/source3/locking/locking.c +++ b/source3/locking/locking.c @@ -674,10 +674,11 @@ bool is_valid_share_mode_entry(const struct share_mode_entry *e) return (num_props != 0); } -NTSTATUS remove_lease_if_stale(const struct share_mode_data *d, +NTSTATUS remove_lease_if_stale(struct share_mode_lock *lck, const struct GUID *client_guid, const struct smb2_lease_key *lease_key) { + struct share_mode_data *d = lck->data; uint32_t i; NTSTATUS status; @@ -729,7 +730,7 @@ static void remove_share_mode_lease(struct share_mode_lock *lck, return; } - remove_lease_if_stale(lck->data, &e->client_guid, &e->lease_key); + remove_lease_if_stale(lck, &e->client_guid, &e->lease_key); } bool share_entry_stale_pid(struct share_mode_entry *e) diff --git a/source3/locking/proto.h b/source3/locking/proto.h index a404fb6530b..f99984b23c2 100644 --- a/source3/locking/proto.h +++ b/source3/locking/proto.h @@ -184,7 +184,7 @@ bool reset_share_mode_entry( struct server_id new_pid, uint64_t new_mid, uint64_t new_share_file_id); -NTSTATUS remove_lease_if_stale(const struct share_mode_data *d, +NTSTATUS remove_lease_if_stale(struct share_mode_lock *lck, const struct GUID *client_guid, const struct smb2_lease_key *lease_key); void remove_stale_share_mode_entries(struct share_mode_data *d); diff --git a/source3/smbd/open.c b/source3/smbd/open.c index 6c1558c1665..73fdaa09d59 100644 --- a/source3/smbd/open.c +++ b/source3/smbd/open.c @@ -3638,7 +3638,7 @@ static NTSTATUS open_file_ntcreate(connection_struct *conn, if (!ok) { if (fsp->oplock_type == LEASE_OPLOCK) { status = remove_lease_if_stale( - lck->data, + lck, fsp_client_guid(fsp), &fsp->lease->lease.lease_key); if (!NT_STATUS_IS_OK(status)) {