From 2b50be90a23893a06e0f1436a31d18b97ad0e11d Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Wed, 31 Aug 2011 15:22:16 +0930 Subject: [PATCH] tdb2: add TDB_VERSION1 flag. This will be set for old TDBs; we can start distinguishing paths based on it now. --- ccan/tdb2/tdb1_open.c | 2 +- ccan/tdb2/tdb2.h | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/ccan/tdb2/tdb1_open.c b/ccan/tdb2/tdb1_open.c index 5176f57f..d02a33eb 100644 --- a/ccan/tdb2/tdb1_open.c +++ b/ccan/tdb2/tdb1_open.c @@ -180,7 +180,7 @@ struct tdb1_context *tdb1_open_ex(const char *name, int hash_size, int tdb1_flag tdb->fd = -1; tdb->name = NULL; tdb->map_ptr = NULL; - tdb->flags = tdb1_flags; + tdb->flags = tdb1_flags|TDB_VERSION1; tdb->open_flags = open_flags; if (log_ctx) { tdb->log_fn = log_ctx->log_fn; diff --git a/ccan/tdb2/tdb2.h b/ccan/tdb2/tdb2.h index d5ae329a..4be15e98 100644 --- a/ccan/tdb2/tdb2.h +++ b/ccan/tdb2/tdb2.h @@ -86,6 +86,7 @@ struct tdb_context *tdb_open(const char *name, int tdb_flags, #define TDB_SEQNUM 128 /* maintain a sequence number */ #define TDB_ALLOW_NESTING 256 /* fake nested transactions */ #define TDB_RDONLY 512 /* implied by O_RDONLY */ +#define TDB_VERSION1 1024 /* create/open an old style TDB */ /** * tdb_close - close and free a tdb. -- 2.39.2