svn commit: samba r11434 - in trunk/source: include locking

jra at samba.org jra at samba.org
Tue Nov 1 02:07:19 GMT 2005


Author: jra
Date: 2005-11-01 02:07:18 +0000 (Tue, 01 Nov 2005)
New Revision: 11434

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

Log:
Allow the hash size of the tdb open (locking) database
to be set in local.h. Change from the default (131) to
another prime (1049). Should this be an smb.conf tunable parameter
based on the number of open file descriptors available ?
If so what scaling factor ? More tests to follow.
Jeremy.

Modified:
   trunk/source/include/local.h
   trunk/source/locking/locking.c


Changeset:
Modified: trunk/source/include/local.h
===================================================================
--- trunk/source/include/local.h	2005-10-31 23:47:57 UTC (rev 11433)
+++ trunk/source/include/local.h	2005-11-01 02:07:18 UTC (rev 11434)
@@ -235,4 +235,7 @@
 
 #define MAX_LDAP_REPLICATION_SLEEP_TIME 5000 /* In milliseconds. */
 
+/* tdb hash size for the open database. */
+#define SMB_OPEN_DATABASE_TDB_HASH_SIZE 1049
+
 #endif

Modified: trunk/source/locking/locking.c
===================================================================
--- trunk/source/locking/locking.c	2005-10-31 23:47:57 UTC (rev 11433)
+++ trunk/source/locking/locking.c	2005-11-01 02:07:18 UTC (rev 11434)
@@ -315,9 +315,9 @@
 		return True;
 
 	tdb = tdb_open_log(lock_path("locking.tdb"), 
-		       0, TDB_DEFAULT|(read_only?0x0:TDB_CLEAR_IF_FIRST), 
-		       read_only?O_RDONLY:O_RDWR|O_CREAT,
-		       0644);
+			SMB_OPEN_DATABASE_TDB_HASH_SIZE, TDB_DEFAULT|(read_only?0x0:TDB_CLEAR_IF_FIRST), 
+			read_only?O_RDONLY:O_RDWR|O_CREAT,
+			0644);
 
 	if (!tdb) {
 		DEBUG(0,("ERROR: Failed to initialise locking database\n"));



More information about the samba-cvs mailing list