From a09f3a35519d5be2a7d37dc2a283f84f6eb4e8cc Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Fri, 1 Feb 2013 02:48:00 -0500 Subject: s3:dbwrap_ctdb: add "db_context" to "db_record" Signed-off-by: Stefan Metzmacher Reviewed-by: Michael Adam --- source3/lib/dbwrap/dbwrap_ctdb.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/source3/lib/dbwrap/dbwrap_ctdb.c b/source3/lib/dbwrap/dbwrap_ctdb.c index dd0f4eac32..ee800a89aa 100644 --- a/source3/lib/dbwrap/dbwrap_ctdb.c +++ b/source3/lib/dbwrap/dbwrap_ctdb.c @@ -475,6 +475,7 @@ static struct db_record *db_ctdb_fetch_locked_transaction(struct db_ctdb_ctx *ct return NULL; } + result->db = ctx->db; result->private_data = ctx->transaction; result->key.dsize = key.dsize; @@ -1401,11 +1402,12 @@ static void traverse_read_callback(TDB_DATA key, TDB_DATA data, void *private_da { struct traverse_state *state = (struct traverse_state *)private_data; struct db_record rec; + rec.db = state->db; rec.key = key; rec.value = data; rec.store = db_ctdb_store_deny; rec.delete_rec = db_ctdb_delete_deny; - rec.private_data = state->db; + rec.private_data = NULL; state->fn(&rec, state->private_data); state->count++; } @@ -1426,11 +1428,12 @@ static int traverse_persistent_callback_read(TDB_CONTEXT *tdb, TDB_DATA kbuf, TD return 0; } + rec.db = state->db; rec.key = kbuf; rec.value = dbuf; rec.store = db_ctdb_store_deny; rec.delete_rec = db_ctdb_delete_deny; - rec.private_data = state->db; + rec.private_data = NULL; if (rec.value.dsize <= sizeof(struct ctdb_ltdb_header)) { /* a deleted record */ -- cgit