1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-26 10:04:02 +03:00

r23161: Add TDB_VOLATILE as open_flag to activate the per-hashchain dead record

optimization.
(This used to be commit 945f73fa39ba6f2b637379ac20d52b4d0306d77f)
This commit is contained in:
Volker Lendecke 2007-05-27 09:22:11 +00:00 committed by Gerald (Jerry) Carter
parent a32d8a3909
commit d5daef32b2
2 changed files with 5 additions and 0 deletions

View 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));

View 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)