Commit 91505ce2 authored by Rusty Russell's avatar Rusty Russell

tdb2: rework check.c internal functions to return enum TDB_ERROR.

Of course, we leave the API the same, but percolate error codes all the
way back to tdb_check().
parent 3d917ba6
This diff is collapsed.
...@@ -453,7 +453,7 @@ unsigned int size_to_bucket(tdb_len_t data_len); ...@@ -453,7 +453,7 @@ unsigned int size_to_bucket(tdb_len_t data_len);
tdb_off_t bucket_off(tdb_off_t ftable_off, unsigned bucket); tdb_off_t bucket_off(tdb_off_t ftable_off, unsigned bucket);
/* Used by tdb_summary */ /* Used by tdb_summary */
size_t dead_space(struct tdb_context *tdb, tdb_off_t off); tdb_off_t dead_space(struct tdb_context *tdb, tdb_off_t off);
/* io.c: */ /* io.c: */
/* Initialize tdb->methods. */ /* Initialize tdb->methods. */
......
...@@ -113,8 +113,12 @@ static bool summarize(struct tdb_context *tdb, ...@@ -113,8 +113,12 @@ static bool summarize(struct tdb_context *tdb,
+ rec_extra_padding(&p->u); + rec_extra_padding(&p->u);
tally_add(chains, 1); tally_add(chains, 1);
tally_add(extra, rec_extra_padding(&p->u)); tally_add(extra, rec_extra_padding(&p->u));
} else } else {
len = dead_space(tdb, off); len = dead_space(tdb, off);
if (TDB_OFF_IS_ERR(len)) {
return false;
}
}
tdb_access_release(tdb, p); tdb_access_release(tdb, p);
} }
if (unc) if (unc)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment