svn commit: samba r14763 - in branches/SAMBA_3_0/source: include locking param

jra at samba.org jra at samba.org
Wed Mar 29 22:19:05 GMT 2006


Author: jra
Date: 2006-03-29 22:19:01 +0000 (Wed, 29 Mar 2006)
New Revision: 14763

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

Log:
Add a new tuning parameter, open files database hash size,
this allows us to experiment with ensuring the tdb hash
size for our open files and locking db are appropriately
sized. Make the hash size larger by default (10007 instead
of 1049) and make the locking db hash size the same as the
open file db hash size.
Jeremy.

Modified:
   branches/SAMBA_3_0/source/include/local.h
   branches/SAMBA_3_0/source/locking/brlock.c
   branches/SAMBA_3_0/source/locking/locking.c
   branches/SAMBA_3_0/source/param/loadparm.c


Changeset:
Modified: branches/SAMBA_3_0/source/include/local.h
===================================================================
--- branches/SAMBA_3_0/source/include/local.h	2006-03-29 22:19:00 UTC (rev 14762)
+++ branches/SAMBA_3_0/source/include/local.h	2006-03-29 22:19:01 UTC (rev 14763)
@@ -236,7 +236,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
+#define SMB_OPEN_DATABASE_TDB_HASH_SIZE 10007
 
 /* Characters we disallow in sharenames. */
 #define INVALID_SHARENAME_CHARS "%<>*?|/\\+=;:\","

Modified: branches/SAMBA_3_0/source/locking/brlock.c
===================================================================
--- branches/SAMBA_3_0/source/locking/brlock.c	2006-03-29 22:19:00 UTC (rev 14762)
+++ branches/SAMBA_3_0/source/locking/brlock.c	2006-03-29 22:19:01 UTC (rev 14763)
@@ -289,8 +289,10 @@
 {
 	if (tdb)
 		return;
-	tdb = tdb_open_log(lock_path("brlock.tdb"), 0,  TDB_DEFAULT|(read_only?0x0:TDB_CLEAR_IF_FIRST),
-		       read_only?O_RDONLY:(O_RDWR|O_CREAT), 0644 );
+	tdb = tdb_open_log(lock_path("brlock.tdb"),
+			lp_open_files_db_hash_size(),
+			TDB_DEFAULT|(read_only?0x0:TDB_CLEAR_IF_FIRST),
+			read_only?O_RDONLY:(O_RDWR|O_CREAT), 0644 );
 	if (!tdb) {
 		DEBUG(0,("Failed to open byte range locking database\n"));
 		return;

Modified: branches/SAMBA_3_0/source/locking/locking.c
===================================================================
--- branches/SAMBA_3_0/source/locking/locking.c	2006-03-29 22:19:00 UTC (rev 14762)
+++ branches/SAMBA_3_0/source/locking/locking.c	2006-03-29 22:19:01 UTC (rev 14763)
@@ -301,7 +301,8 @@
 		return True;
 
 	tdb = tdb_open_log(lock_path("locking.tdb"), 
-			SMB_OPEN_DATABASE_TDB_HASH_SIZE, TDB_DEFAULT|(read_only?0x0:TDB_CLEAR_IF_FIRST), 
+			lp_open_files_db_hash_size(),
+			TDB_DEFAULT|(read_only?0x0:TDB_CLEAR_IF_FIRST), 
 			read_only?O_RDONLY:O_RDWR|O_CREAT,
 			0644);
 

Modified: branches/SAMBA_3_0/source/param/loadparm.c
===================================================================
--- branches/SAMBA_3_0/source/param/loadparm.c	2006-03-29 22:19:00 UTC (rev 14762)
+++ branches/SAMBA_3_0/source/param/loadparm.c	2006-03-29 22:19:01 UTC (rev 14763)
@@ -201,6 +201,7 @@
 	int max_xmit;
 	int max_mux;
 	int max_open_files;
+	int open_files_db_hash_size;
 	int pwordlevel;
 	int unamelevel;
 	int deadtime;
@@ -1023,6 +1024,7 @@
 	{"max disk size", P_INTEGER, P_GLOBAL, &Globals.maxdisksize, NULL, NULL, FLAG_ADVANCED}, 
 	{"max open files", P_INTEGER, P_GLOBAL, &Globals.max_open_files, NULL, NULL, FLAG_ADVANCED}, 
 	{"min print space", P_INTEGER, P_LOCAL, &sDefault.iMinPrintSpace, NULL, NULL, FLAG_ADVANCED | FLAG_PRINT}, 
+	{"open files database hash size", P_INTEGER, P_GLOBAL, &Globals.open_files_db_hash_size, NULL, NULL, FLAG_ADVANCED}, 
 
 	{"socket options", P_GSTRING, P_GLOBAL, user_socket_options, NULL, NULL, FLAG_ADVANCED}, 
 	{"strict allocate", P_BOOL, P_LOCAL, &sDefault.bStrictAllocate, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE}, 
@@ -1498,6 +1500,7 @@
 	Globals.bLargeReadwrite = True;
 	Globals.max_log_size = 5000;
 	Globals.max_open_files = MAX_OPEN_FILES;
+	Globals.open_files_db_hash_size = SMB_OPEN_DATABASE_TDB_HASH_SIZE;
 	Globals.maxprotocol = PROTOCOL_NT1;
 	Globals.minprotocol = PROTOCOL_CORE;
 	Globals.security = SEC_USER;
@@ -1938,6 +1941,7 @@
 FN_GLOBAL_INTEGER(lp_min_wins_ttl, &Globals.min_wins_ttl)
 FN_GLOBAL_INTEGER(lp_max_log_size, &Globals.max_log_size)
 FN_GLOBAL_INTEGER(lp_max_open_files, &Globals.max_open_files)
+FN_GLOBAL_INTEGER(lp_open_files_db_hash_size, &Globals.open_files_db_hash_size)
 FN_GLOBAL_INTEGER(lp_maxxmit, &Globals.max_xmit)
 FN_GLOBAL_INTEGER(lp_maxmux, &Globals.max_mux)
 FN_GLOBAL_INTEGER(lp_passwordlevel, &Globals.pwordlevel)



More information about the samba-cvs mailing list