From a4f2eb983b92b68bcad2a0d640924b8b456e3d69 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Wed, 31 Aug 2011 15:31:07 +0930 Subject: [PATCH] tdb2: expose and document tdb1_incompatible_hash. --- ccan/tdb2/tdb1.h | 2 -- ccan/tdb2/tdb2.h | 12 ++++++++++++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/ccan/tdb2/tdb1.h b/ccan/tdb2/tdb1.h index 54b6d936..c46abc7e 100644 --- a/ccan/tdb2/tdb1.h +++ b/ccan/tdb2/tdb1.h @@ -38,8 +38,6 @@ void tdb1_set_max_dead(struct tdb_context *tdb, int max_dead); -uint64_t tdb1_incompatible_hash(const void *key, size_t len, uint64_t seed, void *); - /* @} ******************************************************************/ #endif /* tdb1.h */ diff --git a/ccan/tdb2/tdb2.h b/ccan/tdb2/tdb2.h index 76ecbe5b..be5d5002 100644 --- a/ccan/tdb2/tdb2.h +++ b/ccan/tdb2/tdb2.h @@ -88,6 +88,18 @@ struct tdb_context *tdb_open(const char *name, int tdb_flags, #define TDB_RDONLY 512 /* implied by O_RDONLY */ #define TDB_VERSION1 1024 /* create/open an old style TDB */ +/** + * tdb1_incompatible_hash - better (Jenkins) hash for tdb1 + * + * This is better than the default hash for tdb1; but older versions of the + * tdb library (prior to version 1.2.6) won't be able to open them. + * + * It only makes sense to specify this (using tdb_attribute_hash) when + * creating (with O_CREAT) an old tdb version using TDB_VERSION1. It's + * equivalent to the TDB_INCOMPATIBLE_HASH flag for tdb1. + */ +uint64_t tdb1_incompatible_hash(const void *, size_t, uint64_t, void *); + /** * tdb_close - close and free a tdb. * @tdb: the tdb context returned from tdb_open() -- 2.39.2