It does not have to depend on the whole struct share_mode_data.
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
for (i=0; i<d->num_share_modes; i++) {
struct share_mode_entry *e = &d->share_modes[i];
bool e_is_lease = (e->op_type == LEASE_OPLOCK);
- uint32_t e_lease_type = get_lease_type(d, e);
+ uint32_t e_lease_type = get_lease_type(e, d->id);
uint32_t break_to;
bool lease_is_breaking = false;
d = lck->data;
for (j=0; j<d->num_share_modes; j++) {
struct share_mode_entry *e = &d->share_modes[j];
- uint32_t e_lease_type = get_lease_type(d, e);
+ uint32_t e_lease_type = get_lease_type(e, d->id);
if (share_mode_stale_pid(d, j)) {
continue;
TALLOC_FREE(fsp->oplock_timeout);
}
-uint32_t get_lease_type(const struct share_mode_data *d,
- const struct share_mode_entry *e)
+uint32_t get_lease_type(const struct share_mode_entry *e, struct file_id id)
{
if (e->op_type == LEASE_OPLOCK) {
NTSTATUS status;
status = leases_db_get(
&e->client_guid,
&e->lease_key,
- &d->id,
+ &id,
¤t_state,
NULL, /* breaking */
NULL, /* breaking_to_requested */
/* The following definitions come from smbd/oplock.c */
-uint32_t get_lease_type(const struct share_mode_data *d,
- const struct share_mode_entry *e);
+uint32_t get_lease_type(const struct share_mode_entry *e, struct file_id id);
void break_kernel_oplock(struct messaging_context *msg_ctx, files_struct *fsp);
NTSTATUS set_file_oplock(files_struct *fsp);
continue;
}
- e_lease_type = get_lease_type(d, e);
+ e_lease_type = get_lease_type(e, d->id);
if (!(e_lease_type & SMB2_LEASE_HANDLE)) {
continue;