summaryrefslogtreecommitdiff
path: root/lib/tdb2/tdb1.h
diff options
context:
space:
mode:
authorRusty Russell <rusty@rustcorp.com.au>2011-09-14 07:34:13 +0930
committerRusty Russell <rusty@rustcorp.com.au>2011-09-14 07:34:13 +0930
commit61b1bd1dca145a0417907793579352c66b016c23 (patch)
tree913e709da52d81b38afb6f91e917e5e25db3f451 /lib/tdb2/tdb1.h
parentebb3017cf08cc4dad3217db6cea404069b494b47 (diff)
downloadsamba-61b1bd1dca145a0417907793579352c66b016c23.tar.gz
samba-61b1bd1dca145a0417907793579352c66b016c23.tar.bz2
samba-61b1bd1dca145a0417907793579352c66b016c23.zip
tdb2: approximate INCOMPATIBLE_HASH flag with tdb1_incompatible_hash()
Rather than leak TDB_INCOMPATIBLE_HASH through to the TDB2 API, we make it that if they use the tdb1_incompatible_hash function as their hash, then we treat it as if they had specified the TDB_INCOMPATIBLE_HASH flag (ie. we mark the header so it's unusable by tdb < 1.2.6). This precludes the possibility of using TDB_INCOMPATIBLE_HASH with a custom hash function: that used to allow the user to ensure that old TDB versions couldn't open the TDB file (and recent ones check the header to ensure they're using the right hash). But that's a small loss. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> (Imported from CCAN commit 3004f7e89a5978064b4fb29c1027e6d0d39e9418)
Diffstat (limited to 'lib/tdb2/tdb1.h')
-rw-r--r--lib/tdb2/tdb1.h3
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/tdb2/tdb1.h b/lib/tdb2/tdb1.h
index b2435ba53e..3869373fbe 100644
--- a/lib/tdb2/tdb1.h
+++ b/lib/tdb2/tdb1.h
@@ -49,7 +49,6 @@
#define TDB1_VOLATILE 256 /** Activate the per-hashchain freelist, default 5 */
#define TDB1_ALLOW_NESTING 512 /** Allow transactions to nest */
#define TDB1_DISALLOW_NESTING 1024 /** Disallow transactions to nest */
-#define TDB1_INCOMPATIBLE_HASH 2048 /** Better hashing: can't be opened by tdb < 1.2.6. */
/** This is the context structure that is returned from a db open. */
typedef struct tdb1_context TDB1_CONTEXT;
@@ -121,7 +120,7 @@ int tdb1_hash_size(struct tdb1_context *tdb);
void tdb1_increment_seqnum_nonblock(struct tdb1_context *tdb);
-unsigned int tdb1_jenkins_hash(TDB_DATA *key);
+unsigned int tdb1_incompatible_hash(TDB_DATA *key);
int tdb1_check(struct tdb1_context *tdb,
int (*check) (TDB_DATA key, TDB_DATA data, void *private_data),