diff options
author | Andrew Bartlett <abartlet@samba.org> | 2008-01-22 10:53:14 +1100 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2008-01-22 10:53:14 +1100 |
commit | 11061499e182b9c41ec793d4eefb8a2cf7c88bfe (patch) | |
tree | fa08fcbf21143655eb85ba79c6169b3b2eb24fdd /source4/lib/tdb/common/tdb.c | |
parent | 27b3c24040b1a7aa88413c477a3769bcd6847d72 (diff) | |
parent | 24efc9fc36194d379838eb9911b65e93535da19b (diff) | |
download | samba-11061499e182b9c41ec793d4eefb8a2cf7c88bfe.tar.gz samba-11061499e182b9c41ec793d4eefb8a2cf7c88bfe.tar.bz2 samba-11061499e182b9c41ec793d4eefb8a2cf7c88bfe.zip |
Merge branch 'v4-0-test' of git://git.samba.org/samba into 4-0-abartlet
(This used to be commit 74220ca244865f97825cabdbc8aa899e71c25c7d)
Diffstat (limited to 'source4/lib/tdb/common/tdb.c')
-rw-r--r-- | source4/lib/tdb/common/tdb.c | 42 |
1 files changed, 0 insertions, 42 deletions
diff --git a/source4/lib/tdb/common/tdb.c b/source4/lib/tdb/common/tdb.c index fd4e1cc8af..ea5d9ccc60 100644 --- a/source4/lib/tdb/common/tdb.c +++ b/source4/lib/tdb/common/tdb.c @@ -743,45 +743,3 @@ failed: tdb_unlockall(tdb); return -1; } - - -/* - validate the integrity of all tdb hash chains. Useful when debugging - */ -int tdb_validate(struct tdb_context *tdb) -{ - int h; - for (h=-1;h<(int)tdb->header.hash_size;h++) { - tdb_off_t rec_ptr; - uint32_t count = 0; - if (tdb_ofs_read(tdb, TDB_HASH_TOP(h), &rec_ptr) == -1) { - TDB_LOG((tdb, TDB_DEBUG_FATAL, "tdb_validate: failed ofs_read at top of hash %d\n", h)); - return -1; - } - while (rec_ptr) { - struct list_struct r; - tdb_off_t size; - - if (tdb_rec_read(tdb, rec_ptr, &r) == -1) { - TDB_LOG((tdb, TDB_DEBUG_FATAL, "tdb_validate: failed rec_read h=%d rec_ptr=%u count=%u\n", - h, rec_ptr, count)); - return -1; - } - if (tdb_ofs_read(tdb, rec_ptr + sizeof(r) + r.rec_len - sizeof(tdb_off_t), &size) == -1) { - TDB_LOG((tdb, TDB_DEBUG_FATAL, "tdb_validate: failed ofs_read h=%d rec_ptr=%u count=%u\n", - h, rec_ptr, count)); - return -1; - } - if (size != r.rec_len + sizeof(r)) { - TDB_LOG((tdb, TDB_DEBUG_FATAL, "tdb_validate: failed size check size=%u h=%d rec_ptr=%u count=%u\n", - size, h, rec_ptr, count)); - return -1; - } - rec_ptr = r.next; - count++; - } - } - return 0; -} - - |