tdb: TDB_INCOMPATIBLE_HASH, to allow safe changing of default hash.
authorRusty Russell <rusty@rustcorp.com.au>
Fri, 24 Sep 2010 06:15:11 +0000 (15:45 +0930)
committerRusty Russell <rusty@rustcorp.com.au>
Mon, 27 Sep 2010 01:18:28 +0000 (10:48 +0930)
commit2dcf76c9247ff02a1779000dbbecdc418473ca41
treeabb39b50bd6c30c5a6dc42aa0414e68b16237dd8
parentccac258d14dda7d8a994a7b80474ce6d85478a6d
tdb: TDB_INCOMPATIBLE_HASH, to allow safe changing of default hash.

This flag to tdb_open/tdb_open_ex effects creation of a new database:
1) Uses the Jenkins lookup3 hash instead of the old gdbm hash if none is
   specified,
2) Places a non-zero field in header->rwlocks, so older versions of TDB will
   refuse to open it.

This means that the caller (ie Samba) can set this flag to safely
change the hash function.  Versions of TDB from this one on will either
use the correct hash or refuse to open (if a different hash is specified).
Older TDB versions will see the nonzero rwlocks field and refuse to open
it under any conditions.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
lib/tdb/common/check.c
lib/tdb/common/open.c
lib/tdb/common/tdb_private.h
lib/tdb/configure.ac
lib/tdb/include/tdb.h
lib/tdb/wscript