Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

rust: workqueue: add delayed work support for ARef<T>

The preceding patches added support for ARef<T> work items. By the same
token, add support for delayed work items too.

The rationale is the same: it may be convenient or even necessary at times
to implement HasDelayedWork directly on ARef<T>. A follow up patch will
also implement support for drm::Device as the first user.

Reviewed-by: Alice Ryhl <aliceryhl@google.com>
Acked-by: Danilo Krummrich <dakr@kernel.org>
Signed-off-by: Daniel Almeida <daniel.almeida@collabora.com>
Link: https://lore.kernel.org/r/20260323-aref-workitem-v3-3-f59729b812aa@collabora.com
Signed-off-by: Alice Ryhl <aliceryhl@google.com>

authored by

Daniel Almeida and committed by
Alice Ryhl
33266648 72a723df

+11
+11
rust/kernel/workqueue.rs
··· 1007 1007 } 1008 1008 } 1009 1009 1010 + // SAFETY: By the safety requirements of `HasDelayedWork`, the `work_struct` returned by methods in 1011 + // `HasWork` provides a `work_struct` that is the `work` field of a `delayed_work`, and the rest of 1012 + // the `delayed_work` has the same access rules as its `work` field. 1013 + unsafe impl<T, const ID: u64> RawDelayedWorkItem<ID> for ARef<T> 1014 + where 1015 + T: WorkItem<ID, Pointer = Self>, 1016 + T: HasDelayedWork<T, ID>, 1017 + T: AlwaysRefCounted, 1018 + { 1019 + } 1020 + 1010 1021 /// Returns the system work queue (`system_wq`). 1011 1022 /// 1012 1023 /// It is the one used by `schedule[_delayed]_work[_on]()`. Multi-CPU multi-threaded. There are