diff options
author | Rusty Russell <rusty@rustcorp.com.au> | 2009-10-22 00:10:34 +1030 |
---|---|---|
committer | Rusty Russell <rusty@rustcorp.com.au> | 2009-10-22 00:10:34 +1030 |
commit | 022b4d4aa6861c1e3e6d76484d92555221cb6d14 (patch) | |
tree | 013e042b1fd5bbd91899d5314d98b033a25b9845 /lib/tdb/docs | |
parent | 0fc6800005ffb532a5e5699c97f13f1de138d51f (diff) | |
download | samba-022b4d4aa6861c1e3e6d76484d92555221cb6d14.tar.gz samba-022b4d4aa6861c1e3e6d76484d92555221cb6d14.tar.bz2 samba-022b4d4aa6861c1e3e6d76484d92555221cb6d14.zip |
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 <rusty@rustcorp.com.au>
Diffstat (limited to 'lib/tdb/docs')
-rw-r--r-- | lib/tdb/docs/README | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/tdb/docs/README b/lib/tdb/docs/README index 454e4ba032..4eb809fdf4 100644 --- a/lib/tdb/docs/README +++ b/lib/tdb/docs/README @@ -244,3 +244,14 @@ int tdb_transaction_prepare_commit(TDB_CONTEXT *tdb) tdb_transaction_commit() or tdb_transaction_cancel(). Preparing allocates disk space for the pending updates, so a subsequent commit should succeed (barring any hardware failures). + +---------------------------------------------------------------------- +int tdb_check(TDB_CONTEXT *tdb, + int (*check)(TDB_DATA key, TDB_DATA data, void *private_data), + void *private_data);) + + check the consistency of the database, calling back the check function + (if non-NULL) with each record. If some consistency check fails, or + the supplied check function returns -1, tdb_check returns -1, otherwise + 0. Note that logging function (if set) will be called with additional + information on the corruption found. |