The only reason for grant_fsp_lease to return the lease_idx was to pass it down
to set_share_mode. That does not need it anymore.
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Christof Schmitt <cs@samba.org>
static NTSTATUS grant_fsp_lease(struct files_struct *fsp,
struct share_mode_lock *lck,
const struct smb2_lease *lease,
static NTSTATUS grant_fsp_lease(struct files_struct *fsp,
struct share_mode_lock *lck,
const struct smb2_lease *lease,
uint32_t granted)
{
struct share_mode_data *d = lck->data;
uint32_t granted)
{
struct share_mode_data *d = lck->data;
return NT_STATUS_NO_MEMORY;
}
return NT_STATUS_NO_MEMORY;
}
/*
* Upgrade only if the requested lease is a strict upgrade.
*/
/*
* Upgrade only if the requested lease is a strict upgrade.
*/
fsp->lease->lease.lease_state = granted;
fsp->lease->lease.lease_epoch = lease->lease_epoch + 1;
fsp->lease->lease.lease_state = granted;
fsp->lease->lease.lease_epoch = lease->lease_epoch + 1;
- *p_lease_idx = d->num_leases;
-
d->leases[d->num_leases] = (struct share_mode_lease) {
.client_guid = *client_guid,
.lease_key = fsp->lease->lease.lease_key,
d->leases[d->num_leases] = (struct share_mode_lease) {
.client_guid = *client_guid,
.lease_key = fsp->lease->lease.lease_key,
bool got_oplock = false;
uint32_t i;
uint32_t granted;
bool got_oplock = false;
uint32_t i;
uint32_t granted;
- uint32_t lease_idx = UINT32_MAX;
const struct GUID *client_guid = NULL;
const struct smb2_lease_key *lease_key = NULL;
bool ok;
const struct GUID *client_guid = NULL;
const struct smb2_lease_key *lease_key = NULL;
bool ok;
fsp->oplock_type = LEASE_OPLOCK;
fsp->oplock_type = LEASE_OPLOCK;
- status = grant_fsp_lease(fsp, lck, lease, &lease_idx,
- granted);
+ status = grant_fsp_lease(fsp, lck, lease, granted);
if (!NT_STATUS_IS_OK(status)) {
return status;
if (!NT_STATUS_IS_OK(status)) {
return status;