X-Git-Url: http://git.ozlabs.org/?p=ccan;a=blobdiff_plain;f=ccan%2Ftdb%2Fcheck.c;h=4fbbb92c5a4ae62902d14b7ccffa697df0ccbde8;hp=955f255484a720a08a07a9e33a1fde6b0036b49c;hb=448b9194f76a138eef05047b1aaa5d211f72e97f;hpb=44eea6ca52a2de5a817cf54d5d206969845dee3d diff --git a/ccan/tdb/check.c b/ccan/tdb/check.c index 955f2554..4fbbb92c 100644 --- a/ccan/tdb/check.c +++ b/ccan/tdb/check.c @@ -40,7 +40,7 @@ static bool tdb_check_header(struct tdb_context *tdb, tdb_off_t *recovery) if (hdr.version != TDB_VERSION) goto corrupt; - if (hdr.rwlocks != 0) + if (hdr.rwlocks != 0 && hdr.rwlocks != TDB_HASH_RWLOCK_MAGIC) goto corrupt; tdb_header_hash(tdb, &h1, &h2); @@ -309,7 +309,7 @@ static bool tdb_check_free_record(struct tdb_context *tdb, } /* Slow, but should be very rare. */ -static size_t dead_space(struct tdb_context *tdb, tdb_off_t off) +size_t tdb_dead_space(struct tdb_context *tdb, tdb_off_t off) { size_t len; @@ -407,7 +407,7 @@ int tdb_check(struct tdb_context *tdb, found_recovery = true; break; } - dead = dead_space(tdb, off); + dead = tdb_dead_space(tdb, off); if (dead < sizeof(rec)) goto corrupt;