]> git.ozlabs.org Git - ccan/blobdiff - ccan/tdb/tdb.c
tdb: cleanup: rename global_lock to allrecord_lock.
[ccan] / ccan / tdb / tdb.c
index bf767099d2028908c68eb4dd0e2d77efe7874d30..2da4428230971f8602e9536d7a7af2abf69e404a 100644 (file)
@@ -286,7 +286,7 @@ int tdb_do_delete(struct tdb_context *tdb, tdb_off_t rec_ptr, struct tdb_record
 
        if (tdb->read_only || tdb->traverse_read) return -1;
 
-       if (tdb->traverse_write != 0 || 
+       if (((tdb->traverse_write != 0) && (!TDB_DEAD(rec))) ||
            tdb_write_lock_record(tdb, rec_ptr) == -1) {
                /* Someone traversing here: mark it as dead */
                rec->magic = TDB_DEAD_MAGIC;
@@ -805,7 +805,7 @@ static int tdb_free_region(struct tdb_context *tdb, tdb_off_t offset, ssize_t le
 
 /*
   wipe the entire database, deleting all records. This can be done
-  very fast by using a global lock. The entire data portion of the
+  very fast by using a allrecord lock. The entire data portion of the
   file becomes a single entry in the freelist.
 
   This code carefully steps around the recovery area, leaving it alone