]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
smbd: Pass share_mode_lock to remove_lease_if_stale()
authorVolker Lendecke <vl@samba.org>
Mon, 26 Aug 2019 14:51:56 +0000 (16:51 +0200)
committerJeremy Allison <jra@samba.org>
Tue, 17 Sep 2019 22:49:38 +0000 (22:49 +0000)
We'll want to use share_mode_forall_entries next

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

index 71701a134df108205f67554b77bd05456afd0c41..c5bbb6d502bab6ce3f5565c48ddfa70d3bcd0a53 100644 (file)
@@ -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)
index a404fb6530ba9a3f313118610378459093059194..f99984b23c2ee68c127209a21f9aee0f8755703c 100644 (file)
@@ -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);
index 6c1558c1665ce7bf355364a2496bb815932d6913..73fdaa09d59ebf1d149f60c643f590d68bb8d128 100644 (file)
@@ -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)) {