aboutsummaryrefslogtreecommitdiff
path: root/rust/kernel
diff options
context:
space:
mode:
authorPhilipp Stanner <phasta@kernel.org>2026-06-24 17:07:03 +0200
committerBoqun Feng <boqun@kernel.org>2026-08-04 05:52:53 -0700
commit042278f5fa9e681420ab486d6cbf464e26667461 (patch)
tree3a03478882ed23323092cf520c05946ddc125668 /rust/kernel
parent1fb92e0625596985b3941925afe7906fef41214b (diff)
rust: revocable: Use safe synchronize_rcu() abstraction
We now have a safe wrapper for the foreign function synchronize_rcu(). Use it in revocable.rs. Signed-off-by: Philipp Stanner <phasta@kernel.org> Reviewed-by: Onur Özkan <work@onurozkan.dev> Reviewed-by: Danilo Krummrich <dakr@kernel.org> Reviewed-by: Gary Guo <gary@garyguo.net> Signed-off-by: Boqun Feng <boqun@kernel.org> Link: https://patch.msgid.link/20260624150704.1504001-4-phasta@kernel.org
Diffstat (limited to 'rust/kernel')
-rw-r--r--rust/kernel/revocable.rs9
1 files changed, 6 insertions, 3 deletions
diff --git a/rust/kernel/revocable.rs b/rust/kernel/revocable.rs
index 0f4ae673256d..f539603349f1 100644
--- a/rust/kernel/revocable.rs
+++ b/rust/kernel/revocable.rs
@@ -7,7 +7,11 @@
use pin_init::Wrapper;
-use crate::{bindings, prelude::*, sync::rcu, types::Opaque};
+use crate::{
+ prelude::*,
+ sync::rcu,
+ types::Opaque, //
+};
use core::{
marker::PhantomData,
ops::Deref,
@@ -161,8 +165,7 @@ impl<T> Revocable<T> {
if revoke {
if SYNC {
- // SAFETY: Just an FFI call, there are no further requirements.
- unsafe { bindings::synchronize_rcu() };
+ rcu::synchronize_rcu();
}
// SAFETY: We know `self.data` is valid because only one CPU can succeed the