ldb: make key/value backends expose if there is an active transaction
[metze/samba/wip.git] / lib / ldb / ldb_tdb / ldb_tdb.c
index 873ebbcab0e58b10ab5d662412c131580627fcb6..31b4a7d9abb4c3e1f2f9856a1aa45a3c910d0258 100644 (file)
@@ -1925,6 +1925,11 @@ static bool ltdb_tdb_changed(struct ltdb_private *ltdb)
        return has_changed;
 }
 
+static bool ltdb_transaction_active(struct ltdb_private *ltdb)
+{
+       return tdb_transaction_active(ltdb->tdb);
+}
+
 static const struct kv_db_ops key_value_ops = {
        .store = ltdb_tdb_store,
        .delete = ltdb_tdb_delete,
@@ -1941,6 +1946,7 @@ static const struct kv_db_ops key_value_ops = {
        .errorstr = ltdb_errorstr,
        .name = ltdb_tdb_name,
        .has_changed = ltdb_tdb_changed,
+       .transaction_active = ltdb_transaction_active,
 };
 
 static void ltdb_callback(struct tevent_context *ev,