+ uint64_t lock_lowlevel;
+ uint64_t lock_nonblock;
+ uint64_t lock_nonblock_fail;
+};
+
+/**
+ * struct tdb_attribute_openhook - tdb special effects hook for open
+ *
+ * This attribute contains a function to call once we have the OPEN_LOCK
+ * for the tdb, but before we've examined its contents. If this succeeds,
+ * the tdb will be populated if it's then zero-length.
+ *
+ * This is a hack to allow support for TDB1-style TDB_CLEAR_IF_FIRST
+ * behaviour.
+ */
+struct tdb_attribute_openhook {
+ struct tdb_attribute_base base; /* .attr = TDB_ATTRIBUTE_OPENHOOK */
+ enum TDB_ERROR (*fn)(int fd, void *data);
+ void *data;
+};
+
+/**
+ * struct tdb_attribute_flock - tdb special effects hook for file locking
+ *
+ * This attribute contains function to call to place locks on a file; it can
+ * be used to support non-blocking operations or lock proxying.
+ *
+ * They should return 0 on success, -1 on failure and set errno.
+ *
+ * An error will be logged on error if errno is neither EAGAIN nor EINTR
+ * (normally it would only return EAGAIN if waitflag is false, and
+ * loop internally on EINTR).
+ */
+struct tdb_attribute_flock {
+ struct tdb_attribute_base base; /* .attr = TDB_ATTRIBUTE_FLOCK */
+ int (*lock)(int fd,int rw, off_t off, off_t len, bool waitflag, void *);
+ int (*unlock)(int fd, int rw, off_t off, off_t len, void *);
+ void *data;
+};
+
+/**
+ * struct tdb_attribute_tdb1_hashsize - tdb1 hashsize
+ *
+ * This attribute allows setting the TDB1 hashsize; it only makes sense with
+ * O_CREAT and TDB_VERSION1.
+ *
+ * Hashsize should generally be a prime, such as 10007.
+ */
+struct tdb_attribute_tdb1_hashsize {
+ struct tdb_attribute_base base; /* .attr = TDB_ATTRIBUTE_TDB1_HASHSIZE */
+ unsigned int hsize;
+};
+
+/**
+ * struct tdb_attribute_tdb1_max_dead - tdb1 number of maximum dead records.
+ *
+ * TDB1 has a method to speed up its slow free list: it lets a certain
+ * number of "dead" records build up before freeing them. This is
+ * particularly useful for volatile TDBs; setting it to 5 is
+ * equivalent to tdb1's TDB_VOLATILE flag.
+ */
+struct tdb_attribute_tdb1_max_dead {
+ struct tdb_attribute_base base; /* .attr = TDB_ATTRIBUTE_TDB1_MAX_DEAD */
+ unsigned int max_dead;