summaryrefslogtreecommitdiff
path: root/rust/helpers/srcu.c
diff options
context:
space:
mode:
Diffstat (limited to 'rust/helpers/srcu.c')
-rw-r--r--rust/helpers/srcu.c35
1 files changed, 35 insertions, 0 deletions
diff --git a/rust/helpers/srcu.c b/rust/helpers/srcu.c
new file mode 100644
index 000000000000..1a2f563640e0
--- /dev/null
+++ b/rust/helpers/srcu.c
@@ -0,0 +1,35 @@
+// 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 bool rust_helper_srcu_readers_active(struct srcu_struct *ssp)
+{
+ return srcu_readers_active(ssp);
+}
+
+__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);
+}