]> git.ozlabs.org Git - ccan/blobdiff - ccan/tdb/tdb_private.h
tdb: cleanup: rename GLOBAL_LOCK to OPEN_LOCK.
[ccan] / ccan / tdb / tdb_private.h
index 2ccd2e788e4116529c68410e6e363833a3b87f3b..975892ec2d1bfd6637153973955a207f14c4d741 100644 (file)
 
 /* #define TDB_TRACE 1 */
 
+#ifndef __STRING
+#define __STRING(x)    #x
+#endif
+
+#ifndef __STRINGSTRING
+#define __STRINGSTRING(x) __STRING(x)
+#endif
+
+#ifndef __location__
+#define __location__ __FILE__ ":" __STRINGSTRING(__LINE__)
+#endif
+
 #if HAVE_GETPAGESIZE
 #define getpagesize() 0x2000
 #endif
@@ -69,6 +81,7 @@ typedef uint32_t tdb_off_t;
 #define TDB_FREE_MAGIC (~TDB_MAGIC)
 #define TDB_DEAD_MAGIC (0xFEE1DEAD)
 #define TDB_RECOVERY_MAGIC (0xf53bc0e7U)
+#define TDB_RECOVERY_INVALID_MAGIC (0x0)
 #define TDB_ALIGNMENT 4
 #define DEFAULT_HASH_SIZE 131
 #define FREELIST_TOP (sizeof(struct tdb_header))
@@ -121,7 +134,7 @@ void tdb_trace_2rec_retrec(struct tdb_context *tdb, const char *op,
 #endif /* !TDB_TRACE */
 
 /* lock offsets */
-#define GLOBAL_LOCK      0
+#define OPEN_LOCK        0
 #define ACTIVE_LOCK      4
 #define TRANSACTION_LOCK 8