tdb->allrecord_lock.count = 0;
tdb->allrecord_lock.ltype = 0;
+ tdb->header_uptodate = false;
hash_size = (1ULL << tdb->header.v.hash_bits);
enum tdb_lock_flags waitflag)
{
/* You're supposed to have a hash lock first! */
- if (!tdb_has_locks(tdb)) {
+ if (!(tdb->flags & TDB_NOLOCK) && !tdb_has_locks(tdb)) {
tdb->ecode = TDB_ERR_LOCK;
tdb->log(tdb, TDB_DEBUG_FATAL, tdb->log_priv,
"tdb_lock_free_list without lock!\n");
tdb->header_uptodate = false;
}
#endif
+
+void tdb_lock_init(struct tdb_context *tdb)
+{
+ tdb->num_lockrecs = 0;
+ tdb->lockrecs = NULL;
+ tdb->allrecord_lock.count = 0;
+}