From: Volker Lendecke Date: Tue, 18 Sep 2018 09:37:28 +0000 (+0200) Subject: smbd: Don't pass up lease_idx from grant_fsp_lease X-Git-Tag: tdb-1.4.1~410 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2ea2605e7002508aa952899fb8f81e4e62684767;p=thirdparty%2Fsamba.git smbd: Don't pass up lease_idx from grant_fsp_lease 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 Reviewed-by: Christof Schmitt --- diff --git a/source3/smbd/open.c b/source3/smbd/open.c index 412174b7f3c..f1d39d46f27 100644 --- a/source3/smbd/open.c +++ b/source3/smbd/open.c @@ -2042,7 +2042,6 @@ struct fsp_lease *find_fsp_lease(struct files_struct *new_fsp, static NTSTATUS grant_fsp_lease(struct files_struct *fsp, struct share_mode_lock *lck, const struct smb2_lease *lease, - uint32_t *p_lease_idx, uint32_t granted) { struct share_mode_data *d = lck->data; @@ -2070,8 +2069,6 @@ static NTSTATUS grant_fsp_lease(struct files_struct *fsp, return NT_STATUS_NO_MEMORY; } - *p_lease_idx = idx; - /* * Upgrade only if the requested lease is a strict upgrade. */ @@ -2159,8 +2156,6 @@ static NTSTATUS grant_fsp_lease(struct files_struct *fsp, 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, @@ -2240,7 +2235,6 @@ static NTSTATUS grant_fsp_oplock_type(struct smb_request *req, 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; @@ -2333,8 +2327,7 @@ static NTSTATUS grant_fsp_oplock_type(struct smb_request *req, 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;