rbtree_latch: Use seqcount_latch_t
Latch sequence counters have unique read and write APIs, and thus seqcount_latch_t was recently introduced at seqlock.h. Use that new data type instead of plain seqcount_t. This adds the necessary type-safety and ensures that only latching-safe seqcount APIs are to be used. Signed-off-by: Ahmed S. Darwish <a.darwish@linutronix.de> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Link: https://lkml.kernel.org/r/20200827114044.11173-8-a.darwish@linutronix.de
This commit is contained in:

committed by
Peter Zijlstra

parent
a1f1066133
commit
24bf401ceb
@@ -42,7 +42,7 @@ struct latch_tree_node {
|
|||||||
};
|
};
|
||||||
|
|
||||||
struct latch_tree_root {
|
struct latch_tree_root {
|
||||||
seqcount_t seq;
|
seqcount_latch_t seq;
|
||||||
struct rb_root tree[2];
|
struct rb_root tree[2];
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -206,7 +206,7 @@ latch_tree_find(void *key, struct latch_tree_root *root,
|
|||||||
do {
|
do {
|
||||||
seq = raw_read_seqcount_latch(&root->seq);
|
seq = raw_read_seqcount_latch(&root->seq);
|
||||||
node = __lt_find(key, root, seq & 1, ops->comp);
|
node = __lt_find(key, root, seq & 1, ops->comp);
|
||||||
} while (read_seqcount_retry(&root->seq, seq));
|
} while (read_seqcount_latch_retry(&root->seq, seq));
|
||||||
|
|
||||||
return node;
|
return node;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user