X-Git-Url: http://git.ozlabs.org/?p=ccan;a=blobdiff_plain;f=ccan%2Ftdb2%2Fprivate.h;h=01172732980689ba3dd62a699ded3b38580ad9a9;hp=b60f33a0a2012224d9e3192090cad82dd1d76d64;hb=f5087965ebdb24618ca59854b7a819e21c9fdf78;hpb=a56db4a5cbf4346ec8a74322b5267d47b2590ed7 diff --git a/ccan/tdb2/private.h b/ccan/tdb2/private.h index b60f33a0..01172732 100644 --- a/ccan/tdb2/private.h +++ b/ccan/tdb2/private.h @@ -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. */