rcuja API: remove dependency on hlist
[userspace-rcu.git] / rcuja / rcuja-internal.h
index 9b1daca61cb7541009f8db64b9014215a5ff1fe4..1a3346bbbe96aa4b0ae44896bf51ad476404481f 100644 (file)
@@ -190,6 +190,22 @@ int rcuja_delete_ht(struct cds_lfht *ht);
 __attribute__((visibility("protected")))
 void free_cds_ja_node(struct cds_ja *ja, struct cds_ja_inode *node);
 
+/*
+ * Iterate through duplicates returned by cds_ja_lookup*()
+ * Receives a struct cds_ja_node * as parameter, which is used as start
+ * of duplicate list and loop cursor.
+ */
+#define cds_ja_for_each_duplicate(pos)                                 \
+       for (; (pos) != NULL; (pos) = (pos)->next)
+
+/*
+ * Iterate through duplicates returned by cds_ja_lookup*()
+ * Safe against removal of entries during traversal.
+ */
+#define cds_ja_for_each_duplicate_safe(_pos, _next)                    \
+       for (; (_pos) != NULL ? ((_next) = (_pos)->next, 1) : 0;        \
+               (_pos) = (_next))
+
 //#define DEBUG
 
 #ifdef __linux__
This page took 0.023352 seconds and 4 git commands to generate.