summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Adam <obnox@samba.org>2014-02-10 16:23:48 +0100
committerJeremy Allison <jra@samba.org>2014-02-15 08:26:06 +0100
commit001b9582ccdeea317490adef6918295d8c103b15 (patch)
tree04a9f422ea87cd103443852b7cb1c2f8021c1f5d
parent41b7acacb304a023deca717930fc4dda15565226 (diff)
downloadsamba-001b9582ccdeea317490adef6918295d8c103b15.tar.gz
samba-001b9582ccdeea317490adef6918295d8c103b15.tar.xz
samba-001b9582ccdeea317490adef6918295d8c103b15.zip
tdb: always open internal databases with incompatible hash.
This makes them more efficient due to better distribution of keys across hash chains. Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Sat Feb 15 08:26:07 CET 2014 on sn-devel-104
-rw-r--r--lib/tdb/common/open.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/tdb/common/open.c b/lib/tdb/common/open.c
index 6ff37ca1f3..0454c8bb50 100644
--- a/lib/tdb/common/open.c
+++ b/lib/tdb/common/open.c
@@ -188,6 +188,11 @@ _PUBLIC_ struct tdb_context *tdb_open_ex(const char *name, int hash_size, int td
goto fail;
}
tdb_io_init(tdb);
+
+ if (tdb_flags & TDB_INTERNAL) {
+ tdb_flags |= TDB_INCOMPATIBLE_HASH;
+ }
+
tdb->fd = -1;
#ifdef TDB_TRACE
tdb->tracefd = -1;