svn commit: samba r15751 - in branches/SAMBA_4_0/source/smb_server: . smb smb2

metze at samba.org metze at samba.org
Sat May 20 16:48:31 GMT 2006


Author: metze
Date: 2006-05-20 16:48:29 +0000 (Sat, 20 May 2006)
New Revision: 15751

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=15751

Log:
thanks to talloc_get_type() I noticed that I used smbsrv_request in the smb2srv code

metze
Modified:
   branches/SAMBA_4_0/source/smb_server/handle.c
   branches/SAMBA_4_0/source/smb_server/smb/request.c
   branches/SAMBA_4_0/source/smb_server/smb2/tcon.c


Changeset:
Modified: branches/SAMBA_4_0/source/smb_server/handle.c
===================================================================
--- branches/SAMBA_4_0/source/smb_server/handle.c	2006-05-20 16:10:22 UTC (rev 15750)
+++ branches/SAMBA_4_0/source/smb_server/handle.c	2006-05-20 16:48:29 UTC (rev 15751)
@@ -76,6 +76,12 @@
 	return smbsrv_handle_find(&smb_tcon->handles, fnum, request_time);
 }
 
+struct smbsrv_handle *smbsrv_smb2_handle_find(struct smbsrv_tcon *smb_tcon,
+					      uint64_t hid, struct timeval request_time)
+{
+	return smbsrv_handle_find(&smb_tcon->handles, hid, request_time);
+}
+
 /*
   destroy a connection structure
 */
@@ -102,16 +108,19 @@
 /*
   find first available handle slot
 */
-struct smbsrv_handle *smbsrv_handle_new(struct smbsrv_request *req)
+struct smbsrv_handle *smbsrv_handle_new(struct smbsrv_session *session,
+				        struct smbsrv_tcon *tcon,
+				        TALLOC_CTX *mem_ctx,
+					struct timeval request_time)
 {
-	struct smbsrv_handles_context *handles_ctx = &req->tcon->handles;
+	struct smbsrv_handles_context *handles_ctx = &tcon->handles;
 	struct smbsrv_handle *handle;
 	int i;
 
-	handle = talloc_zero(req, struct smbsrv_handle);
+	handle = talloc_zero(mem_ctx, struct smbsrv_handle);
 	if (!handle) return NULL;
-	handle->tcon	= req->tcon;
-	handle->session	= req->session;
+	handle->tcon	= tcon;
+	handle->session	= session;
 	
 	i = idr_get_new_above(handles_ctx->idtree_hid, handle, 1, handles_ctx->idtree_limit);
 	if (i == -1) {
@@ -122,12 +131,12 @@
 	handle->session_item.handle = handle;
 
 	DLIST_ADD(handles_ctx->list, handle);
-	DLIST_ADD(handle->session->handles, &handle->session_item);
+	DLIST_ADD(session->handles, &handle->session_item);
 	talloc_set_destructor(handle, smbsrv_handle_destructor);
 
 	/* now fill in some statistics */
-	handle->statistics.open_time		= req->request_time;
-	handle->statistics.last_use_time	= req->request_time;
+	handle->statistics.open_time		= request_time;
+	handle->statistics.last_use_time	= request_time;
 
 	return handle;
 

Modified: branches/SAMBA_4_0/source/smb_server/smb/request.c
===================================================================
--- branches/SAMBA_4_0/source/smb_server/smb/request.c	2006-05-20 16:10:22 UTC (rev 15750)
+++ branches/SAMBA_4_0/source/smb_server/smb/request.c	2006-05-20 16:48:29 UTC (rev 15751)
@@ -671,7 +671,7 @@
 	struct smbsrv_handle *handle;
 	struct ntvfs_handle *h;
 
-	handle = smbsrv_handle_new(req);
+	handle = smbsrv_handle_new(req->session, req->tcon, req, req->request_time);
 	if (!handle) return NT_STATUS_INSUFFICIENT_RESOURCES;
 
 	h = talloc_zero(handle, struct ntvfs_handle);

Modified: branches/SAMBA_4_0/source/smb_server/smb2/tcon.c
===================================================================
--- branches/SAMBA_4_0/source/smb_server/smb2/tcon.c	2006-05-20 16:10:22 UTC (rev 15750)
+++ branches/SAMBA_4_0/source/smb_server/smb2/tcon.c	2006-05-20 16:48:29 UTC (rev 15751)
@@ -59,7 +59,7 @@
 		tcon = smbsrv_smb2_tcon_find(req->session, tid, req->request_time);
 	}
 
-	handle = smbsrv_smb_handle_find(tcon, hid, req->request_time);
+	handle = smbsrv_smb2_handle_find(tcon, hid, req->request_time);
 	if (!handle) {
 		return NULL;
 	}
@@ -83,12 +83,12 @@
 
 static NTSTATUS smb2srv_handle_create_new(void *private_data, struct ntvfs_request *ntvfs, struct ntvfs_handle **_h)
 {
-	struct smbsrv_request *req = talloc_get_type(ntvfs->frontend_data.private_data,
-				     struct smbsrv_request);
+	struct smb2srv_request *req = talloc_get_type(ntvfs->frontend_data.private_data,
+				      struct smb2srv_request);
 	struct smbsrv_handle *handle;
 	struct ntvfs_handle *h;
 
-	handle = smbsrv_handle_new(req);
+	handle = smbsrv_handle_new(req->session, req->tcon, req, req->request_time);
 	if (!handle) return NT_STATUS_INSUFFICIENT_RESOURCES;
 
 	h = talloc_zero(handle, struct ntvfs_handle);



More information about the samba-cvs mailing list