From 022b4d4aa6861c1e3e6d76484d92555221cb6d14 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Thu, 22 Oct 2009 00:10:34 +1030 Subject: lib/tdb: add tdb_check() ctdb wants a quick way to detect corrupt tdbs; particularly, tdbs with loops in their hash chains. tdb_check() provides this. Signed-off-by: Rusty Russell --- lib/tdb/include/tdb.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'lib/tdb/include') diff --git a/lib/tdb/include/tdb.h b/lib/tdb/include/tdb.h index c00b6cb33e..e849f20641 100644 --- a/lib/tdb/include/tdb.h +++ b/lib/tdb/include/tdb.h @@ -139,6 +139,9 @@ void tdb_add_flags(struct tdb_context *tdb, unsigned flag); void tdb_remove_flags(struct tdb_context *tdb, unsigned flag); void tdb_enable_seqnum(struct tdb_context *tdb); void tdb_increment_seqnum_nonblock(struct tdb_context *tdb); +int tdb_check(struct tdb_context *tdb, + int (*check)(TDB_DATA key, TDB_DATA data, void *private_data), + void *private_data); /* Low level locking functions: use with care */ int tdb_chainlock(struct tdb_context *tdb, TDB_DATA key); -- cgit