summaryrefslogtreecommitdiff
path: root/include/linux/rbtree_latch.h
diff options
context:
space:
mode:
authorAhmed S. Darwish <a.darwish@linutronix.de>2020-08-27 14:40:43 +0300
committerPeter Zijlstra <peterz@infradead.org>2020-09-10 12:19:29 +0300
commit24bf401cebfd630cc9e2c3746e43945e836626f9 (patch)
tree4a2cd28e61390783176df3f11346a254c7e9bf2c /include/linux/rbtree_latch.h
parenta1f1066133d85d5f42217cc72a2490bb7aa889c5 (diff)
downloadlinux-24bf401cebfd630cc9e2c3746e43945e836626f9.tar.xz
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
Diffstat (limited to 'include/linux/rbtree_latch.h')
-rw-r--r--include/linux/rbtree_latch.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/include/linux/rbtree_latch.h b/include/linux/rbtree_latch.h
index 7d012faa509a..3d1a9e716b80 100644
--- a/include/linux/rbtree_latch.h
+++ b/include/linux/rbtree_latch.h
@@ -42,8 +42,8 @@ struct latch_tree_node {
};
struct latch_tree_root {
- seqcount_t seq;
- struct rb_root tree[2];
+ seqcount_latch_t seq;
+ struct rb_root tree[2];
};
/**
@@ -206,7 +206,7 @@ latch_tree_find(void *key, struct latch_tree_root *root,
do {
seq = raw_read_seqcount_latch(&root->seq);
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;
}