summaryrefslogtreecommitdiff
path: root/rust/kernel/time/hrtimer.rs
diff options
context:
space:
mode:
authorAndreas Hindborg <a.hindborg@kernel.org>2025-03-09 16:18:54 +0100
committerAndreas Hindborg <a.hindborg@kernel.org>2025-03-11 21:00:42 +0100
commitd7bf4786b5250b0e490a937d1f8a16ee3a54adbe (patch)
tree9114fadb30e3f333f257d7ef39a4fbf1ea8d1161 /rust/kernel/time/hrtimer.rs
parenta0c6fa8b8a59f8901e182fada6ac0e1f65beaa00 (diff)
rust: hrtimer: implement `HrTimerPointer` for `Arc`
Allow the use of intrusive `hrtimer` fields in structs that are managed by an `Arc` by implementing `HrTimerPointer` and `RawTimerCallbck` for `Arc`. Acked-by: Frederic Weisbecker <frederic@kernel.org> Acked-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Lyude Paul <lyude@redhat.com> Reviewed-by: Benno Lossin <benno.lossin@proton.me> Link: https://lore.kernel.org/r/20250309-hrtimer-v3-v6-12-rc2-v12-3-73586e2bd5f1@kernel.org Signed-off-by: Andreas Hindborg <a.hindborg@kernel.org>
Diffstat (limited to 'rust/kernel/time/hrtimer.rs')
-rw-r--r--rust/kernel/time/hrtimer.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/rust/kernel/time/hrtimer.rs b/rust/kernel/time/hrtimer.rs
index a3697622fa17..bfb536f2a490 100644
--- a/rust/kernel/time/hrtimer.rs
+++ b/rust/kernel/time/hrtimer.rs
@@ -150,7 +150,6 @@ impl<T> HrTimer<T> {
/// # Safety
///
/// `this` must point to a valid `Self`.
- #[allow(dead_code)]
pub(crate) unsafe fn raw_cancel(this: *const Self) -> bool {
// SAFETY: `this` points to an allocation of at least `HrTimer` size.
let c_timer_ptr = unsafe { HrTimer::raw_get(this) };
@@ -349,3 +348,6 @@ macro_rules! impl_has_hr_timer {
}
}
}
+
+mod arc;
+pub use arc::ArcHrTimerHandle;