Minor optimization: don't make a dependency between two traverse_reads.
authorRusty Russell <rusty@rustcorp.com.au>
Thu, 16 Jul 2009 07:19:23 +0000 (16:49 +0930)
committerRusty Russell <rusty@rustcorp.com.au>
Thu, 16 Jul 2009 07:19:23 +0000 (16:49 +0930)
ccan/tdb/tools/replay_trace.c

index 8e099f2f13a255cfefbf15e5806e27ceac397ab4..0ca81aaa0386d29aba032162320045231fa9a1a0 100644 (file)
@@ -1443,6 +1443,12 @@ static void make_traverse_depends(char *filename[],
 
        for (i = 1; i < num_traversals; i++) {
                const struct op *prev = &op[dep[i-1].file][dep[i-1].op_num];
+               const struct op *curr = &op[dep[i].file][dep[i].op_num];
+
+               /* Read traverses don't depend on each other (read lock). */
+               if (prev->op == OP_TDB_TRAVERSE_READ_START
+                   && curr->op == OP_TDB_TRAVERSE_READ_START)
+                       continue;
 
                /* Only make dependency if it's clear. */
                if (compare_traverse_dep(&dep[i], &dep[i-1])) {