mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-08-30 23:59:33 -04:00
rust: helpers: add SRCU helpers
Add helper wrappers for SRCU functions that are exposed to Rust through generated bindings. Signed-off-by: Onur Özkan <work@onurozkan.dev> Reviewed-by: Gary Guo <gary@garyguo.net> Reviewed-by: Alice Ryhl <aliceryhl@google.com> Reviewed-by: Boqun Feng <boqun@kernel.org> Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
This commit is contained in:
committed by
Paul E. McKenney
parent
a47dea1baa
commit
8f63d947be
@@ -91,6 +91,7 @@
|
||||
#include "slab.c"
|
||||
#include "spinlock.c"
|
||||
#include "string.c"
|
||||
#include "srcu.c"
|
||||
#include "sync.c"
|
||||
#include "task.c"
|
||||
#include "time.c"
|
||||
|
||||
30
rust/helpers/srcu.c
Normal file
30
rust/helpers/srcu.c
Normal file
@@ -0,0 +1,30 @@
|
||||
// SPDX-License-Identifier: GPL-2.0
|
||||
|
||||
#include <linux/srcu.h>
|
||||
|
||||
__rust_helper int rust_helper_init_srcu_struct_with_key(struct srcu_struct *ssp,
|
||||
const char *name,
|
||||
struct lock_class_key *key)
|
||||
{
|
||||
return __init_srcu_struct(ssp, name, key);
|
||||
}
|
||||
|
||||
__rust_helper int rust_helper_srcu_read_lock(struct srcu_struct *ssp)
|
||||
{
|
||||
return srcu_read_lock(ssp);
|
||||
}
|
||||
|
||||
__rust_helper void rust_helper_srcu_read_unlock(struct srcu_struct *ssp, int idx)
|
||||
{
|
||||
srcu_read_unlock(ssp, idx);
|
||||
}
|
||||
|
||||
__rust_helper void rust_helper_srcu_barrier(struct srcu_struct *ssp)
|
||||
{
|
||||
srcu_barrier(ssp);
|
||||
}
|
||||
|
||||
__rust_helper void rust_helper_synchronize_srcu_expedited(struct srcu_struct *ssp)
|
||||
{
|
||||
synchronize_srcu_expedited(ssp);
|
||||
}
|
||||
Reference in New Issue
Block a user