Changeset View
Changeset View
Standalone View
Standalone View
sys/compat/linuxkpi/common/include/linux/rbtree.h
Show All 35 Lines | |||||
#endif | #endif | ||||
#include <sys/types.h> | #include <sys/types.h> | ||||
#include <sys/tree.h> | #include <sys/tree.h> | ||||
struct rb_node { | struct rb_node { | ||||
RB_ENTRY(rb_node) __entry; | RB_ENTRY(rb_node) __entry; | ||||
}; | }; | ||||
#define rb_left __entry.rbe_left | #define rb_left __entry.rbe_link[_RB_L] | ||||
#define rb_right __entry.rbe_right | #define rb_right __entry.rbe_link[_RB_R] | ||||
/* | /* | ||||
* We provide a false structure that has the same bit pattern as tree.h | * We provide a false structure that has the same bit pattern as tree.h | ||||
* presents so it matches the member names expected by linux. | * presents so it matches the member names expected by linux. | ||||
*/ | */ | ||||
struct rb_root { | struct rb_root { | ||||
struct rb_node *rb_node; | struct rb_node *rb_node; | ||||
}; | }; | ||||
▲ Show 20 Lines • Show All 75 Lines • ▼ Show 20 Lines | |||||
static inline void | static inline void | ||||
rb_replace_node(struct rb_node *victim, struct rb_node *new, | rb_replace_node(struct rb_node *victim, struct rb_node *new, | ||||
struct rb_root *root) | struct rb_root *root) | ||||
{ | { | ||||
RB_SWAP_CHILD((struct linux_root *)root, rb_parent(victim), | RB_SWAP_CHILD((struct linux_root *)root, rb_parent(victim), | ||||
victim, new, __entry); | victim, new, __entry); | ||||
if (victim->rb_left) | if (RB_LEFT(victim, __entry)) | ||||
RB_SET_PARENT(victim->rb_left, new, __entry); | RB_SET_PARENT(RB_LEFT(victim, __entry), new, __entry); | ||||
if (victim->rb_right) | if (RB_RIGHT(victim, __entry)) | ||||
RB_SET_PARENT(victim->rb_right, new, __entry); | RB_SET_PARENT(RB_RIGHT(victim, __entry), new, __entry); | ||||
*new = *victim; | *new = *victim; | ||||
} | } | ||||
static inline void | static inline void | ||||
rb_insert_color_cached(struct rb_node *node, struct rb_root_cached *root, | rb_insert_color_cached(struct rb_node *node, struct rb_root_cached *root, | ||||
bool leftmost) | bool leftmost) | ||||
{ | { | ||||
linux_root_RB_INSERT_COLOR((struct linux_root *)&root->rb_root, node); | linux_root_RB_INSERT_COLOR((struct linux_root *)&root->rb_root, node); | ||||
Show All 31 Lines |