Skip to content

Commit

Permalink
Merge pull request torvalds#400 from wedsonaf/rbtree
Browse files Browse the repository at this point in the history
Add red-black tree implementation backed by the C version.
  • Loading branch information
ojeda authored Jun 30, 2021
2 parents 4f90536 + 3444d9b commit 2b9530d
Show file tree
Hide file tree
Showing 3 changed files with 573 additions and 0 deletions.
7 changes: 7 additions & 0 deletions rust/helpers.c
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,13 @@ bool rust_helper_refcount_dec_and_test(refcount_t *r)
}
EXPORT_SYMBOL_GPL(rust_helper_refcount_dec_and_test);

void rust_helper_rb_link_node(struct rb_node *node, struct rb_node *parent,
struct rb_node **rb_link)
{
rb_link_node(node, parent, rb_link);
}
EXPORT_SYMBOL_GPL(rust_helper_rb_link_node);

/* We use bindgen's --size_t-is-usize option to bind the C size_t type
* as the Rust usize type, so we can use it in contexts where Rust
* expects a usize like slice (array) indices. usize is defined to be
Expand Down
1 change: 1 addition & 0 deletions rust/kernel/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ pub mod traits;

pub mod linked_list;
mod raw_list;
pub mod rbtree;

#[doc(hidden)]
pub mod module_param;
Expand Down
Loading

0 comments on commit 2b9530d

Please sign in to comment.