]> git.ozlabs.org Git - ccan/commitdiff
tdb2: fix argument order for tdb_gradual_lock.
authorRusty Russell <rusty@rustcorp.com.au>
Mon, 30 Aug 2010 06:51:23 +0000 (16:21 +0930)
committerRusty Russell <rusty@rustcorp.com.au>
Mon, 30 Aug 2010 06:51:23 +0000 (16:21 +0930)
This explains why most of tdb_gradual_lock was not tested: thanks gcov!

ccan/tdb2/lock.c

index c8dbf8267a8f9dab5fc92c9a3e7e810e6d8943d1..2b00584580810ad9aca0ae24dd6f880bd58d0796 100644 (file)
@@ -485,8 +485,8 @@ int tdb_allrecord_lock(struct tdb_context *tdb, int ltype,
        /* Lock all the hash buckets. */
 again:
        hash_size = (1ULL << tdb->header.v.hash_bits);
-       if (tdb_lock_gradual(tdb, ltype, TDB_HASH_LOCK_START,
-                            1ULL << tdb->header.v.hash_bits, flags)) {
+       if (tdb_lock_gradual(tdb, ltype, flags, TDB_HASH_LOCK_START,
+                            hash_size)) {
                if (!(flags & TDB_LOCK_PROBE)) {
                        tdb->log(tdb, TDB_DEBUG_ERROR, tdb->log_priv,
                                 "tdb_lockall hashes failed (%s)\n",