r11435: Allow the hash size of the tdb open (locking) database
authorJeremy Allison <jra@samba.org>
Tue, 1 Nov 2005 02:07:26 +0000 (02:07 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 16:05:16 +0000 (11:05 -0500)
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.
(This used to be commit 6a902ec49ffea5d0ca0308d5ff51584cece41043)

source3/include/local.h
source3/locking/locking.c

index 8960a4af553e4db0f315e2bb75b5bb65f08de480..c9b54ab1a21888595e35397c4652568645792076 100644 (file)
 
 #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
index aad254f276cfdee58dfb3149144df0c49da56260..322824ea2f4810e004a58dfb7897082b950406e2 100644 (file)
@@ -315,9 +315,9 @@ BOOL locking_init(int read_only)
                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"));