From: Gary Lockyer Date: Mon, 19 Mar 2018 22:25:28 +0000 (+1300) Subject: ldb: make key/value backends expose if there is an active transaction X-Git-Tag: ldb-1.4.0~451 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=39e5faa77c144b0c548d8afe749c1f08438b7e8f;p=thirdparty%2Fsamba.git ldb: make key/value backends expose if there is an active transaction Signed-off-by: Gary Lockyer Signed-off-by: Andrew Bartlett --- diff --git a/lib/ldb/ldb_tdb/ldb_tdb.c b/lib/ldb/ldb_tdb/ldb_tdb.c index 873ebbcab0e..31b4a7d9abb 100644 --- a/lib/ldb/ldb_tdb/ldb_tdb.c +++ b/lib/ldb/ldb_tdb/ldb_tdb.c @@ -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, diff --git a/lib/ldb/ldb_tdb/ldb_tdb.h b/lib/ldb/ldb_tdb/ldb_tdb.h index f14666ba88a..72ebb9713f2 100644 --- a/lib/ldb/ldb_tdb/ldb_tdb.h +++ b/lib/ldb/ldb_tdb/ldb_tdb.h @@ -29,6 +29,7 @@ struct kv_db_ops { const char * (*errorstr)(struct ltdb_private *ltdb); const char * (*name)(struct ltdb_private *ltdb); bool (*has_changed)(struct ltdb_private *ltdb); + bool (*transaction_active)(struct ltdb_private *ltdb); }; /* this private structure is used by the ltdb backend in the