]> git.ozlabs.org Git - ccan/blobdiff - ccan/tdb2/tdb.c
tdb2: rename set_header to the more appropriate set_used_header.
[ccan] / ccan / tdb2 / tdb.c
index d070a0ef3068210d1d828731a1361716557f476e..f7a6a5b358a77b33692296479052f37e0a202ad5 100644 (file)
@@ -111,9 +111,9 @@ static int tdb_new_database(struct tdb_context *tdb,
        /* Free is empty. */
        newdb.hdr.free_list = offsetof(struct new_database, flist);
        memset(&newdb.flist, 0, sizeof(newdb.flist));
-       set_header(NULL, &newdb.flist.hdr, 0,
-                  sizeof(newdb.flist) - sizeof(newdb.flist.hdr),
-                  sizeof(newdb.flist) - sizeof(newdb.flist.hdr), 1);
+       set_used_header(NULL, &newdb.flist.hdr, 0,
+                       sizeof(newdb.flist) - sizeof(newdb.flist.hdr),
+                       sizeof(newdb.flist) - sizeof(newdb.flist.hdr), 1);
 
        /* Magic food */
        memset(newdb.hdr.magic_food, 0, sizeof(newdb.hdr.magic_food));
@@ -364,7 +364,7 @@ static int update_rec_hdr(struct tdb_context *tdb,
 {
        uint64_t dataroom = rec_data_length(rec) + rec_extra_padding(rec);
 
-       if (set_header(tdb, rec, keylen, datalen, keylen + dataroom, h))
+       if (set_used_header(tdb, rec, keylen, datalen, keylen + dataroom, h))
                return -1;
 
        return tdb_write_convert(tdb, off, rec, sizeof(*rec));
@@ -602,12 +602,11 @@ int tdb_close(struct tdb_context *tdb)
        struct tdb_context **i;
        int ret = 0;
 
-       /* FIXME:
+       tdb_trace(tdb, "tdb_close");
+
        if (tdb->transaction) {
                tdb_transaction_cancel(tdb);
        }
-       */
-       tdb_trace(tdb, "tdb_close");
 
        if (tdb->map_ptr) {
                if (tdb->flags & TDB_INTERNAL)