s3: Remove procid_self() from fill_deferred_open_entry()
authorVolker Lendecke <vl@samba.org>
Sun, 4 Jul 2010 18:14:27 +0000 (20:14 +0200)
committerVolker Lendecke <vl@samba.org>
Mon, 5 Jul 2010 09:06:31 +0000 (11:06 +0200)
source3/include/proto.h
source3/locking/locking.c
source3/smbd/open.c
source3/smbd/smb2_create.c

index 98edb55951ded394cf995a1555ef83bfaccfe57f..2374c2660dbe0f0080a48fc5a9d1b2e188bd59ee 100644 (file)
@@ -3348,9 +3348,10 @@ void set_share_mode(struct share_mode_lock *lck, files_struct *fsp,
                    uid_t uid, uint64_t mid, uint16 op_type);
 void add_deferred_open(struct share_mode_lock *lck, uint64_t mid,
                       struct timeval request_time,
-                      struct file_id id);
+                      struct server_id pid, struct file_id id);
 bool del_share_mode(struct share_mode_lock *lck, files_struct *fsp);
-void del_deferred_open_entry(struct share_mode_lock *lck, uint64_t mid);
+void del_deferred_open_entry(struct share_mode_lock *lck, uint64_t mid,
+                            struct server_id pid);
 bool remove_share_oplock(struct share_mode_lock *lck, files_struct *fsp);
 bool downgrade_share_oplock(struct share_mode_lock *lck, files_struct *fsp);
 NTSTATUS can_set_delete_on_close(files_struct *fsp, uint32 dosmode);
@@ -5839,7 +5840,8 @@ bool map_open_params_to_ntcreate(const struct smb_filename *smb_fname,
                                 uint32 *pcreate_disposition,
                                 uint32 *pcreate_options,
                                 uint32_t *pprivate_flags);
-void remove_deferred_open_entry(struct file_id id, uint64_t mid);
+void remove_deferred_open_entry(struct file_id id, uint64_t mid,
+                               struct server_id pid);
 NTSTATUS open_file_fchmod(struct smb_request *req, connection_struct *conn,
                          struct smb_filename *smb_fname,
                          files_struct **result);
index b17bf9e0595fb1ed0a854c2603bcb3c7eb469d69..a9b13d61a118108dfd8fbfa287810ed76315ebe0 100644 (file)
@@ -1127,10 +1127,12 @@ static void fill_share_mode_entry(struct share_mode_entry *e,
 
 static void fill_deferred_open_entry(struct share_mode_entry *e,
                                     const struct timeval request_time,
-                                    struct file_id id, uint64_t mid)
+                                    struct file_id id,
+                                    struct server_id pid,
+                                    uint64_t mid)
 {
        ZERO_STRUCTP(e);
-       e->pid = procid_self();
+       e->pid = pid;
        e->op_mid = mid;
        e->op_type = DEFERRED_OPEN_ENTRY;
        e->time.tv_sec = request_time.tv_sec;
@@ -1171,10 +1173,10 @@ void set_share_mode(struct share_mode_lock *lck, files_struct *fsp,
 
 void add_deferred_open(struct share_mode_lock *lck, uint64_t mid,
                       struct timeval request_time,
-                      struct file_id id)
+                      struct server_id pid, struct file_id id)
 {
        struct share_mode_entry entry;
-       fill_deferred_open_entry(&entry, request_time, id, mid);
+       fill_deferred_open_entry(&entry, request_time, id, pid, mid);
        add_share_mode_entry(lck, &entry);
 }
 
@@ -1248,12 +1250,13 @@ bool del_share_mode(struct share_mode_lock *lck, files_struct *fsp)
        return True;
 }
 
-void del_deferred_open_entry(struct share_mode_lock *lck, uint64_t mid)
+void del_deferred_open_entry(struct share_mode_lock *lck, uint64_t mid,
+                            struct server_id pid)
 {
        struct share_mode_entry entry, *e;
 
        fill_deferred_open_entry(&entry, timeval_zero(),
-                                lck->id, mid);
+                                lck->id, pid, mid);
 
        e = find_share_mode_entry(lck, &entry);
        if (e == NULL) {
index e0fcfb967963f6ad418239c208a46a25d117d32c..f1c32e0585ba62254169d1106c6573ef09dc7711 100644 (file)
@@ -1090,7 +1090,8 @@ static void defer_open(struct share_mode_lock *lck,
                                       state->id, (char *)state, sizeof(*state))) {
                exit_server("push_deferred_open_message_smb failed");
        }
-       add_deferred_open(lck, req->mid, request_time, state->id);
+       add_deferred_open(lck, req->mid, request_time,
+                         sconn_server_id(req->sconn), state->id);
 }
 
 
@@ -1454,14 +1455,15 @@ static NTSTATUS calculate_access_mask(connection_struct *conn,
  Remove the deferred open entry under lock.
 ****************************************************************************/
 
-void remove_deferred_open_entry(struct file_id id, uint64_t mid)
+void remove_deferred_open_entry(struct file_id id, uint64_t mid,
+                               struct server_id pid)
 {
        struct share_mode_lock *lck = get_share_mode_lock(talloc_tos(), id,
                        NULL, NULL, NULL);
        if (lck == NULL) {
                DEBUG(0, ("could not get share mode lock\n"));
        } else {
-               del_deferred_open_entry(lck, mid);
+               del_deferred_open_entry(lck, mid, pid);
                TALLOC_FREE(lck);
        }
 }
@@ -1574,7 +1576,9 @@ static NTSTATUS open_file_ntcreate(connection_struct *conn,
                           see if this has timed out. */
 
                        /* Remove the deferred open entry under lock. */
-                       remove_deferred_open_entry(state->id, req->mid);
+                       remove_deferred_open_entry(
+                               state->id, req->mid,
+                               sconn_server_id(req->sconn));
 
                        /* Ensure we don't reprocess this message. */
                        remove_deferred_open_message_smb(req->mid);
@@ -2271,7 +2275,8 @@ static NTSTATUS open_file_ntcreate(connection_struct *conn,
        /* If this is a successful open, we must remove any deferred open
         * records. */
        if (req != NULL) {
-               del_deferred_open_entry(lck, req->mid);
+               del_deferred_open_entry(lck, req->mid,
+                                       sconn_server_id(req->sconn));
        }
        TALLOC_FREE(lck);
 
index 60bbde215d03360e5d3bd85ed58d48e694cf0832..47a85f8cf36e5a0b75e599e8d87819bbd98088a0 100644 (file)
@@ -1155,7 +1155,8 @@ static bool smbd_smb2_create_cancel(struct tevent_req *req)
        smb2req = state->smb2req;
        mid = get_mid_from_smb2req(smb2req);
 
-       remove_deferred_open_entry(state->id, mid);
+       remove_deferred_open_entry(state->id, mid,
+                                  sconn_server_id(smb2req->sconn));
        remove_deferred_open_message_smb2_internal(smb2req, mid);
        smb2req->cancelled = true;