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)
committerRonnie Sahlberg <ronniesahlberg@gmail.com>
Fri, 8 Oct 2010 01:58:50 +0000 (12:58 +1100)
commitfc61340ca7f7da3b680e2eeeb0739bed046e3159
tree91dc3d18e08b1d31829e011360317a035be7d420
parent79ed337963ec658bfe7e7784f9b143e8ac84c9a0
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