[SCM] Samba Shared Repository - branch master updated - 6b4d48c4bf3e538d49d0579bffce0c5d33f4dbe9

Volker Lendecke vlendec at samba.org
Tue Nov 4 19:54:00 GMT 2008


The branch, master has been updated
       via  6b4d48c4bf3e538d49d0579bffce0c5d33f4dbe9 (commit)
       via  d5f91d7a083820f6ee701873690d896343e9c534 (commit)
       via  3376e7a6a061c0d681a6a0e5c3aedfc82c36f65f (commit)
       via  59e237cae55e43b1276ebe644752c8c5d2ab74e4 (commit)
       via  eddb43c7137409bb551834511711362c45633508 (commit)
       via  f0ba601c26d750f52368dc6133f26e3427732d83 (commit)
       via  8987641db85f14d18ec00690c3edd8f75654d21c (commit)
       via  b8125663d90d9748b71a25a06a357167958dd18e (commit)
       via  e4897a5376309bd73727f4130bf9bc6170158a6f (commit)
       via  d62ff20cd5cc64a524d401ffba1fe6b3e7e8cc31 (commit)
       via  71bc6e93a122ad6d796b14ac9d5fbdc0e4fb4927 (commit)
      from  d997435f2ddd21058746ff7e13c7fef19a29afa7 (commit)

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


- Log -----------------------------------------------------------------
commit 6b4d48c4bf3e538d49d0579bffce0c5d33f4dbe9
Author: Volker Lendecke <vl at samba.org>
Date:   Tue Nov 4 18:05:17 2008 +0100

    Convert blocking.c to store a smb_request instead of just inbuf

commit d5f91d7a083820f6ee701873690d896343e9c534
Author: Volker Lendecke <vl at samba.org>
Date:   Tue Nov 4 16:57:31 2008 +0100

    Simplify logic of cancel_pending_lock_requests_by_fid()
    
    The only caller of this function is locking_close_file(). This checks itself if
    brl_lock != NULL. The additional check is not necessary here.

commit 3376e7a6a061c0d681a6a0e5c3aedfc82c36f65f
Author: Volker Lendecke <vl at samba.org>
Date:   Tue Nov 4 14:35:44 2008 +0100

    Slightly simplify logic in process_lockingX()
    
    The "else" is pointless here, we did a "return True" in the if branch.

commit 59e237cae55e43b1276ebe644752c8c5d2ab74e4
Author: Volker Lendecke <vl at samba.org>
Date:   Tue Nov 4 14:33:20 2008 +0100

    Slightly simplify logic in remove_pending_lock_requests_by_mid()
    
    Use "continue" for (SVAL(blr->inbuf,smb_mid) != mid)

commit eddb43c7137409bb551834511711362c45633508
Author: Volker Lendecke <vl at samba.org>
Date:   Tue Nov 4 14:29:33 2008 +0100

    Slightly simplify logic in cancel_pending_lock_requests_by_fid()
    
    Use a "continue" for (blr->fsp->fnum != fsp->fnum)

commit f0ba601c26d750f52368dc6133f26e3427732d83
Author: Volker Lendecke <vl at samba.org>
Date:   Tue Nov 4 13:25:07 2008 +0100

    Convert blocking.c to use talloc

commit 8987641db85f14d18ec00690c3edd8f75654d21c
Author: Volker Lendecke <vl at samba.org>
Date:   Mon Nov 3 21:56:02 2008 +0100

    Rewrite aio.c to keep the whole smb_request structure, not just the inbuf

commit b8125663d90d9748b71a25a06a357167958dd18e
Author: Volker Lendecke <vl at samba.org>
Date:   Mon Nov 3 21:55:05 2008 +0100

    Make "inbuf" a talloc child of "smb_request" for normal smb requests
    
    This is necessary if we want to keep the whole smb_request for deferred ops.
    The explicit settings of req->inbuf will be removed once all those deferring
    operations are converted to store the whole request and not just the inbuf.

commit e4897a5376309bd73727f4130bf9bc6170158a6f
Author: Volker Lendecke <vl at samba.org>
Date:   Mon Nov 3 20:16:09 2008 +0100

    Add construct_reply_common_req wrapper
    
    The goal is to remove the remaining direct calls to construct_reply_common.

commit d62ff20cd5cc64a524d401ffba1fe6b3e7e8cc31
Author: Volker Lendecke <vl at samba.org>
Date:   Mon Nov 3 20:07:11 2008 +0100

    Fix nonempty blank lines

