svn commit: samba r23161 - in branches: SAMBA_3_0/source/lib/tdb/common SAMBA_3_0/source/lib/tdb/include SAMBA_3_0_26/source/lib/tdb/common SAMBA_3_0_26/source/lib/tdb/include

vlendec at samba.org vlendec at samba.org
Sun May 27 09:22:12 GMT 2007


Author: vlendec
Date: 2007-05-27 09:22:11 +0000 (Sun, 27 May 2007)
New Revision: 23161

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

Log:
Add TDB_VOLATILE as open_flag to activate the per-hashchain dead record
optimization.

Modified:
   branches/SAMBA_3_0/source/lib/tdb/common/open.c
   branches/SAMBA_3_0/source/lib/tdb/include/tdb.h
   branches/SAMBA_3_0_26/source/lib/tdb/common/open.c
   branches/SAMBA_3_0_26/source/lib/tdb/include/tdb.h


Changeset:
Modified: branches/SAMBA_3_0/source/lib/tdb/common/open.c
===================================================================
--- branches/SAMBA_3_0/source/lib/tdb/common/open.c	2007-05-26 16:57:53 UTC (rev 23160)
+++ branches/SAMBA_3_0/source/lib/tdb/common/open.c	2007-05-27 09:22:11 UTC (rev 23161)
@@ -165,6 +165,10 @@
 		tdb->page_size = 0x2000;
 	}
 
+	if (open_flags & TDB_VOLATILE) {
+		tdb->max_dead_records = 5;
+	}
+
 	if ((open_flags & O_ACCMODE) == O_WRONLY) {
 		TDB_LOG((tdb, TDB_DEBUG_ERROR, "tdb_open_ex: can't open tdb %s write-only\n",
 			 name));

Modified: branches/SAMBA_3_0/source/lib/tdb/include/tdb.h
===================================================================
--- branches/SAMBA_3_0/source/lib/tdb/include/tdb.h	2007-05-26 16:57:53 UTC (rev 23160)
+++ branches/SAMBA_3_0/source/lib/tdb/include/tdb.h	2007-05-27 09:22:11 UTC (rev 23161)
@@ -47,6 +47,7 @@
 #define TDB_BIGENDIAN 32 /* header is big-endian (internal use) */
 #define TDB_NOSYNC   64 /* don't use synchronous transactions */
 #define TDB_SEQNUM   128 /* maintain a sequence number */
+#define TDB_VOLATILE   256 /* Activate the per-hashchain freelist, default 5 */
 
 #define TDB_ERRCODE(code, ret) ((tdb->ecode = (code)), ret)
 

Modified: branches/SAMBA_3_0_26/source/lib/tdb/common/open.c
===================================================================
--- branches/SAMBA_3_0_26/source/lib/tdb/common/open.c	2007-05-26 16:57:53 UTC (rev 23160)
+++ branches/SAMBA_3_0_26/source/lib/tdb/common/open.c	2007-05-27 09:22:11 UTC (rev 23161)
@@ -165,6 +165,10 @@
 		tdb->page_size = 0x2000;
 	}
 
+	if (open_flags & TDB_VOLATILE) {
+		tdb->max_dead_records = 5;
+	}
+
 	if ((open_flags & O_ACCMODE) == O_WRONLY) {
 		TDB_LOG((tdb, TDB_DEBUG_ERROR, "tdb_open_ex: can't open tdb %s write-only\n",
 			 name));

Modified: branches/SAMBA_3_0_26/source/lib/tdb/include/tdb.h
===================================================================
--- branches/SAMBA_3_0_26/source/lib/tdb/include/tdb.h	2007-05-26 16:57:53 UTC (rev 23160)
+++ branches/SAMBA_3_0_26/source/lib/tdb/include/tdb.h	2007-05-27 09:22:11 UTC (rev 23161)
@@ -47,6 +47,7 @@
 #define TDB_BIGENDIAN 32 /* header is big-endian (internal use) */
 #define TDB_NOSYNC   64 /* don't use synchronous transactions */
 #define TDB_SEQNUM   128 /* maintain a sequence number */
+#define TDB_VOLATILE   256 /* Activate the per-hashchain freelist, default 5 */
 
 #define TDB_ERRCODE(code, ret) ((tdb->ecode = (code)), ret)
 



More information about the samba-cvs mailing list