Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F159332098
D56577.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
874 B
Referenced Files
None
Subscribers
None
D56577.diff
View Options
diff --git a/sys/compat/linuxkpi/common/include/linux/rbtree.h b/sys/compat/linuxkpi/common/include/linux/rbtree.h
--- a/sys/compat/linuxkpi/common/include/linux/rbtree.h
+++ b/sys/compat/linuxkpi/common/include/linux/rbtree.h
@@ -199,6 +199,26 @@
return (leftmost ? node : NULL);
}
+static inline void
+rb_add(struct rb_node *node, struct rb_root *tree,
+ bool (*less)(struct rb_node *, const struct rb_node *))
+{
+ struct rb_node **link = &tree->rb_node;
+ struct rb_node *parent = NULL;
+
+ while (*link != NULL) {
+ parent = *link;
+ if (less(node, parent)) {
+ link = &RB_LEFT(parent, __entry);
+ } else {
+ link = &RB_RIGHT(parent, __entry);
+ }
+ }
+
+ rb_link_node(node, parent, link);
+ rb_insert_color(node, tree);
+}
+
#undef RB_ROOT
#define RB_ROOT (struct rb_root) { NULL }
#define RB_ROOT_CACHED (struct rb_root_cached) { RB_ROOT, NULL }
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Jun 13, 10:50 PM (15 h, 59 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
32019811
Default Alt Text
D56577.diff (874 B)
Attached To
Mode
D56577: linuxkpi: Add `rb_add()`
Attached
Detach File
Event Timeline
Log In to Comment