]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
smbd: Make remove_stale_share_mode_entries() static in share_mode_lock.c
authorVolker Lendecke <vl@samba.org>
Mon, 26 Aug 2019 16:59:44 +0000 (18:59 +0200)
committerJeremy Allison <jra@samba.org>
Tue, 17 Sep 2019 22:49:39 +0000 (22:49 +0000)
... to the place where the record is stored in the database

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

index a24d5b68048e78754aed6d0f8fd1bd8cebf30c05..e3fc354a5fa08552c6a3a404fd5d961ece4cb1d9 100644 (file)
@@ -779,27 +779,6 @@ bool share_entry_stale_pid(struct share_mode_entry *e)
        return true;
 }
 
-void remove_stale_share_mode_entries(struct share_mode_data *d)
-{
-       uint32_t i;
-
-       i = 0;
-       while (i < d->num_share_modes) {
-               if (d->share_modes[i].stale) {
-                       struct share_mode_entry *m = d->share_modes;
-                       m[i] = m[d->num_share_modes-1];
-                       d->num_share_modes -= 1;
-                       continue;
-               }
-               i += 1;
-       }
-
-       if (d->num_share_modes == 0) {
-               TALLOC_FREE(d->delete_tokens);
-               d->num_delete_tokens = 0;
-       }
-}
-
 bool set_share_mode(struct share_mode_lock *lck,
                    struct files_struct *fsp,
                    uid_t uid,
index f99984b23c2ee68c127209a21f9aee0f8755703c..fe171ea501244c05d2d2d0e773bb18ddc954d690 100644 (file)
@@ -187,7 +187,6 @@ bool reset_share_mode_entry(
 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);
 bool del_share_mode(struct share_mode_lock *lck, files_struct *fsp);
 bool mark_share_mode_disconnected(struct share_mode_lock *lck,
                                  struct files_struct *fsp);
index 92ba3fe046e8e1b0f77d2a84cb39105c34b8a19e..54c82234f94ed9539b17ffabe447162f83087f00 100644 (file)
@@ -386,6 +386,27 @@ fail:
        return NULL;
 }
 
+static void remove_stale_share_mode_entries(struct share_mode_data *d)
+{
+       uint32_t i;
+
+       i = 0;
+       while (i < d->num_share_modes) {
+               if (d->share_modes[i].stale) {
+                       struct share_mode_entry *m = d->share_modes;
+                       m[i] = m[d->num_share_modes-1];
+                       d->num_share_modes -= 1;
+                       continue;
+               }
+               i += 1;
+       }
+
+       if (d->num_share_modes == 0) {
+               TALLOC_FREE(d->delete_tokens);
+               d->num_delete_tokens = 0;
+       }
+}
+
 /*******************************************************************
  If modified, store the share_mode_data back into the database.
 ********************************************************************/