Merge tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost
[cris-mirror.git] / include / linux / interval_tree.h
blob288c26f50732d7c2c9403765d7d8f3e79d20729b
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef _LINUX_INTERVAL_TREE_H
3 #define _LINUX_INTERVAL_TREE_H
5 #include <linux/rbtree.h>
7 struct interval_tree_node {
8 struct rb_node rb;
9 unsigned long start; /* Start of interval */
10 unsigned long last; /* Last location _in_ interval */
11 unsigned long __subtree_last;
14 extern void
15 interval_tree_insert(struct interval_tree_node *node,
16 struct rb_root_cached *root);
18 extern void
19 interval_tree_remove(struct interval_tree_node *node,
20 struct rb_root_cached *root);
22 extern struct interval_tree_node *
23 interval_tree_iter_first(struct rb_root_cached *root,
24 unsigned long start, unsigned long last);
26 extern struct interval_tree_node *
27 interval_tree_iter_next(struct interval_tree_node *node,
28 unsigned long start, unsigned long last);
30 #endif /* _LINUX_INTERVAL_TREE_H */