smbd: Don't pass up lease_idx from grant_fsp_lease
authorVolker Lendecke <vl@samba.org>
Tue, 18 Sep 2018 09:37:28 +0000 (11:37 +0200)
committerChristof Schmitt <cs@samba.org>
Sun, 14 Apr 2019 04:01:32 +0000 (04:01 +0000)
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>
source3/smbd/open.c

index 412174b..f1d39d4 100644 (file)
@@ -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;