Fix: pass private data to context callbacks
[lttng-ust.git] / liblttng-ust / rculfhash.h
index 39f8e5a3442545b98cafac4d910f5d42d5415e65..9f5016a05ea7c305c39bf1e0b56d6158e241695c 100644 (file)
@@ -13,7 +13,6 @@
 #include <stdint.h>
 #include <pthread.h>
 #include <urcu/compiler.h>
-#include "ust-helper.h"
 
 #ifdef __cplusplus
 extern "C" {
@@ -76,7 +75,7 @@ typedef int (*lttng_ust_lfht_match_fct)(struct lttng_ust_lfht_node *node, const
  * (detection of memory corruption).
  */
 static inline
-void lttng_ust_lfht_node_init(struct lttng_ust_lfht_node *node)
+void lttng_ust_lfht_node_init(struct lttng_ust_lfht_node *node __attribute__((unused)))
 {
 }
 
@@ -97,12 +96,14 @@ struct lttng_ust_lfht_mm_type {
                        unsigned long index);
 };
 
-LTTNG_HIDDEN
-extern const struct lttng_ust_lfht_mm_type lttng_ust_lfht_mm_order;
-LTTNG_HIDDEN
-extern const struct lttng_ust_lfht_mm_type lttng_ust_lfht_mm_chunk;
-LTTNG_HIDDEN
-extern const struct lttng_ust_lfht_mm_type lttng_ust_lfht_mm_mmap;
+extern const struct lttng_ust_lfht_mm_type lttng_ust_lfht_mm_order
+       __attribute__((visibility("hidden")));
+
+extern const struct lttng_ust_lfht_mm_type lttng_ust_lfht_mm_chunk
+       __attribute__((visibility("hidden")));
+
+extern const struct lttng_ust_lfht_mm_type lttng_ust_lfht_mm_mmap
+       __attribute__((visibility("hidden")));
 
 /*
  * lttng_ust_lfht_new - allocate a hash table.
@@ -121,12 +122,12 @@ extern const struct lttng_ust_lfht_mm_type lttng_ust_lfht_mm_mmap;
  * Return NULL on error.
  * Note: the RCU flavor must be already included before the hash table header.
  */
-LTTNG_HIDDEN
 extern struct lttng_ust_lfht *lttng_ust_lfht_new(unsigned long init_size,
                        unsigned long min_nr_alloc_buckets,
                        unsigned long max_nr_buckets,
                        int flags,
-                       const struct lttng_ust_lfht_mm_type *mm);
+                       const struct lttng_ust_lfht_mm_type *mm)
+       __attribute__((visibility("hidden")));
 
 /*
  * lttng_ust_lfht_destroy - destroy a hash table.
@@ -145,8 +146,8 @@ extern struct lttng_ust_lfht *lttng_ust_lfht_new(unsigned long init_size,
  * thread to handle resize operations, which removes RCU requirements on
  * lttng_ust_lfht_destroy.
  */
-LTTNG_HIDDEN
-extern int lttng_ust_lfht_destroy(struct lttng_ust_lfht *ht);
+extern int lttng_ust_lfht_destroy(struct lttng_ust_lfht *ht)
+       __attribute__((visibility("hidden")));
 
 /*
  * lttng_ust_lfht_count_nodes - count the number of nodes in the hash table.
@@ -158,11 +159,11 @@ extern int lttng_ust_lfht_destroy(struct lttng_ust_lfht *ht);
  * Call with rcu_read_lock held.
  * Threads calling this API need to be registered RCU read-side threads.
  */
-LTTNG_HIDDEN
 extern void lttng_ust_lfht_count_nodes(struct lttng_ust_lfht *ht,
                long *split_count_before,
                unsigned long *count,
-               long *split_count_after);
+               long *split_count_after)
+       __attribute__((visibility("hidden")));
 
 /*
  * lttng_ust_lfht_lookup - lookup a node by key.
@@ -176,10 +177,10 @@ extern void lttng_ust_lfht_count_nodes(struct lttng_ust_lfht *ht,
  * Threads calling this API need to be registered RCU read-side threads.
  * This function acts as a rcu_dereference() to read the node pointer.
  */
-LTTNG_HIDDEN
 extern void lttng_ust_lfht_lookup(struct lttng_ust_lfht *ht, unsigned long hash,
                lttng_ust_lfht_match_fct match, const void *key,
-               struct lttng_ust_lfht_iter *iter);
+               struct lttng_ust_lfht_iter *iter)
+       __attribute__((visibility("hidden")));
 
 /*
  * lttng_ust_lfht_next_duplicate - get the next item with same key, after iterator.
@@ -201,10 +202,10 @@ extern void lttng_ust_lfht_lookup(struct lttng_ust_lfht *ht, unsigned long hash,
  * Threads calling this API need to be registered RCU read-side threads.
  * This function acts as a rcu_dereference() to read the node pointer.
  */
-LTTNG_HIDDEN
 extern void lttng_ust_lfht_next_duplicate(struct lttng_ust_lfht *ht,
                lttng_ust_lfht_match_fct match, const void *key,
-               struct lttng_ust_lfht_iter *iter);
+               struct lttng_ust_lfht_iter *iter)
+       __attribute__((visibility("hidden")));
 
 /*
  * lttng_ust_lfht_first - get the first node in the table.
@@ -216,8 +217,8 @@ extern void lttng_ust_lfht_next_duplicate(struct lttng_ust_lfht *ht,
  * Threads calling this API need to be registered RCU read-side threads.
  * This function acts as a rcu_dereference() to read the node pointer.
  */
