[tip: locking/core] rust: sync: Use safe synchronize_rcu() abstraction in poll

"tip-bot2 for Philipp Stanner" <[email protected]>
Newsgroups gmane.linux.kernel
Message-ID <178611874297.708.6753410342751159277.tip-bot2@tip-bot2>
The following commit has been merged into the locking/core branch of tip:

Commit-ID:     47c3367ff096e66f614ed3cdadece26ffc04b5e8
Gitweb:        https://git.kernel.org/tip/47c3367ff096e66f614ed3cdadece26ffc04b5e8
Author:        Philipp Stanner <[email protected]>
AuthorDate:    Wed, 24 Jun 2026 17:07:04 +02:00
Committer:     Boqun Feng <[email protected]>
CommitterDate: Tue, 04 Aug 2026 05:52:54 -07: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 <[email protected]>
Reviewed-by: Alice Ryhl <[email protected]>
Reviewed-by: Onur Özkan <[email protected]>
Reviewed-by: Danilo Krummrich <[email protected]>
Reviewed-by: Gary Guo <[email protected]>
Signed-off-by: Boqun Feng <[email protected]>
Link: https://patch.msgid.link/[email protected]
---
 rust/kernel/sync/poll.rs | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/rust/kernel/sync/poll.rs b/rust/kernel/sync/poll.rs
index 0ec985d..5aa0ce9 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();
     }
 }
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.