]> git.ozlabs.org Git - ccan/blobdiff - ccan/tdb2/tdb.c
tdb2: use counters to decide when to coalesce records.
[ccan] / ccan / tdb2 / tdb.c
index d7b5163be95eba66ac204f1be75dc239350c41f9..f11701d9ea9c686cfc2b0beefbea069eb3602542 100644 (file)
@@ -42,7 +42,7 @@ static enum TDB_ERROR replace_data(struct tdb_context *tdb,
                ecode = add_free_record(tdb, old_off,
                                        sizeof(struct tdb_used_record)
                                        + key.dsize + old_room,
-                                       TDB_LOCK_WAIT);
+                                       TDB_LOCK_WAIT, true);
                if (ecode == TDB_SUCCESS)
                        ecode = replace_in_hash(tdb, h, new_off);
        } else {
@@ -292,7 +292,7 @@ enum TDB_ERROR tdb_delete(struct tdb_context *tdb, struct tdb_data key)
                                + rec_key_length(&rec)
                                + rec_data_length(&rec)
                                + rec_extra_padding(&rec),
-                               TDB_LOCK_WAIT);
+                               TDB_LOCK_WAIT, true);
 
        if (tdb->flags & TDB_SEQNUM)
                tdb_inc_seqnum(tdb);