From bbd94522b1e626ed1a4e87c297cfebe982fdbbce Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Thu, 3 Dec 2020 17:16:25 +0100 Subject: [PATCH] smbd: Remove "have_share_modes" from "struct share_mode_data" Nobody in share_mode_lock.c looked at that value anymore, so we don't need to manually maintain it. Signed-off-by: Volker Lendecke Reviewed-by: Jeremy Allison Autobuild-User(master): Jeremy Allison Autobuild-Date(master): Fri Dec 4 22:32:38 UTC 2020 on sn-devel-184 --- source3/librpc/idl/open_files.idl | 1 - source3/locking/share_mode_lock.c | 14 ++------------ 2 files changed, 2 insertions(+), 13 deletions(-) diff --git a/source3/librpc/idl/open_files.idl b/source3/librpc/idl/open_files.idl index 891ff1f763d..49bc09d77b6 100644 --- a/source3/librpc/idl/open_files.idl +++ b/source3/librpc/idl/open_files.idl @@ -64,7 +64,6 @@ interface open_files NTTIME changed_write_time; [skip] boolean8 fresh; [skip] boolean8 modified; - [skip] boolean8 have_share_modes; [ignore] file_id id; /* In memory key used to lookup cache. */ } share_mode_data; diff --git a/source3/locking/share_mode_lock.c b/source3/locking/share_mode_lock.c index cfce43beabe..8ad9341a765 100644 --- a/source3/locking/share_mode_lock.c +++ b/source3/locking/share_mode_lock.c @@ -620,14 +620,6 @@ static struct share_mode_data *parse_share_modes( NDR_PRINT_DEBUG(share_mode_data, d); } - /* - * We have a non-zero locking.tdb record that was correctly - * parsed. This means a share_entries.tdb entry exists, - * otherwise we'd have paniced before in - * share_mode_data_store() - */ - d->have_share_modes = true; - return d; fail: TALLOC_FREE(d); @@ -1875,7 +1867,6 @@ bool set_share_mode(struct share_mode_lock *lck, /* * Storing a fresh record with just one share entry */ - d->have_share_modes = true; d->modified = true; } @@ -2069,9 +2060,9 @@ bool share_mode_forall_entries( if ((ltdb->num_share_entries != 0 ) && (num_share_entries == 0)) { /* - * This routine wiped all share entries + * This routine wiped all share entries, let + * share_mode_data_store() delete the record */ - d->have_share_modes = false; d->modified = true; } @@ -2521,7 +2512,6 @@ bool reset_share_mode_entry( goto done; } - d->have_share_modes = true; d->modified = true; ret = true; done: -- 2.11.4.GIT