mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-28 09:31:14 +00:00
rbtree: Add support for augmented rbtrees
Add support for augmented rbtrees in core rbtree code. This will be used in subsequent patches, in x86 PAT code, which needs interval trees to efficiently keep track of PAT ranges. Signed-off-by: Venkatesh Pallipadi <venkatesh.pallipadi@intel.com> LKML-Reference: <20100210232343.GA11465@linux-os.sc.intel.com> Signed-off-by: Suresh Siddha <suresh.b.siddha@intel.com> Signed-off-by: H. Peter Anvin <hpa@zytor.com>
This commit is contained in:
parent
724e6d3fe8
commit
17d9ddc72f
3 changed files with 106 additions and 5 deletions
|
@ -110,6 +110,7 @@ struct rb_node
|
|||
struct rb_root
|
||||
{
|
||||
struct rb_node *rb_node;
|
||||
void (*augment_cb)(struct rb_node *node);
|
||||
};
|
||||
|
||||
|
||||
|
@ -129,7 +130,9 @@ static inline void rb_set_color(struct rb_node *rb, int color)
|
|||
rb->rb_parent_color = (rb->rb_parent_color & ~1) | color;
|
||||
}
|
||||
|
||||
#define RB_ROOT (struct rb_root) { NULL, }
|
||||
#define RB_ROOT (struct rb_root) { NULL, NULL, }
|
||||
#define RB_AUGMENT_ROOT(x) (struct rb_root) { NULL, x}
|
||||
|
||||
#define rb_entry(ptr, type, member) container_of(ptr, type, member)
|
||||
|
||||
#define RB_EMPTY_ROOT(root) ((root)->rb_node == NULL)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue