diff options
author | Rusty Russell <rusty@rustcorp.com.au> | 2010-09-24 15:45:11 +0930 |
---|---|---|
committer | Rusty Russell <rusty@rustcorp.com.au> | 2010-09-27 10:48:28 +0930 |
commit | 2dcf76c9247ff02a1779000dbbecdc418473ca41 (patch) | |
tree | abb39b50bd6c30c5a6dc42aa0414e68b16237dd8 /lib/tdb/include | |
parent | ccac258d14dda7d8a994a7b80474ce6d85478a6d (diff) | |
download | samba-2dcf76c9247ff02a1779000dbbecdc418473ca41.tar.gz samba-2dcf76c9247ff02a1779000dbbecdc418473ca41.tar.bz2 samba-2dcf76c9247ff02a1779000dbbecdc418473ca41.zip |
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>
Diffstat (limited to 'lib/tdb/include')
-rw-r--r-- | lib/tdb/include/tdb.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/tdb/include/tdb.h b/lib/tdb/include/tdb.h index 08b6b3ab55..96fc157f68 100644 --- a/lib/tdb/include/tdb.h +++ b/lib/tdb/include/tdb.h @@ -50,6 +50,7 @@ extern "C" { #define TDB_VOLATILE 256 /* Activate the per-hashchain freelist, default 5 */ #define TDB_ALLOW_NESTING 512 /* Allow transactions to nest */ #define TDB_DISALLOW_NESTING 1024 /* Disallow transactions to nest */ +#define TDB_INCOMPATIBLE_HASH 2048 /* Better hashing: can't be opened by tdb < 1.2.6. */ /* error codes */ enum TDB_ERROR {TDB_SUCCESS=0, TDB_ERR_CORRUPT, TDB_ERR_IO, TDB_ERR_LOCK, |