]> git.ozlabs.org Git - ccan/blobdiff - ccan/tdb2/private.h
tdb2: direct access during transactions.
[ccan] / ccan / tdb2 / private.h
index b60f33a0a2012224d9e3192090cad82dd1d76d64..01172732980689ba3dd62a699ded3b38580ad9a9 100644 (file)
@@ -290,6 +290,15 @@ struct tdb_lock_type {
        uint32_t ltype;
 };
 
+/* This is only needed for tdb_access_commit, but used everywhere to
+ * simplify. */
+struct tdb_access_hdr {
+       struct tdb_access_hdr *next;
+       tdb_off_t off;
+       tdb_len_t len;
+       bool convert;
+};
+
 struct tdb_context {
        /* Filename of the database. */
        const char *name;
@@ -344,6 +353,9 @@ struct tdb_context {
 
        struct tdb_attribute_stats *stats;
 
+       /* Direct access information */
+       struct tdb_access_hdr *access;
+
        /* Single list of all TDBs, to avoid multiple opens. */
        struct tdb_context *next;
        dev_t device;   
@@ -435,9 +447,6 @@ const void *tdb_access_read(struct tdb_context *tdb,
 void *tdb_access_write(struct tdb_context *tdb,
                       tdb_off_t off, tdb_len_t len, bool convert);
 
-/* Is this pointer direct?  (Otherwise it's malloced) */
-bool is_direct(const struct tdb_context *tdb, const void *p);
-
 /* Release result of tdb_access_read/write. */
 void tdb_access_release(struct tdb_context *tdb, const void *p);
 /* Commit result of tdb_acces_write. */