Skip to content

Commit 2b9530d

Browse files
authored
Merge pull request #400 from wedsonaf/rbtree
Add red-black tree implementation backed by the C version.
2 parents 4f90536 + 3444d9b commit 2b9530d

File tree

3 files changed

+573
-0
lines changed

3 files changed

+573
-0
lines changed

rust/helpers.c

+7
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,13 @@ bool rust_helper_refcount_dec_and_test(refcount_t *r)
164164
}
165165
EXPORT_SYMBOL_GPL(rust_helper_refcount_dec_and_test);
166166

167+
void rust_helper_rb_link_node(struct rb_node *node, struct rb_node *parent,
168+
struct rb_node **rb_link)
169+
{
170+
rb_link_node(node, parent, rb_link);
171+
}
172+
EXPORT_SYMBOL_GPL(rust_helper_rb_link_node);
173+
167174
/* We use bindgen's --size_t-is-usize option to bind the C size_t type
168175
* as the Rust usize type, so we can use it in contexts where Rust
169176
* expects a usize like slice (array) indices. usize is defined to be

rust/kernel/lib.rs

+1
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ pub mod traits;
5555

5656
pub mod linked_list;
5757
mod raw_list;
58+
pub mod rbtree;
5859

5960
#[doc(hidden)]
6061
pub mod module_param;

0 commit comments

Comments
 (0)