commit 71bc6e93a122ad6d796b14ac9d5fbdc0e4fb4927
Author: Volker Lendecke <vl at samba.org>
Date:   Mon Nov 3 19:59:11 2008 +0100

    Use talloc for struct aio_extra

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

Summary of changes:
 source3/include/proto.h |    3 +-
 source3/smbd/aio.c      |  151 +++++++++-----------------
 source3/smbd/blocking.c |  267 +++++++++++++++++++++--------------------------
 source3/smbd/notify.c   |    1 +
 source3/smbd/process.c  |   10 ++-
 source3/smbd/reply.c    |    4 +-
 6 files changed, 183 insertions(+), 253 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/include/proto.h b/source3/include/proto.h
index 0d4404b..ac55a67 100644
--- a/source3/include/proto.h
+++ b/source3/include/proto.h
@@ -7598,7 +7598,7 @@ int wait_for_aio_completion(files_struct *fsp);
 /* The following definitions come from smbd/blocking.c  */
 
 bool push_blocking_lock_request( struct byte_range_lock *br_lck,
-		const struct smb_request *req,
+		struct smb_request *req,
 		files_struct *fsp,
 		int lock_timeout,
 		int lock_num,
@@ -8232,6 +8232,7 @@ const char *smb_fn_name(int type);
 void add_to_common_flags2(uint32 v);
 void remove_from_common_flags2(uint32 v);
 void construct_reply_common(const char *inbuf, char *outbuf);
+void construct_reply_common_req(struct smb_request *req, char *outbuf);
 void chain_reply(struct smb_request *req);
 void check_reload(time_t t);
 void smbd_process(void);
diff --git a/source3/smbd/aio.c b/source3/smbd/aio.c
index 4e56acf..fd553c3 100644
--- a/source3/smbd/aio.c
+++ b/source3/smbd/aio.c
@@ -45,93 +45,51 @@ struct aio_extra {
 	struct aio_extra *next, *prev;
 	SMB_STRUCT_AIOCB acb;
 	files_struct *fsp;
-	bool read_req;
-	uint16 mid;
-	char *inbuf;
+	struct smb_request *req;
 	char *outbuf;
+	int (*handle_completion)(struct aio_extra *ex);
 };
 
-static struct aio_extra *aio_list_head;
+static int handle_aio_read_complete(struct aio_extra *aio_ex);
+static int handle_aio_write_complete(struct aio_extra *aio_ex);
 
-/****************************************************************************
- Create the extended aio struct we must keep around for the lifetime
- of the aio_read call.
-*****************************************************************************/
+static struct aio_extra *aio_list_head;
 
-static struct aio_extra *create_aio_ex_read(files_struct *fsp, size_t buflen,
-					    uint16 mid)
+static int aio_extra_destructor(struct aio_extra *aio_ex)
 {
-	struct aio_extra *aio_ex = SMB_MALLOC_P(struct aio_extra);
-
-	if (!aio_ex) {
-		return NULL;
-	}
-	ZERO_STRUCTP(aio_ex);
-	/* The output buffer stored in the aio_ex is the start of
-	   the smb return buffer. The buffer used in the acb
-	   is the start of the reply data portion of that buffer. */
-	aio_ex->outbuf = SMB_MALLOC_ARRAY(char, buflen);
-	if (!aio_ex->outbuf) {
-		SAFE_FREE(aio_ex);
-		return NULL;
-	}
-	DLIST_ADD(aio_list_head, aio_ex);
-	aio_ex->fsp = fsp;
-	aio_ex->read_req = True;
-	aio_ex->mid = mid;
-	return aio_ex;
+	DLIST_REMOVE(aio_list_head, aio_ex);
+	return 0;
 }
 
 /****************************************************************************
  Create the extended aio struct we must keep around for the lifetime
- of the aio_write call.
+ of the aio call.
 *****************************************************************************/
 
-static struct aio_extra *create_aio_ex_write(files_struct *fsp,
-					     size_t inbuflen,
-					     size_t outbuflen,
-					     uint16 mid)
+static struct aio_extra *create_aio_extra(files_struct *fsp, size_t buflen)
 {
-	struct aio_extra *aio_ex = SMB_MALLOC_P(struct aio_extra);
+	struct aio_extra *aio_ex = TALLOC_ZERO_P(NULL, struct aio_extra);
 
 	if (!aio_ex) {
 		return NULL;
 	}
-	ZERO_STRUCTP(aio_ex);
 
-	/* We need space for an output reply of outbuflen bytes. */
-	aio_ex->outbuf = SMB_MALLOC_ARRAY(char, outbuflen);
-	if (!aio_ex->outbuf) {
-		SAFE_FREE(aio_ex);
-		return NULL;
-	}
+	/* The output buffer stored in the aio_ex is the start of
+	   the smb return buffer. The buffer used in the acb
+	   is the start of the reply data portion of that buffer. */
 
-	if (!(aio_ex->inbuf = SMB_MALLOC_ARRAY(char, inbuflen))) {
-		SAFE_FREE(aio_ex->outbuf);
-		SAFE_FREE(aio_ex);
+	aio_ex->outbuf = TALLOC_ARRAY(aio_ex, char, buflen);
+	if (!aio_ex->outbuf) {
+		TALLOC_FREE(aio_ex);
 		return NULL;
 	}
-
 	DLIST_ADD(aio_list_head, aio_ex);
+	talloc_set_destructor(aio_ex, aio_extra_destructor);
 	aio_ex->fsp = fsp;
-	aio_ex->read_req = False;
-	aio_ex->mid = mid;
 	return aio_ex;
 }
 
 /****************************************************************************
- Delete the extended aio struct.
-*****************************************************************************/
-
-static void delete_aio_ex(struct aio_extra *aio_ex)
-{
-	DLIST_REMOVE(aio_list_head, aio_ex);
-	SAFE_FREE(aio_ex->inbuf);
-	SAFE_FREE(aio_ex->outbuf);
-	SAFE_FREE(aio_ex);
-}
-
-/****************************************************************************
  Given the mid find the extended aio struct containing it.
 *****************************************************************************/
 
@@ -140,7 +98,7 @@ static struct aio_extra *find_aio_ex(uint16 mid)
 	struct aio_extra *p;
 
 	for( p = aio_list_head; p; p = p->next) {
-		if (mid == p->mid) {
+		if (mid == p->req->mid) {
 			return p;
 		}
 	}
@@ -258,26 +216,27 @@ bool schedule_aio_read_and_X(connection_struct *conn,
 
 	bufsize = smb_size + 12 * 2 + smb_maxcnt;
 
-	if ((aio_ex = create_aio_ex_read(fsp, bufsize, req->mid)) == NULL) {
+	if ((aio_ex = create_aio_extra(fsp, bufsize)) == NULL) {
 		DEBUG(10,("schedule_aio_read_and_X: malloc fail.\n"));
 		return False;
 	}
+	aio_ex->handle_completion = handle_aio_read_complete;
 
-	construct_reply_common((char *)req->inbuf, aio_ex->outbuf);
+	construct_reply_common_req(req, aio_ex->outbuf);
 	srv_set_message(aio_ex->outbuf, 12, 0, True);
 	SCVAL(aio_ex->outbuf,smb_vwv0,0xFF); /* Never a chained reply. */
 
 	a = &aio_ex->acb;
 
 	/* Now set up the aio record for the read call. */
-	
+
 	a->aio_fildes = fsp->fh->fd;
 	a->aio_buf = smb_buf(aio_ex->outbuf);
 	a->aio_nbytes = smb_maxcnt;
 	a->aio_offset = startpos;
 	a->aio_sigevent.sigev_notify = SIGEV_SIGNAL;
 	a->aio_sigevent.sigev_signo  = RT_SIGNAL_AIO;
-	a->aio_sigevent.sigev_value.sival_int = aio_ex->mid;
+	a->aio_sigevent.sigev_value.sival_int = req->mid;
 
 	become_root();
 	ret = SMB_VFS_AIO_READ(fsp, a);
@@ -286,16 +245,18 @@ bool schedule_aio_read_and_X(connection_struct *conn,
 	if (ret == -1) {
 		DEBUG(0,("schedule_aio_read_and_X: aio_read failed. "
 			 "Error %s\n", strerror(errno) ));
-		delete_aio_ex(aio_ex);
+		TALLOC_FREE(aio_ex);
 		return False;
 	}
 
+	aio_ex->req = talloc_move(aio_ex, &req);
+
 	DEBUG(10,("schedule_aio_read_and_X: scheduled aio_read for file %s, "
 		  "offset %.0f, len = %u (mid = %u)\n",
 		  fsp->fsp_name, (double)startpos, (unsigned int)smb_maxcnt,
-		  (unsigned int)aio_ex->mid ));
+		  (unsigned int)aio_ex->req->mid ));
 
-	srv_defer_sign_response(aio_ex->mid);
+	srv_defer_sign_response(aio_ex->req->mid);
 	outstanding_aio_calls++;
 	return True;
 }
@@ -312,7 +273,7 @@ bool schedule_aio_write_and_X(connection_struct *conn,
 {
 	struct aio_extra *aio_ex;
 	SMB_STRUCT_AIOCB *a;
-	size_t inbufsize, outbufsize;
+	size_t bufsize;
 	bool write_through = BITSETW(req->vwv+7,0);
 	size_t min_aio_write_size = lp_aio_write_size(SNUM(conn));
 	int ret;
@@ -353,34 +314,29 @@ bool schedule_aio_write_and_X(connection_struct *conn,
 		return False;
 	}
 
-	inbufsize =  smb_len(req->inbuf) + 4;
-	reply_outbuf(req, 6, 0);
-	outbufsize = smb_len(req->outbuf) + 4;
-	if (!(aio_ex = create_aio_ex_write(fsp, inbufsize, outbufsize,
-					   req->mid))) {
+	bufsize = smb_size + 6*2;
+
+	if (!(aio_ex = create_aio_extra(fsp, bufsize))) {
 		DEBUG(0,("schedule_aio_write_and_X: malloc fail.\n"));
 		return False;
 	}
+	aio_ex->handle_completion = handle_aio_write_complete;
 
-	/* Copy the SMB header already setup in outbuf. */
-	memcpy(aio_ex->inbuf, req->inbuf, inbufsize);
-
-	/* Copy the SMB header already setup in outbuf. */
-	memcpy(aio_ex->outbuf, req->outbuf, outbufsize);
-	TALLOC_FREE(req->outbuf);
+	construct_reply_common_req(req, aio_ex->outbuf);
+	srv_set_message(aio_ex->outbuf, 6, 0, True);
 	SCVAL(aio_ex->outbuf,smb_vwv0,0xFF); /* Never a chained reply. */
 
 	a = &aio_ex->acb;
 
 	/* Now set up the aio record for the write call. */
-	
+
 	a->aio_fildes = fsp->fh->fd;
-	a->aio_buf = aio_ex->inbuf + (PTR_DIFF(data, req->inbuf));
+	a->aio_buf = data;
 	a->aio_nbytes = numtowrite;
 	a->aio_offset = startpos;
 	a->aio_sigevent.sigev_notify = SIGEV_SIGNAL;
 	a->aio_sigevent.sigev_signo  = RT_SIGNAL_AIO;
-	a->aio_sigevent.sigev_value.sival_int = aio_ex->mid;
+	a->aio_sigevent.sigev_value.sival_int = req->mid;
 
 	become_root();
 	ret = SMB_VFS_AIO_WRITE(fsp, a);
@@ -389,10 +345,12 @@ bool schedule_aio_write_and_X(connection_struct *conn,
 	if (ret == -1) {
 		DEBUG(3,("schedule_aio_wrote_and_X: aio_write failed. "
 			 "Error %s\n", strerror(errno) ));
-		delete_aio_ex(aio_ex);
+		TALLOC_FREE(aio_ex);
 		return False;
 	}
 
+	aio_ex->req = talloc_move(aio_ex, &req);
+
 	release_level_2_oplocks_on_change(fsp);
 
 	if (!write_through && !lp_syncalways(SNUM(fsp->conn))
@@ -410,7 +368,7 @@ bool schedule_aio_write_and_X(connection_struct *conn,
 		DEBUG(10,("schedule_aio_write_and_X: scheduled aio_write "
 			  "behind for file %s\n", fsp->fsp_name ));
 	} else {
-		srv_defer_sign_response(aio_ex->mid);
+		srv_defer_sign_response(aio_ex->req->mid);
 	}
 	outstanding_aio_calls++;
 
@@ -418,7 +376,7 @@ bool schedule_aio_write_and_X(connection_struct *conn,
 		  "%s, offset %.0f, len = %u (mid = %u) "
 		  "outstanding_aio_calls = %d\n",
 		  fsp->fsp_name, (double)startpos, (unsigned int)numtowrite,
-		  (unsigned int)aio_ex->mid, outstanding_aio_calls ));
+		  (unsigned int)aio_ex->req->mid, outstanding_aio_calls ));
 
 	return True;
 }
@@ -446,7 +404,7 @@ static int handle_aio_read_complete(struct aio_extra *aio_ex)
 		/* If errno is ECANCELED then don't return anything to the
 		 * client. */
 		if (errno == ECANCELED) {
-			srv_cancel_sign_response(aio_ex->mid);
+			srv_cancel_sign_response(aio_ex->req->mid);
 			return 0;
 		}
 
@@ -540,7 +498,7 @@ static int handle_aio_write_complete(struct aio_extra *aio_ex)
 		/* If errno is ECANCELED then don't return anything to the
 		 * client. */
 		if (errno == ECANCELED) {
-			srv_cancel_sign_response(aio_ex->mid);
+			srv_cancel_sign_response(aio_ex->req->mid);
 			return 0;
 		}
 
@@ -548,7 +506,7 @@ static int handle_aio_write_complete(struct aio_extra *aio_ex)
 		ERROR_BOTH(map_nt_error_from_unix(ret), ERRHRD, ERRdiskfull);
 		srv_set_message(outbuf,0,0,true);
         } else {
-		bool write_through = BITSETW(aio_ex->inbuf+smb_vwv7,0);
+		bool write_through = BITSETW(aio_ex->req->inbuf+smb_vwv7,0);
 		NTSTATUS status;
 
         	SSVAL(outbuf,smb_vwv2,nwritten);
@@ -604,16 +562,11 @@ static bool handle_aio_completed(struct aio_extra *aio_ex, int *perr)
 	if (SMB_VFS_AIO_ERROR(aio_ex->fsp, &aio_ex->acb) == EINPROGRESS) {
 		DEBUG(10,( "handle_aio_completed: operation mid %u still in "
 			   "process for file %s\n",
-			   aio_ex->mid, aio_ex->fsp->fsp_name ));
+			   aio_ex->req->mid, aio_ex->fsp->fsp_name ));
 		return False;
 	}
 
-	if (aio_ex->read_req) {
-		err = handle_aio_read_complete(aio_ex);
-	} else {
-		err = handle_aio_write_complete(aio_ex);
-	}
-
+	err = aio_ex->handle_completion(aio_ex);
 	if (err) {
 		*perr = err; /* Only save non-zero errors. */
 	}
@@ -670,7 +623,7 @@ int process_aio_queue(void)
 			continue;
 		}
 
-		delete_aio_ex(aio_ex);
+		TALLOC_FREE(aio_ex);
 	}
 
 	outstanding_aio_calls -= signals_received;
