]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
smbd: Slightly simplify set_share_mode()
authorVolker Lendecke <vl@samba.org>
Mon, 5 Aug 2019 12:59:18 +0000 (14:59 +0200)
committerJeremy Allison <jra@samba.org>
Tue, 6 Aug 2019 21:49:29 +0000 (21:49 +0000)
The fsp carries all required information also for leases. There's no
need to pass that as additional parameters

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/locking/locking.c
source3/locking/proto.h
source3/smbd/open.c

index 45399b65f1f1c7efe4d84812446303dd19ce3965..5ef844c51c6143a4ac6d9337dd4cc63a51690966 100644 (file)
@@ -795,9 +795,7 @@ bool set_share_mode(struct share_mode_lock *lck,
                    uint64_t mid,
                    uint16_t op_type,
                    uint32_t share_access,
-                   uint32_t access_mask,
-                   const struct GUID *client_guid,
-                   const struct smb2_lease_key *lease_key)
+                   uint32_t access_mask)
 {
        struct share_mode_data *d = lck->data;
        struct share_mode_entry *tmp, *e;
@@ -821,8 +819,9 @@ bool set_share_mode(struct share_mode_lock *lck,
        e->op_type = op_type;
 
        if (op_type == LEASE_OPLOCK) {
+               const struct GUID *client_guid = fsp_client_guid(fsp);
                e->client_guid = *client_guid;
-               e->lease_key = *lease_key;
+               e->lease_key = fsp->lease->lease.lease_key;
        }
 
        e->time.tv_sec = fsp->open_time.tv_sec;
index 57619b81866f6463210f3cc24fa281a4beb28be4..37f36870751012eaf37e61f3c9ec4a4eb7f765d9 100644 (file)
@@ -161,9 +161,7 @@ bool set_share_mode(struct share_mode_lock *lck,
                    uint64_t mid,
                    uint16_t op_type,
                    uint32_t share_access,
-                   uint32_t access_mask,
-                   const struct GUID *client_guid,
-                   const struct smb2_lease_key *lease_key);
+                   uint32_t access_mask);
 void remove_stale_share_mode_entries(struct share_mode_data *d);
 bool del_share_mode(struct share_mode_lock *lck, files_struct *fsp);
 bool mark_share_mode_disconnected(struct share_mode_lock *lck,
index 850b69fcba8c48317fdfe8ad3951d847b712bd2f..01f62223ddb43bd6c634d7bd7dc9012453b1a155 100644 (file)
@@ -2231,8 +2231,6 @@ static NTSTATUS grant_fsp_oplock_type(struct smb_request *req,
        bool got_oplock = false;
        uint32_t i;
        uint32_t granted;
-       const struct GUID *client_guid = NULL;
-       const struct smb2_lease_key *lease_key = NULL;
        bool ok;
        NTSTATUS status;
 
@@ -2330,9 +2328,6 @@ static NTSTATUS grant_fsp_oplock_type(struct smb_request *req,
                }
                *lease = fsp->lease->lease;
 
-               lease_key = &fsp->lease->lease.lease_key;
-               client_guid = fsp_client_guid(fsp);
-
                DEBUG(10, ("lease_state=%d\n", lease->lease_state));
        } else {
                if (got_handle_lease) {
@@ -2357,9 +2352,7 @@ static NTSTATUS grant_fsp_oplock_type(struct smb_request *req,
                req ? req->mid : 0,
                fsp->oplock_type,
                share_access,
-               access_mask,
-               client_guid,
-               lease_key);
+               access_mask);
        if (!ok) {
                return NT_STATUS_NO_MEMORY;
        }
@@ -4210,9 +4203,7 @@ static NTSTATUS open_directory(connection_struct *conn,
                req ? req->mid : 0,
                NO_OPLOCK,
                share_access,
-               fsp->access_mask,
-               NULL,
-               NULL);
+               fsp->access_mask);
        if (!ok) {
                TALLOC_FREE(lck);
                fd_close(fsp);