]> git.ozlabs.org Git - ccan/blobdiff - ccan/tdb2/tdb1_private.h
tdb2: rearrange tdb_context layout so tdb1_context can match
[ccan] / ccan / tdb2 / tdb1_private.h
index 569ec718580b4f353077af2a71aa86b01f2a2f26..809f13555552ac85811946f1d8dd212cc92f0200 100644 (file)
 #include <limits.h>
 #include <stdio.h>
 #include <utime.h>
-
-#ifndef _PUBLIC_
-#define _PUBLIC_
-#endif
-
 #else
 #include "replace.h"
 #include "system/filesys.h"
@@ -61,6 +56,9 @@
 
 #include "tdb1.h"
 
+/* Temporary wrapper to avoid undue churn in test/ */
+#define tdb1_error(tdb) ((tdb)->ecode)
+
 /* #define TDB_TRACE 1 */
 #ifndef HAVE_GETPAGESIZE
 #define getpagesize() 0x2000
@@ -182,8 +180,6 @@ enum tdb1_lock_flags {
        TDB1_LOCK_WAIT = 1,
        /* If set, don't log an error on failure. */
        TDB1_LOCK_PROBE = 2,
-       /* If set, don't actually lock at all. */
-       TDB1_LOCK_MARK_ONLY = 4,
 };
 
 struct tdb1_context;
@@ -221,24 +217,17 @@ struct tdb1_context {
        struct tdb1_transaction *transaction;
        int page_size;
        int max_dead_records;
-#ifdef TDB1_TRACE
-       int tracefd;
-#endif
-       volatile sig_atomic_t *interrupt_sig_ptr;
 };
 
-
 /*
   internal prototypes
 */
 int tdb1_munmap(struct tdb1_context *tdb);
 void tdb1_mmap(struct tdb1_context *tdb);
 int tdb1_lock(struct tdb1_context *tdb, int list, int ltype);
-int tdb1_lock_nonblock(struct tdb1_context *tdb, int list, int ltype);
 int tdb1_nest_lock(struct tdb1_context *tdb, uint32_t offset, int ltype,
                  enum tdb1_lock_flags flags);
-int tdb1_nest_unlock(struct tdb1_context *tdb, uint32_t offset, int ltype,
-                   bool mark_lock);
+int tdb1_nest_unlock(struct tdb1_context *tdb, uint32_t offset, int ltype);
 int tdb1_unlock(struct tdb1_context *tdb, int list, int ltype);
 int tdb1_brlock(struct tdb1_context *tdb,
               int rw_type, tdb1_off_t offset, size_t len,
@@ -256,7 +245,7 @@ int tdb1_recovery_area(struct tdb1_context *tdb,
                      struct tdb1_record *rec);
 int tdb1_allrecord_lock(struct tdb1_context *tdb, int ltype,
                       enum tdb1_lock_flags flags, bool upgradable);
-int tdb1_allrecord_unlock(struct tdb1_context *tdb, int ltype, bool mark_lock);
+int tdb1_allrecord_unlock(struct tdb1_context *tdb, int ltype);
 int tdb1_allrecord_upgrade(struct tdb1_context *tdb);
 int tdb1_write_lock_record(struct tdb1_context *tdb, tdb1_off_t off);
 int tdb1_write_unlock_record(struct tdb1_context *tdb, tdb1_off_t off);