static enum TDB_ERROR check_hash(struct tdb_context *tdb,
tdb_off_t used[],
size_t num_used, size_t num_ftables,
- int (*check)(TDB_DATA, TDB_DATA, void *),
+ enum TDB_ERROR (*check)(TDB_DATA, TDB_DATA, void *),
void *data)
{
/* Free tables also show up as used. */
uint64_t features;
enum TDB_ERROR ecode;
+ if (tdb->flags & TDB_VERSION1) {
+ if (tdb1_check(tdb, check, data) == -1)
+ return tdb->last_error;
+ return TDB_SUCCESS;
+ }
+
ecode = tdb_allrecord_lock(tdb, F_RDLCK, TDB_LOCK_WAIT, false);
if (ecode != TDB_SUCCESS) {
return tdb->last_error = ecode;