Implemented for ntdb and tdb; falls back to 0 for others.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
return db->wipe(db);
}
+int dbwrap_hash_size(struct db_context *db)
+{
+ return db->hash_size;
+}
+
int dbwrap_check(struct db_context *db)
{
if (db->check == NULL) {
int dbwrap_wipe(struct db_context *db);
int dbwrap_check(struct db_context *db);
int dbwrap_get_seqnum(struct db_context *db);
+/* Returns 0 if unknown. */
+int dbwrap_hash_size(struct db_context *db);
int dbwrap_transaction_start(struct db_context *db);
NTSTATUS dbwrap_transaction_start_nonblock(struct db_context *db);
int dbwrap_transaction_commit(struct db_context *db);
db->exists = dbwrap_cache_exists;
db->id = dbwrap_cache_id;
db->name = dbwrap_name(ctx->backing);
+ db->hash_size = dbwrap_hash_size(ctx->backing);
db->stored_callback = NULL;
db->wipe = NULL;
db->lock_order = 0;
result->traverse_read = db_file_traverse;
result->persistent = ((tdb_flags & TDB_CLEAR_IF_FIRST) == 0);
result->name = name;
+ result->hash_size = 0;
ctx->locked_record = NULL;
if (!(ctx->dirname = talloc_strdup(ctx, name))) {
int (*check)(struct db_context *db);
void (*id)(struct db_context *db, const uint8_t **id, size_t *idlen);
const char *name;
+ int hash_size;
void *private_data;
enum dbwrap_lock_order lock_order;
bool persistent;
result->lock_order = 0;
result->id = db_rbt_id;
result->name = "dbwrap rbt";
+ result->hash_size = 0;
result->stored_callback = NULL;
return result;
result->check = db_tdb_check;
result->stored_callback = NULL;
result->name = tdb_name(db_tdb->wtdb->tdb);
+ result->hash_size = hash_size;
return result;
fail: