return -1;
if (!next) {
- next = alloc(tdb, 0, sizeof(struct tdb_chain), 2,
- false);
+ next = alloc(tdb, 0, sizeof(struct tdb_chain), 0,
+ TDB_CHAIN_MAGIC, false);
if (next == TDB_OFF_ERR)
return -1;
if (zero_out(tdb, next+sizeof(struct tdb_used_record),
static int expand_group(struct tdb_context *tdb, struct hash_info *h)
{
- unsigned bucket, num_vals, i, hash;
+ unsigned bucket, num_vals, i, magic;
size_t subsize;
tdb_off_t subhash;
tdb_off_t vals[1 << TDB_HASH_GROUP_BITS];
if (h->hash_used == 64) {
add_stat(tdb, alloc_chain, 1);
subsize = sizeof(struct tdb_chain);
- hash = 2;
+ magic = TDB_CHAIN_MAGIC;
} else {
add_stat(tdb, alloc_subhash, 1);
subsize = (sizeof(tdb_off_t) << TDB_SUBLEVEL_HASH_BITS);
- hash = 0;
+ magic = TDB_HTABLE_MAGIC;
}
- subhash = alloc(tdb, 0, subsize, hash, false);
+ subhash = alloc(tdb, 0, subsize, 0, magic, false);
if (subhash == TDB_OFF_ERR)
return -1;
ltype);
return -1;
}
- if (rec_magic(&rec) != TDB_MAGIC) {
+ if (rec_magic(&rec) != TDB_USED_MAGIC) {
tdb_logerr(tdb, TDB_ERR_CORRUPT,
TDB_DEBUG_FATAL,
"next_in_hash:"