summaryrefslogtreecommitdiffstats
path: root/source/tdb/tdb.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2003-10-20 18:05:22 +0000
committerJeremy Allison <jra@samba.org>2003-10-20 18:05:22 +0000
commitf81fdcc935317f66d562d485a40948c2a8bcbb21 (patch)
tree8fc6db751687d506f01df966f05c103add59efae /source/tdb/tdb.c
parent5ccf6baad7ffb1f992aaf24b41ef5c83362cf613 (diff)
downloadsamba-f81fdcc935317f66d562d485a40948c2a8bcbb21.tar.gz
samba-f81fdcc935317f66d562d485a40948c2a8bcbb21.tar.xz
samba-f81fdcc935317f66d562d485a40948c2a8bcbb21.zip
Merge tridge's tdb updates.
Jeremy.
Diffstat (limited to 'source/tdb/tdb.c')
-rw-r--r--source/tdb/tdb.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/source/tdb/tdb.c b/source/tdb/tdb.c
index f5809ef63ad..e68bda40556 100644
--- a/source/tdb/tdb.c
+++ b/source/tdb/tdb.c
@@ -77,6 +77,8 @@
#define TDB_DEAD(r) ((r)->magic == TDB_DEAD_MAGIC)
#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))
+#define TDB_DATA_START(hash_size) (TDB_HASH_TOP(hash_size-1) + TDB_SPINLOCK_SIZE(hash_size))
+
/* NB assumes there is a local variable called "tdb" that is the
* current context, also takes doubly-parenthesized print-style
@@ -663,10 +665,10 @@ static int tdb_free(TDB_CONTEXT *tdb, tdb_off offset, struct list_struct *rec)
left:
/* Look left */
left = offset - sizeof(tdb_off);
- if (left > TDB_HASH_TOP(tdb->header.hash_size-1)) {
+ if (left > TDB_DATA_START(tdb->header.hash_size)) {
struct list_struct l;
tdb_off leftsize;
-
+
/* Read in tailer and jump back to header */
if (ofs_read(tdb, left, &leftsize) == -1) {
TDB_LOG((tdb, 0, "tdb_free: left offset read failed at %u\n", left));