]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
smbd: Move is_same_lease() up in the file
authorVolker Lendecke <vl@samba.org>
Sat, 10 Aug 2019 13:01:00 +0000 (15:01 +0200)
committerJeremy Allison <jra@samba.org>
Mon, 19 Aug 2019 23:14:38 +0000 (23:14 +0000)
The next commit will need it there

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
source3/smbd/open.c

index d889faedb440b8cdfd0ee5f684f2cbb33277e990..262143fcdabc91baa3563ca063e06497aa39239b 100644 (file)
@@ -1829,6 +1829,23 @@ static bool validate_oplock_types(struct share_mode_lock *lck)
        return true;
 }
 
+static bool is_same_lease(const files_struct *fsp,
+                         const struct share_mode_entry *e,
+                         const struct smb2_lease *lease)
+{
+       if (e->op_type != LEASE_OPLOCK) {
+               return false;
+       }
+       if (lease == NULL) {
+               return false;
+       }
+
+       return smb2_lease_equal(fsp_client_guid(fsp),
+                               &lease->lease_key,
+                               &e->client_guid,
+                               &e->lease_key);
+}
+
 static bool delay_for_oplock(files_struct *fsp,
                             int oplock_request,
                             const struct smb2_lease *lease,
@@ -2164,23 +2181,6 @@ static NTSTATUS grant_fsp_lease(struct files_struct *fsp,
        return status;
 }
 
-static bool is_same_lease(const files_struct *fsp,
-                         const struct share_mode_entry *e,
-                         const struct smb2_lease *lease)
-{
-       if (e->op_type != LEASE_OPLOCK) {
-               return false;
-       }
-       if (lease == NULL) {
-               return false;
-       }
-
-       return smb2_lease_equal(fsp_client_guid(fsp),
-                               &lease->lease_key,
-                               &e->client_guid,
-                               &e->lease_key);
-}
-
 static int map_lease_type_to_oplock(uint32_t lease_type)
 {
        int result = NO_OPLOCK;