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;
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;
int (*write)(struct tdb_context *, tdb_off_t, const void *, tdb_len_t);
int (*oob)(struct tdb_context *, tdb_off_t, bool);
int (*expand_file)(struct tdb_context *, tdb_len_t);
- void *(*direct)(struct tdb_context *, tdb_off_t, size_t);
+ void *(*direct)(struct tdb_context *, tdb_off_t, size_t, bool);
};
/*
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. */