7 * Userspace RCU library - RCU Judy Array
9 * Copyright 2012 - Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
11 * This library is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU Lesser General Public
13 * License as published by the Free Software Foundation; either
14 * version 2.1 of the License, or (at your option) any later version.
16 * This library is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 * Lesser General Public License for more details.
21 * You should have received a copy of the GNU Lesser General Public
22 * License along with this library; if not, write to the Free Software
23 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
25 * Include this file _after_ including your URCU flavor.
29 #include <urcu/compiler.h>
30 #include <urcu-call-rcu.h>
31 #include <urcu-flavor.h>
33 #include <urcu/rcuhlist.h>
40 * Duplicate nodes with the same key are chained into a singly-linked
41 * list. The last item of this list has a NULL next pointer.
44 struct cds_ja_node
*next
;
50 * cds_ja_node_init - initialize a judy array node
51 * @node: the node to initialize.
53 * This function is kept to be eventually used for debugging purposes
54 * (detection of memory corruption).
57 void cds_ja_node_init(struct cds_ja_node
*node
)
61 struct cds_ja_node
*cds_ja_lookup(struct cds_ja
*ja
, uint64_t key
);
62 struct cds_ja_node
*cds_ja_lookup_lower_equal(struct cds_ja
*ja
,
65 int cds_ja_add(struct cds_ja
*ja
, uint64_t key
,
66 struct cds_ja_node
*new_node
);
68 struct cds_ja_node
*cds_ja_add_unique(struct cds_ja
*ja
, uint64_t key
,
69 struct cds_ja_node
*new_node
);
71 int cds_ja_del(struct cds_ja
*ja
, uint64_t key
,
72 struct cds_ja_node
*node
);
74 struct cds_ja
*_cds_ja_new(unsigned int key_bits
,
75 const struct rcu_flavor_struct
*flavor
);
78 struct cds_ja
*cds_ja_new(unsigned int key_bits
)
80 return _cds_ja_new(key_bits
, &rcu_flavor
);
83 int cds_ja_destroy(struct cds_ja
*ja
,
84 void (*rcu_free_node_cb
)(struct cds_ja_node
*node
));
87 * Iterate through duplicates returned by cds_ja_lookup*()
88 * This must be done while rcu_read_lock() is held.
89 * Receives a struct cds_ja_node * as parameter, which is used as start
90 * of duplicate list and loop cursor.
92 #define cds_ja_for_each_duplicate_rcu(pos) \
93 for (; (pos) != NULL; (pos) = rcu_dereference((pos)->next))
99 #endif /* _URCU_RCUJA_H */
This page took 0.030675 seconds and 4 git commands to generate.