summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorMichael Adam <obnox@samba.org>2007-07-20 14:52:47 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 15:01:14 -0500
commitc94cba5b7bb0c1cc2cfb0eebc8efe0250de29e0a (patch)
tree6320a3c6bc5322b8b97135603f5346a1d47a37c5 /source4
parentaf8432e692eeb94bce80f155c6b9ab158258fff8 (diff)
downloadsamba-c94cba5b7bb0c1cc2cfb0eebc8efe0250de29e0a.tar.gz
samba-c94cba5b7bb0c1cc2cfb0eebc8efe0250de29e0a.tar.bz2
samba-c94cba5b7bb0c1cc2cfb0eebc8efe0250de29e0a.zip
r23978: Merge r23161 from Samba3:
Add TDB_VOLATILE as open_flag to activate the per-hashchain dead record optimization. (This used to be commit 868cdb1781fe94afbc1658e72bf06de20193bcd7)
Diffstat (limited to 'source4')
-rw-r--r--source4/lib/tdb/common/open.c4
-rw-r--r--source4/lib/tdb/include/tdb.h1
2 files changed, 5 insertions, 0 deletions
diff --git a/source4/lib/tdb/common/open.c b/source4/lib/tdb/common/open.c
index 1985bb75f3..eadb3fd2f3 100644
--- a/source4/lib/tdb/common/open.c
+++ b/source4/lib/tdb/common/open.c
@@ -164,6 +164,10 @@ struct tdb_context *tdb_open_ex(const char *name, int hash_size, int tdb_flags,
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));
diff --git a/source4/lib/tdb/include/tdb.h b/source4/lib/tdb/include/tdb.h
index fb59911ebe..f3a0dbe7bf 100644
--- a/source4/lib/tdb/include/tdb.h
+++ b/source4/lib/tdb/include/tdb.h
@@ -46,6 +46,7 @@ extern "C" {
#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)