]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
tdb: always open internal databases with incompatible hash.
authorMichael Adam <obnox@samba.org>
Mon, 10 Feb 2014 15:23:48 +0000 (16:23 +0100)
committerJeremy Allison <jra@samba.org>
Sat, 15 Feb 2014 07:26:06 +0000 (08:26 +0100)
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

lib/tdb/common/open.c

index 6ff37ca1f368a78c9092885eb0fa2a23cc2c9534..0454c8bb501832ada04298a404905b09f088279a 100644 (file)
@@ -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;