diff options
author | Volker Lendecke <vl@samba.org> | 2019-08-26 18:59:44 +0200 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2019-09-17 22:49:39 +0000 |
commit | f96aa7063e846021b69403cc9caa091c8e09b578 (patch) | |
tree | a63891e15ea643b2b043adfad541d19586bd59f4 /source3/locking | |
parent | 5151b6d58be54d210795e7769033cb33e6c75b0a (diff) | |
download | samba-f96aa7063e846021b69403cc9caa091c8e09b578.tar.gz |
smbd: Make remove_stale_share_mode_entries() static in share_mode_lock.c
... 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>
Diffstat (limited to 'source3/locking')
-rw-r--r-- | source3/locking/locking.c | 21 | ||||
-rw-r--r-- | source3/locking/proto.h | 1 | ||||
-rw-r--r-- | source3/locking/share_mode_lock.c | 21 |
3 files changed, 21 insertions, 22 deletions
diff --git a/source3/locking/locking.c b/source3/locking/locking.c index a24d5b68048..e3fc354a5fa 100644 --- a/source3/locking/locking.c +++ b/source3/locking/locking.c @@ -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, diff --git a/source3/locking/proto.h b/source3/locking/proto.h index f99984b23c2..fe171ea5012 100644 --- a/source3/locking/proto.h +++ b/source3/locking/proto.h @@ -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); diff --git a/source3/locking/share_mode_lock.c b/source3/locking/share_mode_lock.c index 92ba3fe046e..54c82234f94 100644 --- a/source3/locking/share_mode_lock.c +++ b/source3/locking/share_mode_lock.c @@ -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. ********************************************************************/ |