- struct free_zone_header zhdr;
- tdb_off_t off, hdrlen;
- tdb_len_t len;
-
- if (tdb_read_convert(tdb, zone_off, &zhdr, sizeof(zhdr)) == -1)
- return TDB_OFF_ERR;
-
- if (zhdr.zone_bits < INITIAL_ZONE_BITS) {
- tdb->log(tdb, TDB_DEBUG_ERROR, tdb->log_priv,
- "check: bad zone_bits %llu at zone %llu\n",
- (long long)zhdr.zone_bits, (long long)zone_off);
- return TDB_OFF_ERR;
- }
-
- /* Zone bits can only increase... */
- if (zhdr.zone_bits > *max_zone_bits)
- *max_zone_bits = zhdr.zone_bits;
- else if (zhdr.zone_bits < *max_zone_bits) {
- tdb->log(tdb, TDB_DEBUG_ERROR, tdb->log_priv,
- "check: small zone_bits %llu at zone %llu\n",
- (long long)zhdr.zone_bits, (long long)zone_off);
- return TDB_OFF_ERR;
+ size_t len;
+
+ for (len = 0; off + len < tdb->map_size; len++) {
+ char c;
+ if (tdb->methods->read(tdb, off, &c, 1))
+ return 0;
+ if (c != 0 && c != 0x43)
+ break;