-LTTNG_HIDDEN
-extern void lttng_ust_lfht_first(struct lttng_ust_lfht *ht, struct lttng_ust_lfht_iter *iter);
+extern void lttng_ust_lfht_first(struct lttng_ust_lfht *ht, struct lttng_ust_lfht_iter *iter)
+       __attribute__((visibility("hidden")));
 
 /*
  * lttng_ust_lfht_next - get the next node in the table.
@@ -231,8 +232,8 @@ extern void lttng_ust_lfht_first(struct lttng_ust_lfht *ht, struct lttng_ust_lfh
  * Threads calling this API need to be registered RCU read-side threads.
  * This function acts as a rcu_dereference() to read the node pointer.
  */
-LTTNG_HIDDEN
-extern void lttng_ust_lfht_next(struct lttng_ust_lfht *ht, struct lttng_ust_lfht_iter *iter);
+extern void lttng_ust_lfht_next(struct lttng_ust_lfht *ht, struct lttng_ust_lfht_iter *iter)
+       __attribute__((visibility("hidden")));
 
 /*
  * lttng_ust_lfht_add - add a node to the hash table.
@@ -246,9 +247,9 @@ extern void lttng_ust_lfht_next(struct lttng_ust_lfht *ht, struct lttng_ust_lfht
  * This function issues a full memory barrier before and after its
  * atomic commit.
  */
-LTTNG_HIDDEN
 extern void lttng_ust_lfht_add(struct lttng_ust_lfht *ht, unsigned long hash,
-               struct lttng_ust_lfht_node *node);
+               struct lttng_ust_lfht_node *node)
+       __attribute__((visibility("hidden")));
 
 /*
  * lttng_ust_lfht_add_unique - add a node to hash table, if key is not present.
@@ -277,12 +278,12 @@ extern void lttng_ust_lfht_add(struct lttng_ust_lfht *ht, unsigned long hash,
  * node pointer. The failure case does not guarantee any other memory
  * barrier.
  */
-LTTNG_HIDDEN
 extern struct lttng_ust_lfht_node *lttng_ust_lfht_add_unique(struct lttng_ust_lfht *ht,
                unsigned long hash,
                lttng_ust_lfht_match_fct match,
                const void *key,
-               struct lttng_ust_lfht_node *node);
+               struct lttng_ust_lfht_node *node)
+       __attribute__((visibility("hidden")));
 
 /*
  * lttng_ust_lfht_add_replace - replace or add a node within hash table.
@@ -314,12 +315,12 @@ extern struct lttng_ust_lfht_node *lttng_ust_lfht_add_unique(struct lttng_ust_lf
  * This function issues a full memory barrier before and after its
  * atomic commit.
  */
-LTTNG_HIDDEN
 extern struct lttng_ust_lfht_node *lttng_ust_lfht_add_replace(struct lttng_ust_lfht *ht,
                unsigned long hash,
                lttng_ust_lfht_match_fct match,
                const void *key,
-               struct lttng_ust_lfht_node *node);
+               struct lttng_ust_lfht_node *node)
+       __attribute__((visibility("hidden")));
 
 /*
  * lttng_ust_lfht_replace - replace a node pointed to by iter within hash table.
@@ -350,13 +351,13 @@ extern struct lttng_ust_lfht_node *lttng_ust_lfht_add_replace(struct lttng_ust_l
  * after its atomic commit. Upon failure, this function does not issue
  * any memory barrier.
  */
-LTTNG_HIDDEN
 extern int lttng_ust_lfht_replace(struct lttng_ust_lfht *ht,
                struct lttng_ust_lfht_iter *old_iter,
                unsigned long hash,
                lttng_ust_lfht_match_fct match,
                const void *key,
-               struct lttng_ust_lfht_node *new_node);
+               struct lttng_ust_lfht_node *new_node)
+       __attribute__((visibility("hidden")));
 
 /*
  * lttng_ust_lfht_del - remove node pointed to by iterator from hash table.
@@ -379,8 +380,8 @@ extern int lttng_ust_lfht_replace(struct lttng_ust_lfht *ht,
  * after its atomic commit. Upon failure, this function does not issue
  * any memory barrier.
  */
-LTTNG_HIDDEN
-extern int lttng_ust_lfht_del(struct lttng_ust_lfht *ht, struct lttng_ust_lfht_node *node);
+extern int lttng_ust_lfht_del(struct lttng_ust_lfht *ht, struct lttng_ust_lfht_node *node)
+       __attribute__((visibility("hidden")));
 
 /*
  * lttng_ust_lfht_is_node_deleted - query whether a node is removed from hash table.
@@ -395,8 +396,8 @@ extern int lttng_ust_lfht_del(struct lttng_ust_lfht *ht, struct lttng_ust_lfht_n
  * Threads calling this API need to be registered RCU read-side threads.
  * This function does not issue any memory barrier.
  */
-LTTNG_HIDDEN
-extern int lttng_ust_lfht_is_node_deleted(const struct lttng_ust_lfht_node *node);
+extern int lttng_ust_lfht_is_node_deleted(const struct lttng_ust_lfht_node *node)
+       __attribute__((visibility("hidden")));
 
 /*
  * lttng_ust_lfht_resize - Force a hash table resize
@@ -408,8 +409,8 @@ extern int lttng_ust_lfht_is_node_deleted(const struct lttng_ust_lfht_node *node
  * lttng_ust_lfht_resize should *not* be called from a RCU read-side critical
  * section.
  */
-LTTNG_HIDDEN
-extern void lttng_ust_lfht_resize(struct lttng_ust_lfht *ht, unsigned long new_size);
+extern void lttng_ust_lfht_resize(struct lttng_ust_lfht *ht, unsigned long new_size)
+       __attribute__((visibility("hidden")));
 
 /*
  * Note: it is safe to perform element removal (del), replacement, or
This page took 0.025522 seconds and 4 git commands to generate.