From c16184f83b2fea59cd31ec968f0c6b7e06f9047b Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Wed, 14 Sep 2011 07:43:13 +0930 Subject: tdb2: merge tdb1_context into tdb_context. Finally, we split out the tdb2-specific parts of tdb_context, and put them into a "tdb2" sub-struct; the tdb1 parts go into a "tdb1" sub-struct. We get rido of tdb1_context and use tdb_context everywhere. Signed-off-by: Rusty Russell (Imported from CCAN commit bbeb528e74c0e234e1f724ac8d54be404cfc6f9a) --- lib/tdb2/open.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'lib/tdb2/open.c') diff --git a/lib/tdb2/open.c b/lib/tdb2/open.c index fc683d8c9b..94f09e7a2f 100644 --- a/lib/tdb2/open.c +++ b/lib/tdb2/open.c @@ -363,11 +363,8 @@ struct tdb_context *tdb_open(const char *name, int tdb_flags, } else { tdb->name = NULL; } - tdb->direct_access = 0; tdb->flags = tdb_flags; tdb->log_fn = NULL; - tdb->transaction = NULL; - tdb->access = NULL; tdb->open_flags = open_flags; tdb->last_error = TDB_SUCCESS; tdb->file = NULL; @@ -379,6 +376,9 @@ struct tdb_context *tdb_open(const char *name, int tdb_flags, tdb->stats.base.attr = TDB_ATTRIBUTE_STATS; tdb->stats.size = sizeof(tdb->stats); tdb_io_init(tdb); + tdb->tdb2.direct_access = 0; + tdb->tdb2.transaction = NULL; + tdb->tdb2.access = NULL; while (attr) { switch (attr->base.attr) { @@ -573,7 +573,7 @@ struct tdb_context *tdb_open(const char *name, int tdb_flags, tdb_unlock_open(tdb, openlock); /* This make sure we have current map_size and mmap. */ - ecode = tdb->methods->oob(tdb, tdb->file->map_size + 1, true); + ecode = tdb->tdb2.io->oob(tdb, tdb->file->map_size + 1, true); if (unlikely(ecode != TDB_SUCCESS)) goto fail; @@ -655,7 +655,7 @@ int tdb_close(struct tdb_context *tdb) tdb_trace(tdb, "tdb_close"); - if (tdb->transaction) { + if (tdb->tdb2.transaction) { tdb_transaction_cancel(tdb); } -- cgit