Michel Lespinasse | fff3fd8 | 2012-10-08 16:31:23 -0700 | [diff] [blame] | 1 | #ifndef _LINUX_INTERVAL_TREE_H |
| 2 | #define _LINUX_INTERVAL_TREE_H |
| 3 | |
| 4 | #include <linux/rbtree.h> |
| 5 | |
| 6 | struct interval_tree_node { |
| 7 | struct rb_node rb; |
| 8 | unsigned long start; /* Start of interval */ |
| 9 | unsigned long last; /* Last location _in_ interval */ |
| 10 | unsigned long __subtree_last; |
| 11 | }; |
| 12 | |
| 13 | extern void |
Davidlohr Bueso | f808c13 | 2017-09-08 16:15:08 -0700 | [diff] [blame^] | 14 | interval_tree_insert(struct interval_tree_node *node, |
| 15 | struct rb_root_cached *root); |
Michel Lespinasse | fff3fd8 | 2012-10-08 16:31:23 -0700 | [diff] [blame] | 16 | |
| 17 | extern void |
Davidlohr Bueso | f808c13 | 2017-09-08 16:15:08 -0700 | [diff] [blame^] | 18 | interval_tree_remove(struct interval_tree_node *node, |
| 19 | struct rb_root_cached *root); |
Michel Lespinasse | fff3fd8 | 2012-10-08 16:31:23 -0700 | [diff] [blame] | 20 | |
| 21 | extern struct interval_tree_node * |
Davidlohr Bueso | f808c13 | 2017-09-08 16:15:08 -0700 | [diff] [blame^] | 22 | interval_tree_iter_first(struct rb_root_cached *root, |
Michel Lespinasse | fff3fd8 | 2012-10-08 16:31:23 -0700 | [diff] [blame] | 23 | unsigned long start, unsigned long last); |
| 24 | |
| 25 | extern struct interval_tree_node * |
| 26 | interval_tree_iter_next(struct interval_tree_node *node, |
| 27 | unsigned long start, unsigned long last); |
| 28 | |
| 29 | #endif /* _LINUX_INTERVAL_TREE_H */ |