Lines Matching defs:key
144 * comp(a->key,b) < 0 := less(a,b)
145 * comp(a->key,b) > 0 := less(b,a)
146 * comp(a->key,b) == 0 := !less(a,b) && !less(b,a)
149 * guarantee on which of the elements matching the key is found. See
248 * rb_find() - find @key in tree @tree
249 * @key: key to match
253 * Returns the rb_node matching @key or NULL.
256 rb_find(const void *key, const struct rb_root *tree,
257 int (*cmp)(const void *key, const struct rb_node *))
262 int c = cmp(key, node);
276 * rb_find_first() - find the first @key in @tree
277 * @key: key to match
281 * Returns the leftmost node matching @key, or NULL.
284 rb_find_first(const void *key, const struct rb_root *tree,
285 int (*cmp)(const void *key, const struct rb_node *))
291 int c = cmp(key, node);
306 * rb_next_match() - find the next @key in @tree
307 * @key: key to match
311 * Returns the next node matching @key, or NULL.
314 rb_next_match(const void *key, struct rb_node *node,
315 int (*cmp)(const void *key, const struct rb_node *))
318 if (node && cmp(key, node))
324 * rb_for_each() - iterates a subtree matching @key
326 * @key: key to match
330 #define rb_for_each(node, key, tree, cmp) \
331 for ((node) = rb_find_first((key), (tree), (cmp)); \
332 (node); (node) = rb_next_match((key), (node), (cmp)))