r23161: Add TDB_VOLATILE as open_flag to activate the per-hashchain dead record
authorVolker Lendecke <vlendec@samba.org>
Sun, 27 May 2007 09:22:11 +0000 (09:22 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 17:22:50 +0000 (12:22 -0500)
optimization.
(This used to be commit 945f73fa39ba6f2b637379ac20d52b4d0306d77f)

source3/lib/tdb/common/open.c
source3/lib/tdb/include/tdb.h

index c7fd3f66564795b05a410563e300cc224e4f9e2d..798395cba22704fb617f4dc0e239d92589813d5f 100644 (file)
@@ -165,6 +165,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));
index dafe2a130ece79865c2a2aeea20a4ecc172f2f04..3268a3bfa0493fa930a442d644dccfc0b08037bf 100644 (file)
@@ -47,6 +47,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)