]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
smbd: add fsp_get_smb2_lease()
authorRalph Boehme <slow@samba.org>
Wed, 19 May 2021 14:58:21 +0000 (16:58 +0200)
committerRalph Boehme <slow@samba.org>
Tue, 5 Nov 2024 14:39:30 +0000 (14:39 +0000)
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
source3/smbd/proto.h
source3/smbd/smb2_oplock.c

index 5743fc1f6c9d22b1d23b1dee26f4b82d59820303..5fffa34cd72281ed9892682da9bebad4a5640d42 100644 (file)
@@ -719,6 +719,7 @@ void release_file_oplock(files_struct *fsp);
 bool remove_oplock(files_struct *fsp);
 bool downgrade_oplock(files_struct *fsp);
 bool fsp_lease_update(struct files_struct *fsp);
+const struct smb2_lease *fsp_get_smb2_lease(const struct files_struct *fsp);
 NTSTATUS downgrade_lease(struct smbXsrv_client *client,
                        uint32_t num_file_ids,
                        const struct file_id *ids,
index b7ab6195af2c9e4054c48fc77a63bab196397ec7..aa1053d006463885f8e8187e9547b5e4e839407a 100644 (file)
@@ -1893,3 +1893,14 @@ NTSTATUS delay_for_handle_lease_break_recv(struct tevent_req *req,
        tevent_req_received(req);
        return NT_STATUS_OK;
 }
+
+const struct smb2_lease *fsp_get_smb2_lease(const struct files_struct *fsp)
+{
+       if (fsp == NULL) {
+               return NULL;
+       }
+       if (fsp->lease == NULL) {
+               return NULL;
+       }
+       return &fsp->lease->lease;
+}