]> git.ozlabs.org Git - ccan/blobdiff - ccan/tdb2/tdb1_private.h
failtest: add --trace to replace --tracepath
[ccan] / ccan / tdb2 / tdb1_private.h
index 034c7e3328951173fd9623d58d328a4957f66c4a..68dc39f6f8e02d1fcce98feb9a2a55b4e45c4763 100644 (file)
@@ -26,7 +26,6 @@
 */
 
 #include "private.h"
-#include "tdb1.h"
 
 #include <limits.h>
 
@@ -62,7 +61,6 @@
 #define TDB1_DEFAULT_HASH_SIZE 131
 #define TDB1_FREELIST_TOP (sizeof(struct tdb1_header))
 #define TDB1_ALIGN(x,a) (((x) + (a)-1) & ~((a)-1))
-#define TDB1_BYTEREV(x) (((((x)&0xff)<<24)|((x)&0xFF00)<<8)|(((x)>>8)&0xFF00)|((x)>>24))
 #define TDB1_DEAD(r) ((r)->magic == TDB1_DEAD_MAGIC)
 #define TDB1_BAD_MAGIC(r) ((r)->magic != TDB1_MAGIC && !TDB1_DEAD(r))
 #define TDB1_HASH_TOP(hash) (TDB1_FREELIST_TOP + (TDB1_BUCKET(hash)+1)*sizeof(tdb1_off_t))
@@ -143,9 +141,6 @@ int tdb1_recovery_area(struct tdb_context *tdb,
                      const struct tdb1_methods *methods,
                      tdb1_off_t *recovery_offset,
                      struct tdb1_record *rec);
-int tdb1_allrecord_lock(struct tdb_context *tdb, int ltype,
-                      enum tdb_lock_flags flags, bool upgradable);
-int tdb1_allrecord_unlock(struct tdb_context *tdb, int ltype);
 int tdb1_allrecord_upgrade(struct tdb_context *tdb);
 int tdb1_write_lock_record(struct tdb_context *tdb, tdb1_off_t off);
 int tdb1_write_unlock_record(struct tdb_context *tdb, tdb1_off_t off);
@@ -158,16 +153,17 @@ int tdb1_ofs_read(struct tdb_context *tdb, tdb1_off_t offset, tdb1_off_t *d);
 int tdb1_ofs_write(struct tdb_context *tdb, tdb1_off_t offset, tdb1_off_t *d);
 int tdb1_lock_record(struct tdb_context *tdb, tdb1_off_t off);
 int tdb1_unlock_record(struct tdb_context *tdb, tdb1_off_t off);
-bool tdb1_needs_recovery(struct tdb_context *tdb);
+tdb_bool_err tdb1_needs_recovery(struct tdb_context *tdb);
 int tdb1_rec_read(struct tdb_context *tdb, tdb1_off_t offset, struct tdb1_record *rec);
 int tdb1_rec_write(struct tdb_context *tdb, tdb1_off_t offset, struct tdb1_record *rec);
 int tdb1_do_delete(struct tdb_context *tdb, tdb1_off_t rec_ptr, struct tdb1_record *rec);
 unsigned char *tdb1_alloc_read(struct tdb_context *tdb, tdb1_off_t offset, tdb1_len_t len);
-int tdb1_parse_data(struct tdb_context *tdb, TDB_DATA key,
-                  tdb1_off_t offset, tdb1_len_t len,
-                  int (*parser)(TDB_DATA key, TDB_DATA data,
-                                void *private_data),
-                  void *private_data);
+enum TDB_ERROR tdb1_parse_data(struct tdb_context *tdb, TDB_DATA key,
+                              tdb1_off_t offset, tdb1_len_t len,
+                              enum TDB_ERROR (*parser)(TDB_DATA key,
+                                                       TDB_DATA data,
+                                                       void *private_data),
+                              void *private_data);
 tdb1_off_t tdb1_find_lock_hash(struct tdb_context *tdb, TDB_DATA key, uint32_t hash, int locktype,
                           struct tdb1_record *rec);
 void tdb1_io_init(struct tdb_context *tdb);
@@ -175,7 +171,6 @@ int tdb1_expand(struct tdb_context *tdb, tdb1_off_t size);
 int tdb1_rec_free_read(struct tdb_context *tdb, tdb1_off_t off,
                      struct tdb1_record *rec);
 bool tdb1_write_all(int fd, const void *buf, size_t count);
-int tdb1_transaction_recover(struct tdb_context *tdb);
 void tdb1_header_hash(struct tdb_context *tdb,
                     uint32_t *magic1_hash, uint32_t *magic2_hash);
 uint64_t tdb1_old_hash(const void *key, size_t len, uint64_t seed, void *);