summaryrefslogtreecommitdiff
path: root/source4/lib/tdb/common/tdb_private.h
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2008-01-16 09:26:24 +1100
committerAndrew Bartlett <abartlet@samba.org>2008-01-16 09:26:24 +1100
commite02e67ec36ecc5f5af2fcf3a7c6b0282173df8aa (patch)
tree0e615183dba95d8268b8e9bd553928581eca1ccb /source4/lib/tdb/common/tdb_private.h
parent9ff39862266f19c2a8e0243ec97ea8d7c463c3ef (diff)
parentc92a1d0752abf42a76e16e7c19229841ac35dc81 (diff)
downloadsamba-e02e67ec36ecc5f5af2fcf3a7c6b0282173df8aa.tar.gz
samba-e02e67ec36ecc5f5af2fcf3a7c6b0282173df8aa.tar.bz2
samba-e02e67ec36ecc5f5af2fcf3a7c6b0282173df8aa.zip
Merge branch 'v4-0-test' of git://git.samba.org/samba into 4-0-abartlet
(This used to be commit c4aba5ad01f5095ad7a9d0d0f1e3c6afedbbd9b7)
Diffstat (limited to 'source4/lib/tdb/common/tdb_private.h')
-rw-r--r--source4/lib/tdb/common/tdb_private.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/source4/lib/tdb/common/tdb_private.h b/source4/lib/tdb/common/tdb_private.h
index 00bd0eb537..63a6d04e72 100644
--- a/source4/lib/tdb/common/tdb_private.h
+++ b/source4/lib/tdb/common/tdb_private.h
@@ -38,6 +38,10 @@
typedef uint32_t tdb_len_t;
typedef uint32_t tdb_off_t;
+#ifndef offsetof
+#define offsetof(t,f) ((unsigned int)&((t *)0)->f)
+#endif
+
#define TDB_MAGIC_FOOD "TDB file\n"
#define TDB_VERSION (0x26011967 + 6)
#define TDB_MAGIC (0x26011999U)
@@ -54,7 +58,7 @@ typedef uint32_t tdb_off_t;
#define TDB_BAD_MAGIC(r) ((r)->magic != TDB_MAGIC && !TDB_DEAD(r))
#define TDB_HASH_TOP(hash) (FREELIST_TOP + (BUCKET(hash)+1)*sizeof(tdb_off_t))
#define TDB_HASHTABLE_SIZE(tdb) ((tdb->header.hash_size+1)*sizeof(tdb_off_t))
-#define TDB_DATA_START(hash_size) TDB_HASH_TOP(hash_size-1)
+#define TDB_DATA_START(hash_size) (TDB_HASH_TOP(hash_size-1) + sizeof(tdb_off_t))
#define TDB_RECOVERY_HEAD offsetof(struct tdb_header, recovery_start)
#define TDB_SEQNUM_OFS offsetof(struct tdb_header, sequence_number)
#define TDB_PAD_BYTE 0x42
@@ -144,6 +148,7 @@ struct tdb_context {
tdb_len_t map_size; /* how much space has been mapped */
int read_only; /* opened read-only */
int traverse_read; /* read-only traversal */
+ int traverse_write; /* read-write traversal */
struct tdb_lock_type global_lock;
int num_lockrecs;
struct tdb_lock_type *lockrecs; /* only real locks, all with count>0 */