summaryrefslogtreecommitdiffstats
path: root/source/lib
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2008-01-14 16:26:52 +1100
committerAndrew Tridgell <tridge@samba.org>2008-01-14 16:26:52 +1100
commit9f002eeff9bcf33a00e5641cb14338e866a17afe (patch)
tree906cfc50b124247897b7b2cf272484bd51276ff0 /source/lib
parentc91e9c785b5bf4b0c479edf8eb33da22bf615387 (diff)
downloadsamba-9f002eeff9bcf33a00e5641cb14338e866a17afe.tar.gz
samba-9f002eeff9bcf33a00e5641cb14338e866a17afe.tar.xz
samba-9f002eeff9bcf33a00e5641cb14338e866a17afe.zip
samba3 already has tdb_validate()
Diffstat (limited to 'source/lib')
-rw-r--r--source/lib/tdb/common/tdb.c42
-rw-r--r--source/lib/tdb/include/tdb.h1
2 files changed, 0 insertions, 43 deletions
diff --git a/source/lib/tdb/common/tdb.c b/source/lib/tdb/common/tdb.c
index fd4e1cc8af2..ea5d9ccc601 100644
--- a/source/lib/tdb/common/tdb.c
+++ b/source/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;
-}
-
-
diff --git a/source/lib/tdb/include/tdb.h b/source/lib/tdb/include/tdb.h
index daa2d431358..0008085de54 100644
--- a/source/lib/tdb/include/tdb.h
+++ b/source/lib/tdb/include/tdb.h
@@ -157,7 +157,6 @@ int tdb_printfreelist(struct tdb_context *tdb);
int tdb_validate_freelist(struct tdb_context *tdb, int *pnum_entries);
int tdb_wipe_all(struct tdb_context *tdb);
int tdb_freelist_size(struct tdb_context *tdb);
-int tdb_validate(struct tdb_context *tdb);
extern TDB_DATA tdb_null;