smbd: Remove "have_share_modes" from "struct share_mode_data"
authorVolker Lendecke <vl@samba.org>
Thu, 3 Dec 2020 16:16:25 +0000 (17:16 +0100)
committerJeremy Allison <jra@samba.org>
Fri, 4 Dec 2020 22:32:38 +0000 (22:32 +0000)
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 <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Fri Dec  4 22:32:38 UTC 2020 on sn-devel-184

source3/librpc/idl/open_files.idl
source3/locking/share_mode_lock.c

index 891ff1f763d68fbb6fd49bbf0377df6de9219030..49bc09d77b6baa903616e56676a499023638b1e7 100644 (file)
@@ -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;
 
index cfce43beabe953c80bb4c2a52bdb8767e196a664..8ad9341a765c907a7dc84719675419981863ea7c 100644 (file)
@@ -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: