rcuja: add shadow nodes hash table
[userspace-rcu.git] / rcuja / rcuja.c
index e94031d9737f27731a9051a2f74ca1de93f24ce7..4b90aa62b7ffb56f5e7659c21df4b4bdc234d643 100644 (file)
@@ -20,6 +20,7 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
+#define _LGPL_SOURCE
 #include <stdint.h>
 #include <errno.h>
 #include <limits.h>
@@ -183,9 +184,6 @@ void static_array_size_check(void)
        CAA_BUILD_BUG_ON(CAA_ARRAY_SIZE(ja_types) > JA_TYPE_MAX_NR);
 }
 
-/* Never declared. Opaque type used to store flagged node pointers. */
-struct rcu_ja_node_flag;
-
 /*
  * The rcu_ja_node contains the compressed node data needed for
  * read-side. For linear and pool node configurations, it starts with a
@@ -512,6 +510,9 @@ int ja_node_recompact_add(struct rcu_ja_node_flag **old_node_flag, uint8_t n,
        /* add node */
        ret = _ja_node_set_nth(new_node_flag, n, child_node_flag);
        assert(!ret);
+       /* Replace the old node with the new recompacted one */
+       rcu_assign_pointer(*old_node_flag, new_node_flag);
+       /* TODO: free old_node (call_rcu) */
        return 0;
 }
 
This page took 0.023226 seconds and 4 git commands to generate.