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

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

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:
   branches/SAMBA_3_0/source/include/local.h
   branches/SAMBA_3_0/source/locking/locking.c


Changeset:
Modified: branches/SAMBA_3_0/source/include/local.h
===================================================================
--- branches/SAMBA_3_0/source/include/local.h   2005-11-01 02:07:18 UTC (rev 
11434)
+++ branches/SAMBA_3_0/source/include/local.h   2005-11-01 02:07:26 UTC (rev 
11435)
@@ -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: branches/SAMBA_3_0/source/locking/locking.c
===================================================================
--- branches/SAMBA_3_0/source/locking/locking.c 2005-11-01 02:07:18 UTC (rev 
11434)
+++ branches/SAMBA_3_0/source/locking/locking.c 2005-11-01 02:07:26 UTC (rev 
11435)
@@ -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"));

Reply via email to