]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
smbd: Make share_mode_for_one_entry() use just a uint8*
authorVolker Lendecke <vl@samba.org>
Mon, 27 Apr 2020 11:16:00 +0000 (13:16 +0200)
committerRalph Boehme <slow@samba.org>
Tue, 5 May 2020 13:23:49 +0000 (13:23 +0000)
"num_share_modes" is passed separately, so "data.dsize" was not used

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Tue May  5 13:23:49 UTC 2020 on sn-devel-184

source3/locking/share_mode_lock.c

index 26f8da8cfb43ce82b9160a15dd91e76540a7c2f3..de59b8d254580defc290561536310f6835f34e5c 100644 (file)
@@ -1689,12 +1689,12 @@ struct share_mode_forall_entries_state {
 static bool share_mode_for_one_entry(
        struct share_mode_forall_entries_state *state,
        size_t *i,
+       uint8_t *data,
        size_t *num_share_modes,
-       TDB_DATA data,
        bool *writeback)
 {
        DATA_BLOB blob = {
-               .data = data.dptr + (*i) * SHARE_MODE_ENTRY_SIZE,
+               .data = data + (*i) * SHARE_MODE_ENTRY_SIZE,
                .length = SHARE_MODE_ENTRY_SIZE,
        };
        struct share_mode_entry e = {.pid.pid=0};
@@ -1802,7 +1802,7 @@ static void share_mode_forall_entries_fn(
        i = 0;
        while (i<num_share_modes) {
                stop = share_mode_for_one_entry(
-                       state, &i, &num_share_modes, data, &writeback);
+                       state, &i, data.dptr, &num_share_modes, &writeback);
                if (stop) {
                        break;
                }