X-Git-Url: https://git.ozlabs.org/?a=blobdiff_plain;f=ccan%2Ftdb2%2Ftdb.c;h=f11701d9ea9c686cfc2b0beefbea069eb3602542;hb=f4eb3a18caf946ee6cc2cb57e2a0c6a6f115157f;hp=b96c80103688fd299064b7558b556ab956560e6d;hpb=72e974b25a04a72a1123501aafbb3b5d39019d42;p=ccan diff --git a/ccan/tdb2/tdb.c b/ccan/tdb2/tdb.c index b96c8010..f11701d9 100644 --- a/ccan/tdb2/tdb.c +++ b/ccan/tdb2/tdb.c @@ -41,7 +41,8 @@ static enum TDB_ERROR replace_data(struct tdb_context *tdb, tdb->stats.frees++; ecode = add_free_record(tdb, old_off, sizeof(struct tdb_used_record) - + key.dsize + old_room); + + key.dsize + old_room, + TDB_LOCK_WAIT, true); if (ecode == TDB_SUCCESS) ecode = replace_in_hash(tdb, h, new_off); } else { @@ -290,7 +291,8 @@ enum TDB_ERROR tdb_delete(struct tdb_context *tdb, struct tdb_data key) sizeof(struct tdb_used_record) + rec_key_length(&rec) + rec_data_length(&rec) - + rec_extra_padding(&rec)); + + rec_extra_padding(&rec), + TDB_LOCK_WAIT, true); if (tdb->flags & TDB_SEQNUM) tdb_inc_seqnum(tdb);