rust: DmaFence: Implement Deref for FenceContext
Subsystems (4)
Philipp Stanner
maintainerPATCH 1/1 rust: DmaFence: Implement Deref for FenceContext
A FenceContext carries data, which the user should be able to access.
Implement Deref for FenceContext.
Signed-off-by Philipp Stanner <[email protected]>
--- rust/kernel/dma_buf/dma_fence.rs | 9 +++++++++ 1 file changed, 9 insertions(+)
rust/kernel/dma_buf/dma_fence.rs +9 -0
@@ -86,6 +86,15 @@ pub struct FenceContext<T: FenceContextOps + Send + Sync> { data: T, } +impl <T :Send +Sync +FenceContextOps >Deref for FenceContext <T > { +type Target =T ; + +#[inline] +fn deref (&self) -> &Self ::Target { + &self.data + } +} +impl <'a,T :Send +Sync +FenceContextOps >FenceContext <T > {// This can later be extended as a vtable in case other parties need support // for the more "exotic" callbacks.
base-commit: 3497a403264b094ebd61b8b755165d56e7d9dc37
Signature · 1 line
2.56.0
Quoted 6 lines · Philipp Stanner
A FenceContext carries data, which the user should be able to access.
Implement Deref for FenceContext.
Signed-off-by Philipp Stanner <[email protected]>
Reviewed-by Alice Ryhl <[email protected]>