Basic hashtable support for UST
[lttng-tools.git] / hashtable / rculfhash.h
index 860ef3d1c2d05e3516ec4a8849c9d47b39f1371f..0a739ee86f7d11b1e9caa4b8bbb9091dbc0ff1b9 100644 (file)
@@ -42,6 +42,11 @@ struct _cds_lfht_node {
        unsigned long reverse_hash;
 } __attribute__((aligned(4)));
 
+/*
+ * struct cds_lfht_node can be embedded into a structure (as a field).
+ * caa_container_of() can be used to get the structure from the struct
+ * cds_lfht_node after a lookup.
+ */
 struct cds_lfht_node {
        /* cache-hot for iteration */
        struct _cds_lfht_node p;          /* needs to be first field */
@@ -180,7 +185,7 @@ void cds_lfht_lookup(struct cds_lfht *ht, void *key, size_t key_len,
                struct cds_lfht_iter *iter);
 
 /*
- * cds_lfht_next - get the next item with same key (after a lookup).
+ * cds_lfht_next_duplicate - get the next item with same key (after a lookup).
  *
  * Uses an iterator initialized by a lookup.
  * Sets *iter-node to the following node with same key.
@@ -190,6 +195,23 @@ void cds_lfht_lookup(struct cds_lfht *ht, void *key, size_t key_len,
  * node returned by a previous cds_lfht_next.
  * Call with rcu_read_lock held.
  */
+void cds_lfht_next_duplicate(struct cds_lfht *ht, struct cds_lfht_iter *iter);
+
+/*
+ * cds_lfht_first - get the first node in the table.
+ *
+ * Output in "*iter". *iter->node set to NULL if table is empty.
+ * Call with rcu_read_lock held.
+ */
+void cds_lfht_first(struct cds_lfht *ht, struct cds_lfht_iter *iter);
+
+/*
+ * cds_lfht_next - get the next node in the table.
+ *
+ * Input/Output in "*iter". *iter->node set to NULL if *iter was
+ * pointing to the last table node.
+ * Call with rcu_read_lock held.
+ */
 void cds_lfht_next(struct cds_lfht *ht, struct cds_lfht_iter *iter);
 
 /*
This page took 0.023334 seconds and 4 git commands to generate.