tdb2: add TDB_VERSION1 flag.
authorRusty Russell <rusty@rustcorp.com.au>
Tue, 13 Sep 2011 22:06:13 +0000 (07:36 +0930)
committerRusty Russell <rusty@rustcorp.com.au>
Tue, 13 Sep 2011 22:06:13 +0000 (07:36 +0930)
This will be set for old TDBs; we can start distinguishing paths based
on it now.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
(Imported from CCAN commit 2b50be90a23893a06e0f1436a31d18b97ad0e11d)

lib/tdb2/tdb1_open.c
lib/tdb2/tdb2.h

index 5176f57f77666dd264a6c2d2dfb693693978fb9f..d02a33eb85c506ba5aa375171588203d85cfb31f 100644 (file)
@@ -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;
index 0d7be789db95f24c145f2d1c22f8bae308caef77..3939c4abe9bb29d3508fd1f8d140738bc2043c2f 100644 (file)
@@ -88,6 +88,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.