s3:smbd/close: pass smbd_server_connection to notify_deferred_opens()
authorStefan Metzmacher <metze@samba.org>
Mon, 12 Dec 2011 15:07:19 +0000 (16:07 +0100)
committerStefan Metzmacher <metze@samba.org>
Mon, 12 Dec 2011 20:49:11 +0000 (21:49 +0100)
metze

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Mon Dec 12 21:49:11 CET 2011 on sn-devel-104

source3/smbd/close.c

index df7e156fe5c781edd5fe36d6cd75e86c335f5f6e..09d8905c17cd7f4fd64c69a0ccf31b6acf323913 100644 (file)
@@ -160,7 +160,7 @@ static NTSTATUS close_filestruct(files_struct *fsp)
  If any deferred opens are waiting on this close, notify them.
 ****************************************************************************/
 
-static void notify_deferred_opens(struct messaging_context *msg_ctx,
+static void notify_deferred_opens(struct smbd_server_connection *sconn,
                                  struct share_mode_lock *lck)
 {
        int i;
@@ -177,24 +177,20 @@ static void notify_deferred_opens(struct messaging_context *msg_ctx,
                }
 
                if (procid_is_me(&e->pid)) {
-                       struct smbd_server_connection *sconn;
                        /*
                         * We need to notify ourself to retry the open.  Do
                         * this by finding the queued SMB record, moving it to
                         * the head of the queue and changing the wait time to
                         * zero.
                         */
-                       sconn = msg_ctx_to_sconn(msg_ctx);
-                       if (sconn != NULL) {
-                               schedule_deferred_open_message_smb(
-                                       sconn, e->op_mid);
-                       }
+                       schedule_deferred_open_message_smb(sconn, e->op_mid);
                } else {
                        char msg[MSG_SMB_SHARE_MODE_ENTRY_SIZE];
 
                        share_mode_entry_to_message(msg, e);
 
-                       messaging_send_buf(msg_ctx, e->pid, MSG_SMB_OPEN_RETRY,
+                       messaging_send_buf(sconn->msg_ctx, e->pid,
+                                          MSG_SMB_OPEN_RETRY,
                                           (uint8 *)msg,
                                           MSG_SMB_SHARE_MODE_ENTRY_SIZE);
                }
@@ -378,7 +374,7 @@ static NTSTATUS close_remove_share_mode(files_struct *fsp,
        }
 
        /* Notify any deferred opens waiting on this close. */
-       notify_deferred_opens(conn->sconn->msg_ctx, lck);
+       notify_deferred_opens(conn->sconn, lck);
        reply_to_oplock_break_requests(fsp);
 
        /*