tdb: TDB_INCOMPATIBLE_HASH, to allow safe changing of default hash.
authorRusty Russell <rusty@rustcorp.com.au>
Fri, 24 Sep 2010 05:24:46 +0000 (14:54 +0930)
committerRusty Russell <rusty@rustcorp.com.au>
Fri, 24 Sep 2010 05:24:46 +0000 (14:54 +0930)
commit95bf6d3f652c031e1bf4a2ef5df187b6f34a4c01
tree260a75b73746ac02ea53806b79e3f0e4767e8285
parent16f4f30fdd9748d54274745df8a443d32d15bc53
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.
ccan/tdb/check.c
ccan/tdb/open.c
ccan/tdb/tdb.h
ccan/tdb/tdb_private.h
ccan/tdb/test/run-incompatible.c [new file with mode: 0644]