tdb->ecode = TDB_ERR_CORRUPT;
TDB_LOG((tdb, TDB_DEBUG_WARNING, "tdb_rec_free_read bad magic 0x%x at offset=%d\n",
rec->magic, off));
- return TDB_ERRCODE(TDB_ERR_CORRUPT, -1);
+ return -1;
}
if (tdb->methods->tdb_oob(tdb, rec->next+sizeof(*rec), 0) != 0)
return -1;
/* Follow chain (next offset is at start of record) */
last_ptr = i;
}
+ tdb->ecode = TDB_ERR_CORRUPT;
TDB_LOG((tdb, TDB_DEBUG_FATAL,"remove_from_freelist: not on list at off=%d\n", off));
- return TDB_ERRCODE(TDB_ERR_CORRUPT, -1);
+ return -1;
}
#endif
if (tdb_lock(tdb, -1, F_WRLCK) == -1)
return 0;
+ /* over-allocate to reduce fragmentation */
+ length *= 1.25;
+
/* Extra bytes required for tailer */
length += sizeof(tdb_off_t);
length = TDB_ALIGN(length, TDB_ALIGNMENT);