h = tdb_access_read(tdb, hash_off, sizeof(*h) << bits, true);
if (TDB_PTR_IS_ERR(h)) {
- return TDB_PTR_ERR(h);
+ return TDB_ERR_TO_OFF(TDB_PTR_ERR(h));
}
for (i = 0; i < (1 << bits); i++)
count += (h[i] != 0);
off + sizeof(p->u),
TDB_SUBLEVEL_HASH_BITS);
if (TDB_OFF_IS_ERR(count)) {
- return count;
+ return TDB_OFF_TO_ERR(count);
}
tally_add(hashes, count);
tally_add(extra, rec_extra_padding(&p->u));
} else {
len = dead_space(tdb, off);
if (TDB_OFF_IS_ERR(len)) {
- return len;
+ return TDB_OFF_TO_ERR(len);
}
}
tdb_access_release(tdb, p);
char *hashesg, *freeg, *keysg, *datag, *extrag, *uncoalg;
enum TDB_ERROR ecode;
+ if (tdb->flags & TDB_VERSION1) {
+ /* tdb1 doesn't do graphs. */
+ *summary = tdb1_summary(tdb);
+ if (!*summary)
+ return tdb->last_error;
+ return TDB_SUCCESS;
+ }
+
hashesg = freeg = keysg = datag = extrag = uncoalg = NULL;
ecode = tdb_allrecord_lock(tdb, F_RDLCK, TDB_LOCK_WAIT, false);