The branch, master has been updated
       via  77dc976 s3:smbd/close: pass smbd_server_connection to 
notify_deferred_opens()
       via  4d44f87 s3:smbd/clode: pass smbd_server_connection as private_data 
to msg_close_file()
       via  d1e0997 s3:smbd/blocking: pass smbd_server_connection as 
private_data to received_unlock_msg()
       via  f59d358 s3:smb2_lock: pass smbd_server_connection as private_data 
to received_unlock_msg()
      from  162975a s4:python/samba/join: set msDS-Behavior-Version to '4' 
2008_R2 on the nTDSA object

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 77dc976b53490e06dff649f199033fe799b714bf
Author: Stefan Metzmacher <me...@samba.org>
Date:   Mon Dec 12 16:07:19 2011 +0100

    s3:smbd/close: pass smbd_server_connection to notify_deferred_opens()
    
    metze
    
    Autobuild-User: Stefan Metzmacher <me...@samba.org>
    Autobuild-Date: Mon Dec 12 21:49:11 CET 2011 on sn-devel-104

commit 4d44f879e12106f83491a877ddef6c6ee9232d7e
Author: Stefan Metzmacher <me...@samba.org>
Date:   Mon Dec 12 15:45:07 2011 +0100

    s3:smbd/clode: pass smbd_server_connection as private_data to 
msg_close_file()
    
    metze

commit d1e0997614ac76bf4d2efc59d9a49472a3da3d4c
Author: Stefan Metzmacher <me...@samba.org>
Date:   Mon Dec 12 15:45:07 2011 +0100

    s3:smbd/blocking: pass smbd_server_connection as private_data to 
received_unlock_msg()
    
    metze

commit f59d3586535252e7d3c1944bc827807be60692a6
Author: Stefan Metzmacher <me...@samba.org>
Date:   Mon Dec 12 15:45:07 2011 +0100

    s3:smb2_lock: pass smbd_server_connection as private_data to 
received_unlock_msg()
    
    metze

-----------------------------------------------------------------------

Summary of changes:
 source3/smbd/blocking.c  |    8 ++++----
 source3/smbd/close.c     |   20 ++++++++------------
 source3/smbd/process.c   |    2 +-
 source3/smbd/smb2_lock.c |   13 +++++++------
 4 files changed, 20 insertions(+), 23 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/smbd/blocking.c b/source3/smbd/blocking.c
index f07a792..5520fec 100644
--- a/source3/smbd/blocking.c
+++ b/source3/smbd/blocking.c
@@ -248,7 +248,7 @@ bool push_blocking_lock_request( struct byte_range_lock 
*br_lck,
 
        /* Ensure we'll receive messages when this is unlocked. */
        if (!sconn->smb1.locks.blocking_lock_unlock_state) {
-               messaging_register(sconn->msg_ctx, NULL,
+               messaging_register(sconn->msg_ctx, sconn,
                                   MSG_SMB_UNLOCK, received_unlock_msg);
                sconn->smb1.locks.blocking_lock_unlock_state = true;
        }
@@ -702,11 +702,11 @@ static void received_unlock_msg(struct messaging_context 
*msg,
                                struct server_id server_id,
                                DATA_BLOB *data)
 {
-       struct smbd_server_connection *sconn;
+       struct smbd_server_connection *sconn =
+               talloc_get_type(private_data,
+               struct smbd_server_connection);
 
-       sconn = msg_ctx_to_sconn(msg);
        if (sconn == NULL) {
-               DEBUG(1, ("could not find sconn\n"));
                return;
        }
 
diff --git a/source3/smbd/close.c b/source3/smbd/close.c
index 8fd6b1f..09d8905 100644
--- a/source3/smbd/close.c
+++ b/source3/smbd/close.c
@@ -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);
 
        /*
@@ -1138,13 +1134,13 @@ void msg_close_file(struct messaging_context *msg_ctx,
                        struct server_id server_id,
                        DATA_BLOB *data)
 {
-       struct smbd_server_connection *sconn;
        files_struct *fsp = NULL;
        struct share_mode_entry e;
+       struct smbd_server_connection *sconn =
+               talloc_get_type(private_data,
+               struct smbd_server_connection);
 
-       sconn = msg_ctx_to_sconn(msg_ctx);
        if (sconn == NULL) {
-               DEBUG(1, ("could not find sconn\n"));
                return;
        }
 
diff --git a/source3/smbd/process.c b/source3/smbd/process.c
index 64dec52..0d17ad7 100644
--- a/source3/smbd/process.c
+++ b/source3/smbd/process.c
@@ -3137,7 +3137,7 @@ void smbd_process(struct tevent_context *ev_ctx,
        /* register our message handlers */
        messaging_register(sconn->msg_ctx, NULL,
                           MSG_SMB_FORCE_TDIS, msg_force_tdis);
-       messaging_register(sconn->msg_ctx, NULL,
+       messaging_register(sconn->msg_ctx, sconn,
                           MSG_SMB_CLOSE_FILE, msg_close_file);
 
        /*
diff --git a/source3/smbd/smb2_lock.c b/source3/smbd/smb2_lock.c
index 8f4df3d..57bcbe6 100644
--- a/source3/smbd/smb2_lock.c
+++ b/source3/smbd/smb2_lock.c
@@ -450,15 +450,16 @@ static void received_unlock_msg(struct messaging_context 
*msg,
                                struct server_id server_id,
                                DATA_BLOB *data)
 {
-       struct smbd_server_connection *sconn;
+       struct smbd_server_connection *sconn =
+               talloc_get_type(private_data,
+               struct smbd_server_connection);
 
-       DEBUG(10,("received_unlock_msg (SMB2)\n"));
-
-       sconn = msg_ctx_to_sconn(msg);
        if (sconn == NULL) {
-               DEBUG(1, ("could not find sconn\n"));
                return;
        }
+
+       DEBUG(10,("received_unlock_msg (SMB2)\n"));
+
        process_blocking_lock_queue_smb2(sconn, timeval_current());
 }
 
@@ -665,7 +666,7 @@ bool push_blocking_lock_request_smb2( struct 
byte_range_lock *br_lck,
 
        /* Ensure we'll receive messages when this is unlocked. */
        if (!sconn->smb2.locks.blocking_lock_unlock_state) {
-               messaging_register(sconn->msg_ctx, NULL,
+               messaging_register(sconn->msg_ctx, sconn,
                                MSG_SMB_UNLOCK, received_unlock_msg);
                sconn->smb2.locks.blocking_lock_unlock_state = true;
         }


-- 
Samba Shared Repository

Reply via email to