@@ -742,7 +695,7 @@ int wait_for_aio_completion(files_struct *fsp)
 
 		DEBUG(10,("wait_for_aio_completion: returned err = %d, "
 			  "errno = %s\n", err, strerror(errno) ));
-		
+
 		if (err == -1 && errno == EAGAIN) {
 			DEBUG(0,("wait_for_aio_completion: aio_suspend timed "
 				 "out waiting for %d events after a wait of "
@@ -771,7 +724,7 @@ int wait_for_aio_completion(files_struct *fsp)
 			if (!handle_aio_completed(aio_ex, &err)) {
 				continue;
 			}
-			delete_aio_ex(aio_ex);
+			TALLOC_FREE(aio_ex);
 		}
 
 		SAFE_FREE(aiocb_list);
diff --git a/source3/smbd/blocking.c b/source3/smbd/blocking.c
index 78a63dc..555033b 100644
--- a/source3/smbd/blocking.c
+++ b/source3/smbd/blocking.c
@@ -26,10 +26,9 @@
  notify. It consists of the requesting SMB and the expiry time.
 *****************************************************************************/
 
-typedef struct _blocking_lock_record {
-	struct _blocking_lock_record *next;
-	struct _blocking_lock_record *prev;
-	int com_type;
+typedef struct blocking_lock_record {
+	struct blocking_lock_record *next;
+	struct blocking_lock_record *prev;
 	files_struct *fsp;
 	struct timeval expire_time;
 	int lock_num;
@@ -39,9 +38,7 @@ typedef struct _blocking_lock_record {
 	uint32_t blocking_pid; /* PID that blocks us. */
 	enum brl_flavour lock_flav;
 	enum brl_type lock_type;
-	char *inbuf;
-	int length;
-	bool encrypted;
+	struct smb_request *req;
 } blocking_lock_record;
 
 /* dlink list we store pending lock records on. */
@@ -54,16 +51,6 @@ static blocking_lock_record *blocking_lock_cancelled_queue;
 static struct timed_event *brl_timeout;
 
 /****************************************************************************
- Destructor for the above structure.
-****************************************************************************/
-
-static void free_blocking_lock_record(blocking_lock_record *blr)
-{
-	SAFE_FREE(blr->inbuf);
-	SAFE_FREE(blr);
-}
-
-/****************************************************************************
  Determine if this is a secondary element of a chained SMB.
   **************************************************************************/
 
@@ -150,7 +137,7 @@ static bool recalc_brl_timeout(void)
 ****************************************************************************/
 
 bool push_blocking_lock_request( struct byte_range_lock *br_lck,
-		const struct smb_request *req,
+		struct smb_request *req,
 		files_struct *fsp,
 		int lock_timeout,
 		int lock_num,
@@ -162,7 +149,6 @@ bool push_blocking_lock_request( struct byte_range_lock *br_lck,
 		uint32_t blocking_pid)
 {
 	static bool set_lock_msg;
-	size_t length = smb_len(req->inbuf)+4;
 	blocking_lock_record *blr;
 	NTSTATUS status;
 
@@ -176,7 +162,8 @@ bool push_blocking_lock_request( struct byte_range_lock *br_lck,
 	 * the expiration time here.
 	 */
 
-	if((blr = SMB_MALLOC_P(blocking_lock_record)) == NULL) {
+	blr = talloc(NULL, struct blocking_lock_record);
+	if (blr == NULL) {
 		DEBUG(0,("push_blocking_lock_request: Malloc fail !\n" ));
 		return False;
 	}
@@ -184,13 +171,6 @@ bool push_blocking_lock_request( struct byte_range_lock *br_lck,
 	blr->next = NULL;
 	blr->prev = NULL;
 
-	if((blr->inbuf = (char *)SMB_MALLOC(length)) == NULL) {
-		DEBUG(0,("push_blocking_lock_request: Malloc fail (2)!\n" ));
-		SAFE_FREE(blr);
-		return False;
-	}
-
-	blr->com_type = req->cmd;
 	blr->fsp = fsp;
 	if (lock_timeout == -1) {
 		blr->expire_time.tv_sec = 0;
@@ -206,9 +186,6 @@ bool push_blocking_lock_request( struct byte_range_lock *br_lck,
 	blr->lock_type = lock_type;
 	blr->offset = offset;
 	blr->count = count;
-	memcpy(blr->inbuf, req->inbuf, length);
-	blr->length = length;
-	blr->encrypted = req->encrypted;
 
 	/* Add a pending lock record for this. */
 	status = brl_lock(smbd_messaging_context(), br_lck,
@@ -224,10 +201,12 @@ bool push_blocking_lock_request( struct byte_range_lock *br_lck,
 	if (!NT_STATUS_IS_OK(status)) {
 		DEBUG(0,("push_blocking_lock_request: failed to add PENDING_LOCK record.\n"));
 		DLIST_REMOVE(blocking_lock_queue, blr);
-		free_blocking_lock_record(blr);
+		TALLOC_FREE(blr);
 		return False;
 	}
 
+	blr->req = talloc_move(blr, &req);
+
 	DLIST_ADD_END(blocking_lock_queue, blr, blocking_lock_record *);
 	recalc_brl_timeout();
 
@@ -238,14 +217,14 @@ bool push_blocking_lock_request( struct byte_range_lock *br_lck,
 		set_lock_msg = True;
 	}
 
-	DEBUG(3,("push_blocking_lock_request: lock request length=%u blocked with "
+	DEBUG(3,("push_blocking_lock_request: lock request blocked with "
 		"expiry time (%u sec. %u usec) (+%d msec) for fnum = %d, name = %s\n",
-		(unsigned int)length, (unsigned int)blr->expire_time.tv_sec,
+		(unsigned int)blr->expire_time.tv_sec,
 		(unsigned int)blr->expire_time.tv_usec, lock_timeout,
 		blr->fsp->fnum, blr->fsp->fsp_name ));
 
 	/* Push the MID of this packet on the signing queue. */
-	srv_defer_sign_response(SVAL(req->inbuf,smb_mid));
+	srv_defer_sign_response(blr->req->mid);
 
 	return True;
 }
@@ -256,14 +235,7 @@ bool push_blocking_lock_request( struct byte_range_lock *br_lck,
 
 static void reply_lockingX_success(blocking_lock_record *blr)
 {
-	struct smb_request *req;
-
-	if (!(req = talloc(talloc_tos(), struct smb_request))) {
-		smb_panic("Could not allocate smb_request");
-	}
-
-	init_smb_request(req, (uint8 *)blr->inbuf, 0, blr->encrypted);
-	reply_outbuf(req, 2, 0);
+	reply_outbuf(blr->req, 2, 0);


-- 
Samba Shared Repository


More information about the samba-cvs mailing list