From f7e84f8ef86c3323f70e2fa30fd8a49cab1febf9 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Wed, 14 Sep 2011 07:41:13 +0930 Subject: tdb2: Make TDB1 use the same tdb_hash() wrapper as TDB2 This means converting the tdb1 inbuilt hash functions to the tdb2-style, so they return 64 bit. We truncate to 32 bit everywhere but in tdb_check() which needs to do so explicitly. Signed-off-by: Rusty Russell (Imported from CCAN commit 3e46dde21261966941469a6c75e1b45cd2d26324) --- lib/tdb2/tdb1.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'lib/tdb2/tdb1.h') diff --git a/lib/tdb2/tdb1.h b/lib/tdb2/tdb1.h index 67e00c7c86..5227bbbbc8 100644 --- a/lib/tdb2/tdb1.h +++ b/lib/tdb2/tdb1.h @@ -42,7 +42,8 @@ typedef struct tdb1_context TDB1_CONTEXT; typedef int (*tdb1_traverse_func)(struct tdb1_context *, TDB_DATA, TDB_DATA, void *); typedef void (*tdb1_log_func)(struct tdb1_context *, enum tdb_log_level, enum TDB_ERROR, const char *, void *); -typedef unsigned int (*tdb1_hash_func)(TDB_DATA *key); +typedef uint64_t (*tdb1_hash_func)(const void *key, size_t len, uint64_t seed, + void *data); struct tdb1_logging_context { tdb1_log_func log_fn; @@ -106,7 +107,7 @@ int tdb1_hash_size(struct tdb1_context *tdb); void tdb1_increment_seqnum_nonblock(struct tdb1_context *tdb); -unsigned int tdb1_incompatible_hash(TDB_DATA *key); +uint64_t tdb1_incompatible_hash(const void *key, size_t len, uint64_t seed, void *); int tdb1_check(struct tdb1_context *tdb, int (*check) (TDB_DATA key, TDB_DATA data, void *private_data), -- cgit