diff options
| author | Philipp Stanner <phasta@kernel.org> | 2026-06-24 17:07:04 +0200 |
|---|---|---|
| committer | Boqun Feng <boqun@kernel.org> | 2026-08-04 05:52:54 -0700 |
| commit | 47c3367ff096e66f614ed3cdadece26ffc04b5e8 (patch) | |
| tree | e54fb5eff65028b6c7303f5fb8213b050458a25e | |
| parent | 042278f5fa9e681420ab486d6cbf464e26667461 (diff) | |
rust: sync: Use safe synchronize_rcu() abstraction in poll
We now have a safe wrapper for the foreign function synchronize_rcu().
Use it in poll.rs.
Signed-off-by: Philipp Stanner <phasta@kernel.org>
Reviewed-by: Alice Ryhl <aliceryhl@google.com>
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-5-phasta@kernel.org
| -rw-r--r-- | rust/kernel/sync/poll.rs | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/rust/kernel/sync/poll.rs b/rust/kernel/sync/poll.rs index 0ec985d560c8..5aa0ce9ba01b 100644 --- a/rust/kernel/sync/poll.rs +++ b/rust/kernel/sync/poll.rs @@ -8,7 +8,11 @@ use crate::{ bindings, fs::File, prelude::*, - sync::{CondVar, LockClassKey}, + sync::{ + rcu::synchronize_rcu, + CondVar, + LockClassKey, // + }, // }; use core::{marker::PhantomData, ops::Deref}; @@ -99,8 +103,6 @@ impl PinnedDrop for PollCondVar { unsafe { bindings::__wake_up_pollfree(self.inner.wait_queue_head.get()) }; // Wait for epoll items to be properly removed. - // - // SAFETY: Just an FFI call. - unsafe { bindings::synchronize_rcu() }; + synchronize_rcu(); } } |
