summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source3/include/dbwrap.h1
-rw-r--r--source3/lib/dbwrap_ctdb.c8
-rw-r--r--source3/lib/dbwrap_tdb.c9
3 files changed, 18 insertions, 0 deletions
diff --git a/source3/include/dbwrap.h b/source3/include/dbwrap.h
index 46833fabdc..3312f9c121 100644
--- a/source3/include/dbwrap.h
+++ b/source3/include/dbwrap.h
@@ -42,6 +42,7 @@ struct db_context {
void *private_data),
void *private_data);
int (*get_seqnum)(struct db_context *db);
+ int (*get_flags)(struct db_context *db);
int (*transaction_start)(struct db_context *db);
int (*transaction_commit)(struct db_context *db);
int (*transaction_cancel)(struct db_context *db);
diff --git a/source3/lib/dbwrap_ctdb.c b/source3/lib/dbwrap_ctdb.c
index 38daa61b33..03667ff355 100644
--- a/source3/lib/dbwrap_ctdb.c
+++ b/source3/lib/dbwrap_ctdb.c
@@ -1158,6 +1158,13 @@ static int db_ctdb_get_seqnum(struct db_context *db)
return tdb_get_seqnum(ctx->wtdb->tdb);
}
+static int db_ctdb_get_flags(struct db_context *db)
+{
+ struct db_ctdb_ctx *ctx = talloc_get_type_abort(db->private_data,
+ struct db_ctdb_ctx);
+ return tdb_get_flags(ctx->wtdb->tdb);
+}
+
struct db_context *db_open_ctdb(TALLOC_CTX *mem_ctx,
const char *name,
int hash_size, int tdb_flags,
@@ -1219,6 +1226,7 @@ struct db_context *db_open_ctdb(TALLOC_CTX *mem_ctx,
result->traverse = db_ctdb_traverse;
result->traverse_read = db_ctdb_traverse_read;
result->get_seqnum = db_ctdb_get_seqnum;
+ result->get_flags = db_ctdb_get_flags;
result->transaction_start = db_ctdb_transaction_start;
result->transaction_commit = db_ctdb_transaction_commit;
result->transaction_cancel = db_ctdb_transaction_cancel;
diff --git a/source3/lib/dbwrap_tdb.c b/source3/lib/dbwrap_tdb.c
index 4860c61ab0..b5eb1881d4 100644
--- a/source3/lib/dbwrap_tdb.c
+++ b/source3/lib/dbwrap_tdb.c
@@ -291,6 +291,14 @@ static int db_tdb_get_seqnum(struct db_context *db)
return tdb_get_seqnum(db_ctx->wtdb->tdb);
}
+static int db_tdb_get_flags(struct db_context *db)
+
+{
+ struct db_tdb_ctx *db_ctx =
+ talloc_get_type_abort(db->private_data, struct db_tdb_ctx);
+ return tdb_get_flags(db_ctx->wtdb->tdb);
+}
+
static int db_tdb_transaction_start(struct db_context *db)
{
struct db_tdb_ctx *db_ctx =
@@ -344,6 +352,7 @@ struct db_context *db_open_tdb(TALLOC_CTX *mem_ctx,
result->traverse = db_tdb_traverse;
result->traverse_read = db_tdb_traverse_read;
result->get_seqnum = db_tdb_get_seqnum;
+ result->get_flags = db_tdb_get_flags;
result->persistent = ((tdb_flags & TDB_CLEAR_IF_FIRST) == 0);
result->transaction_start = db_tdb_transaction_start;
result->transaction_commit = db_tdb_transaction_commit;