X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=urcu%2Frcuja.h;h=eb384941d6a7cde6d38c530a24702a505873ec9e;hb=36305a3db8c572e25a6335c9384a5112bdfd8148;hp=421e8388eb563112c894d6897b6e990d1e772911;hpb=dc0e9798320a244262c504c47f34af058bc1ebb3;p=urcu.git diff --git a/urcu/rcuja.h b/urcu/rcuja.h index 421e838..eb38494 100644 --- a/urcu/rcuja.h +++ b/urcu/rcuja.h @@ -71,17 +71,32 @@ void cds_ja_node_init(struct cds_ja_node *node) struct cds_ja_node *cds_ja_lookup(struct cds_ja *ja, uint64_t key); /* - * cds_ja_lookup_lower_equal - look up first node with key <= @key. + * cds_ja_lookup_below_equal - look up first node with key <= @key. * @ja: the Judy array. * @key: key to look up. + * @result_key: key found. * * Returns the first node of a duplicate chain if a node is present in - * the tree which has a key lower or equal to @key, else returns NULL. + * the tree which has a key below or equal to @key, else returns NULL. * A RCU read-side lock should be held across call to this function and * use of its return value. */ -struct cds_ja_node *cds_ja_lookup_lower_equal(struct cds_ja *ja, - uint64_t key); +struct cds_ja_node *cds_ja_lookup_below_equal(struct cds_ja *ja, + uint64_t key, uint64_t *result_key); + +/* + * cds_ja_lookup_above_equal - look up first node with key >= @key. + * @ja: the Judy array. + * @key: key to look up. + * @result_key: key found. + * + * Returns the first node of a duplicate chain if a node is present in + * the tree which has a key above or equal to @key, else returns NULL. + * A RCU read-side lock should be held across call to this function and + * use of its return value. + */ +struct cds_ja_node *cds_ja_lookup_above_equal(struct cds_ja *ja, + uint64_t key, uint64_t *result_key); /* * cds_ja_add - Add @node at @key, allowing duplicates. @@ -147,6 +162,8 @@ struct cds_ja *cds_ja_new(unsigned int key_bits) * on the Judy array while it is being destroyed (ensured by the caller). * There is no need for the @rcu_free_node_cb callback to wait for grace * periods, since there are no more concurrent users of the Judy array. + * RCU read-side lock should _not_ be held when calling this function, + * however, QSBR threads need to be online. */ int cds_ja_destroy(struct cds_ja *ja, void (*free_node_cb)(struct cds_ja_node *node));