mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-08-27 22:13:55 -04:00
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
This commit is contained in:
committed by
Boqun Feng
parent
042278f5fa
commit
47c3367ff0
@@ -8,7 +8,11 @@
|
||||
bindings,
|
||||
fs::File,
|
||||
prelude::*,
|
||||
sync::{CondVar, LockClassKey},
|
||||
sync::{
|
||||
rcu::synchronize_rcu,
|
||||
CondVar,
|
||||
LockClassKey, //
|
||||
}, //
|
||||
};
|
||||
use core::{marker::PhantomData, ops::Deref};
|
||||
|
||||
@@ -99,8 +103,6 @@ fn drop(self: Pin<&mut Self>) {
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user