1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00

smbd: Avoid a reference to share_mode_data->num_share_modes

share_mode_data->num_share_modes will go away soon, count the values
directly while walking the array.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
This commit is contained in:
Volker Lendecke 2019-12-10 14:41:57 +01:00 committed by Jeremy Allison
parent 5a2fa45741
commit 0df06f51ff

View File

@ -1197,6 +1197,7 @@ int share_entry_forall(int (*fn)(struct file_id fid,
struct cleanup_disconnected_state {
struct share_mode_lock *lck;
uint64_t open_persistent_id;
size_t num_disconnected;
bool found_connected;
};
@ -1265,6 +1266,8 @@ static bool share_mode_find_connected_fn(
return true;
}
state->num_disconnected += 1;
return false;
}
@ -1334,11 +1337,11 @@ bool share_mode_cleanup_disconnected(struct file_id fid,
goto done;
}
DBG_DEBUG("cleaning up %u entries for file "
DBG_DEBUG("cleaning up %zu entries for file "
"(file-id='%s', servicepath='%s', "
"base_name='%s%s%s') "
"from open_persistent_id %"PRIu64"\n",
data->num_share_modes,
state.num_disconnected,
file_id_str_buf(fid, &idbuf),
data->servicepath,
data->base_name,