tdb2: expose and document tdb1_incompatible_hash.
authorRusty Russell <rusty@rustcorp.com.au>
Tue, 13 Sep 2011 22:35:13 +0000 (08:05 +0930)
committerRusty Russell <rusty@rustcorp.com.au>
Tue, 13 Sep 2011 22:35:13 +0000 (08:05 +0930)
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
(Imported from CCAN commit a4f2eb983b92b68bcad2a0d640924b8b456e3d69)

lib/tdb2/tdb1.h
lib/tdb2/tdb2.h

index 54b6d936d49b67de18aecd95b121a56ed616d977..c46abc7e5e774c7549782415f65a256993cf61b2 100644 (file)
@@ -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 */
index ebfc918404e5de0acea77e896410c5bdbcdaf691..0eda9ef84bda31212a22330b29c0428bbb304322 100644 (file)
@@ -90,6 +90,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()