mirror of
https://github.com/clearlinux/kvmtool.git
synced 2026-08-21 21:07:20 +00:00
a83f8ed142
Since nothing depends on the max_high field values anymore, we can just remove the field and the code that was used to maintain it. Signed-off-by: Michel Lespinasse <walken@google.com> Signed-off-by: Pekka Enberg <penberg@kernel.org>
31 lines
789 B
C
31 lines
789 B
C
#ifndef KVM__INTERVAL_RBTREE_H
|
|
#define KVM__INTERVAL_RBTREE_H
|
|
|
|
#include <linux/rbtree.h>
|
|
#include <linux/types.h>
|
|
|
|
#define RB_INT_INIT(l, h) \
|
|
(struct rb_int_node){.low = l, .high = h}
|
|
#define rb_int(n) rb_entry(n, struct rb_int_node, node)
|
|
|
|
struct rb_int_node {
|
|
struct rb_node node;
|
|
u64 low;
|
|
u64 high;
|
|
};
|
|
|
|
/* Return the rb_int_node interval in which 'point' is located. */
|
|
struct rb_int_node *rb_int_search_single(struct rb_root *root, u64 point);
|
|
|
|
/* Return the rb_int_node in which start:len is located. */
|
|
struct rb_int_node *rb_int_search_range(struct rb_root *root, u64 low, u64 high);
|
|
|
|
int rb_int_insert(struct rb_root *root, struct rb_int_node *data);
|
|
|
|
static inline void rb_int_erase(struct rb_root *root, struct rb_int_node *node)
|
|
{
|
|
rb_erase(&node->node, root);
|
|
}
|
|
|
|
#endif
|