Lines Matching defs:key
159 * comp(a->key,b) < 0 := less(a,b)
160 * comp(a->key,b) > 0 := less(b,a)
161 * comp(a->key,b) == 0 := !less(a,b) && !less(b,a)
164 * guarantee on which of the elements matching the key is found. See
259 * rb_find() - find @key in tree @tree
260 * @key: key to match
264 * Returns the rb_node matching @key or NULL.
267 rb_find(const void *key, const struct rb_root *tree,
268 int (*cmp)(const void *key, const struct rb_node *))
273 int c = cmp(key, node);
287 * rb_find_first() - find the first @key in @tree
288 * @key: key to match
292 * Returns the leftmost node matching @key, or NULL.
295 rb_find_first(const void *key, const struct rb_root *tree,
296 int (*cmp)(const void *key, const struct rb_node *))
302 int c = cmp(key, node);
317 * rb_next_match() - find the next @key in @tree
318 * @key: key to match
322 * Returns the next node matching @key, or NULL.
325 rb_next_match(const void *key, struct rb_node *node,
326 int (*cmp)(const void *key, const struct rb_node *))
329 if (node && cmp(key, node))
335 * rb_for_each() - iterates a subtree matching @key
337 * @key: key to match
341 #define rb_for_each(node, key, tree, cmp) \
342 for ((node) = rb_find_first((key), (tree), (cmp)); \
343 (node); (node) = rb_next_match((key), (node), (cmp)))