svn commit: samba r7190 - in branches/SAMBA_3_0/source/smbd: .

jra at samba.org jra at samba.org
Thu Jun 2 05:27:40 GMT 2005


Author: jra
Date: 2005-06-02 05:27:37 +0000 (Thu, 02 Jun 2005)
New Revision: 7190

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

Log:
I *love* valgrind/cachegrind.....
By removing unneeded memsets in qfilepathinfo I just improved our netbench performance
by *********15%**********. Check it out :-).
Jeremy.

Modified:
   branches/SAMBA_3_0/source/smbd/trans2.c


Changeset:
Modified: branches/SAMBA_3_0/source/smbd/trans2.c
===================================================================
--- branches/SAMBA_3_0/source/smbd/trans2.c	2005-06-02 05:27:34 UTC (rev 7189)
+++ branches/SAMBA_3_0/source/smbd/trans2.c	2005-06-02 05:27:37 UTC (rev 7190)
@@ -2850,8 +2850,6 @@
 	}
 	*ppdata = pdata;
 
-	memset((char *)pdata,'\0',data_size);
-
 	c_time = get_create_time(&sbuf,lp_fake_dir_create_times(SNUM(conn)));
 
 	allocation_size = get_allocation_size(conn,fsp,&sbuf);
@@ -2906,13 +2904,13 @@
 			unsigned int ea_size = estimate_ea_size(conn, fsp, fname);
 			DEBUG(10,("call_trans2qfilepathinfo: SMB_INFO_QUERY_EA_SIZE\n"));
 			data_size = 26;
-			put_dos_date2(pdata,l1_fdateCreation,c_time);
-			put_dos_date2(pdata,l1_fdateLastAccess,sbuf.st_atime);
-			put_dos_date2(pdata,l1_fdateLastWrite,sbuf.st_mtime); /* write time */
-			SIVAL(pdata,l1_cbFile,(uint32)file_size);
-			SIVAL(pdata,l1_cbFileAlloc,(uint32)allocation_size);
-			SSVAL(pdata,l1_attrFile,mode);
-			SIVAL(pdata,l1_attrFile+2,ea_size);
+			put_dos_date2(pdata,0,c_time);
+			put_dos_date2(pdata,4,sbuf.st_atime);
+			put_dos_date2(pdata,8,sbuf.st_mtime); /* write time */
+			SIVAL(pdata,12,(uint32)file_size);
+			SIVAL(pdata,16,(uint32)allocation_size);
+			SSVAL(pdata,20,mode);
+			SIVAL(pdata,22,ea_size);
 			break;
 		}
 
@@ -2999,7 +2997,6 @@
 			DEBUG(5,("write: %s ", ctime(&sbuf.st_mtime)));
 			DEBUG(5,("change: %s ", ctime(&sbuf.st_mtime)));
 			DEBUG(5,("mode: %x\n", mode));
-
 			break;
 
 		case SMB_FILE_STANDARD_INFORMATION:
@@ -3015,6 +3012,7 @@
 				SIVAL(pdata,16,sbuf.st_nlink);
 			SCVAL(pdata,20,0);
 			SCVAL(pdata,21,(mode&aDIR)?1:0);
+			SSVAL(pdata,22,0); /* Padding. */
 			break;
 
 		case SMB_FILE_EA_INFORMATION:
@@ -3088,6 +3086,7 @@
 				SIVAL(pdata,16,sbuf.st_nlink);
 			SCVAL(pdata,20,delete_pending);
 			SCVAL(pdata,21,(mode&aDIR)?1:0);
+			SSVAL(pdata,22,0);
 			pdata += 24;
 			SIVAL(pdata,0,ea_size);
 			pdata += 4; /* EA info */



More information about the samba-cvs mailing list