summaryrefslogtreecommitdiff
path: root/source3/locking
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2019-08-23 17:44:25 +0200
committerJeremy Allison <jra@samba.org>2019-09-17 22:49:38 +0000
commit609143adb68b05dbfa13db0f9289a33b53919a71 (patch)
tree49fcca854c6b02057ccf9732b12d376864dccf84 /source3/locking
parente4a5a017c5d8c4aac14e3440f498374700dd7fbd (diff)
downloadsamba-609143adb68b05dbfa13db0f9289a33b53919a71.tar.gz
smbd: Remove unused share_mode_stale_pid()
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.c57
-rw-r--r--source3/locking/proto.h1
2 files changed, 5 insertions, 53 deletions
diff --git a/source3/locking/locking.c b/source3/locking/locking.c
index cf64a962cd8..e7b8fd3a503 100644
--- a/source3/locking/locking.c
+++ b/source3/locking/locking.c
@@ -756,58 +756,6 @@ bool share_entry_stale_pid(struct share_mode_entry *e)
return true;
}
-/*
- * In case d->share_modes[i] conflicts with something or otherwise is
- * being used, we need to make sure the corresponding process still
- * exists.
- */
-bool share_mode_stale_pid(struct share_mode_data *d, uint32_t idx)
-{
- struct share_mode_entry *e;
- bool stale;
-
- if (idx > d->num_share_modes) {
- DBG_WARNING("Asking for index %"PRIu32", "
- "only %"PRIu32" around\n",
- idx,
- d->num_share_modes);
- return false;
- }
- e = &d->share_modes[idx];
-
- stale = share_entry_stale_pid(e);
- if (!stale) {
- return false;
- }
- d->modified = true;
-
- if (d->num_delete_tokens != 0) {
- uint32_t i;
-
- for (i=0; i<d->num_share_modes; i++) {
- bool valid = !d->share_modes[i].stale;
- if (valid) {
- break;
- }
- }
-
- if (i == d->num_share_modes) {
- /*
- * No valid (non-stale) share mode found, all
- * who might have set the delete token are
- * gone.
- */
- TALLOC_FREE(d->delete_tokens);
- d->num_delete_tokens = 0;
- }
- }
-
- remove_share_mode_lease(d, e);
-
- d->modified = true;
- return true;
-}
-
void remove_stale_share_mode_entries(struct share_mode_data *d)
{
uint32_t i;
@@ -822,6 +770,11 @@ void remove_stale_share_mode_entries(struct share_mode_data *d)
}
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,
diff --git a/source3/locking/proto.h b/source3/locking/proto.h
index c08517d8ce1..a404fb6530b 100644
--- a/source3/locking/proto.h
+++ b/source3/locking/proto.h
@@ -170,7 +170,6 @@ void get_file_infos(struct file_id id,
struct timespec *write_time);
bool is_valid_share_mode_entry(const struct share_mode_entry *e);
bool share_entry_stale_pid(struct share_mode_entry *e);
-bool share_mode_stale_pid(struct share_mode_data *d, uint32_t idx);
bool set_share_mode(struct share_mode_lock *lck,
struct files_struct *fsp,
uid_t uid,