[tip: locking/core] rust: revocable: Use safe synchronize_rcu() abstraction
From: tip-bot2 for Philipp Stanner
Date: Fri Aug 07 2026 - 12:38:15 EST
The following commit has been merged into the locking/core branch of tip:
Commit-ID: 042278f5fa9e681420ab486d6cbf464e26667461
Gitweb: https://git.kernel.org/tip/042278f5fa9e681420ab486d6cbf464e26667461
Author: Philipp Stanner <phasta@xxxxxxxxxx>
AuthorDate: Wed, 24 Jun 2026 17:07:03 +02:00
Committer: Boqun Feng <boqun@xxxxxxxxxx>
CommitterDate: Tue, 04 Aug 2026 05:52:53 -07:00
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@xxxxxxxxxx>
Reviewed-by: Onur Özkan <work@xxxxxxxxxxxxx>
Reviewed-by: Danilo Krummrich <dakr@xxxxxxxxxx>
Reviewed-by: Gary Guo <gary@xxxxxxxxxxx>
Signed-off-by: Boqun Feng <boqun@xxxxxxxxxx>
Link: https://patch.msgid.link/20260624150704.1504001-4-phasta@xxxxxxxxxx
---
rust/kernel/revocable.rs | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/rust/kernel/revocable.rs b/rust/kernel/revocable.rs
index 0f4ae67..f539603 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