]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
smbd: make file_has_brlocks() public
authorRalph Boehme <slow@samba.org>
Sat, 9 Aug 2025 09:39:55 +0000 (11:39 +0200)
committerVolker Lendecke <vl@samba.org>
Fri, 15 Aug 2025 15:46:35 +0000 (15:46 +0000)
Prepares for a change to file_has_brlocks() in the next commit. No change in
behaviour.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=15894

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
source3/locking/brlock.c
source3/locking/proto.h
source3/smbd/open.c

index 787c65c16f870007d6e904ae19b5c760ca89f5d9..7ef8fabdf39a335aa8b25268b7356a03950c3fc6 100644 (file)
@@ -1998,3 +1998,14 @@ void brl_set_modified(struct byte_range_lock *br_lck, bool modified)
 {
        br_lck->modified = modified;
 }
+
+bool file_has_brlocks(files_struct *fsp)
+{
+       struct byte_range_lock *br_lck;
+
+       br_lck = brl_get_locks_readonly(fsp);
+       if (!br_lck)
+               return false;
+
+       return (brl_num_locks(br_lck) > 0);
+}
index 29a4092c80553d2c1951175f7326739304cbc4b7..ab19632abb7512cc801d1172a2c1ac151ddfa5fa 100644 (file)
@@ -105,6 +105,7 @@ struct byte_range_lock *brl_get_locks(TALLOC_CTX *mem_ctx,
 struct byte_range_lock *brl_get_locks_readonly(files_struct *fsp);
 bool brl_cleanup_disconnected(struct file_id fid, uint64_t open_persistent_id);
 void brl_set_modified(struct byte_range_lock *br_lck, bool modified);
+bool file_has_brlocks(files_struct *fsp);
 
 /* The following definitions come from locking/locking.c  */
 
index 1bf8262d4e714db5e3df89ea5deb7132f6b403c8..ac17a10b1b757a4c63dbd9625bf8c0f8323ab8fe 100644 (file)
@@ -1879,17 +1879,6 @@ static bool is_same_lease(const files_struct *fsp,
                                &e->lease_key);
 }
 
-static bool file_has_brlocks(files_struct *fsp)
-{
-       struct byte_range_lock *br_lck;
-
-       br_lck = brl_get_locks_readonly(fsp);
-       if (!br_lck)
-               return false;
-
-       return (brl_num_locks(br_lck) > 0);
-}
-
 struct fsp_lease *find_fsp_lease(struct files_struct *new_fsp,
                                 const struct smb2_lease_key *key,
                                 uint32_t current_state,