]> git.ozlabs.org Git - ccan/blobdiff - ccan/tdb/tdb.c
tdb2: fix tdb_summary reports
[ccan] / ccan / tdb / tdb.c
index 2da4428230971f8602e9536d7a7af2abf69e404a..7317a3aa521554c898d12a5e5b8f57c7dafea36f 100644 (file)
@@ -59,14 +59,14 @@ static void tdb_increment_seqnum(struct tdb_context *tdb)
                return;
        }
 
-       if (tdb_brlock(tdb, F_WRLCK, TDB_SEQNUM_OFS, 1,
-                      TDB_LOCK_WAIT|TDB_LOCK_PROBE) != 0) {
+       if (tdb_nest_lock(tdb, TDB_SEQNUM_OFS, F_WRLCK,
+                         TDB_LOCK_WAIT|TDB_LOCK_PROBE) != 0) {
                return;
        }
 
        tdb_increment_seqnum_nonblock(tdb);
 
-       tdb_brunlock(tdb, F_WRLCK, TDB_SEQNUM_OFS, 1);
+       tdb_nest_unlock(tdb, TDB_SEQNUM_OFS, F_WRLCK, false);
 }
 
 static int tdb_key_compare(TDB_DATA key, TDB_DATA data, void *private_data)
@@ -213,7 +213,7 @@ TDB_DATA tdb_fetch(struct tdb_context *tdb, TDB_DATA key)
  * function. The parsing function is executed under the chain read lock, so it
  * should be fast and should not block on other syscalls.
  *
- * DONT CALL OTHER TDB CALLS FROM THE PARSER, THIS MIGHT LEAD TO SEGFAULTS.
+ * DON'T CALL OTHER TDB CALLS FROM THE PARSER, THIS MIGHT LEAD TO SEGFAULTS.
  *
  * For mmapped tdb's that do not have a transaction open it points the parsing
  * function directly at the mmap area, it avoids the malloc/memcpy in this