From c1093b85890693fa2d372468f279854c3624d2b1 Mon Sep 17 00:00:00 2001 From: Alice Ryhl Date: Wed, 3 Dec 2025 14:48:08 +0000 Subject: [PATCH] rust: sync: add Arc::DATA_OFFSET This constant will be used to expose some offset constants from the Rust Binder driver to tracepoints which are implemented in C. The constant is usually equal to sizeof(refcount_t), but may be larger if T has a large alignment. Signed-off-by: Alice Ryhl Reviewed-by: Daniel Almeida Link: https://patch.msgid.link/20251203-binder-trace1-v1-1-22d3ffddb44e@google.com Signed-off-by: Greg Kroah-Hartman --- rust/kernel/sync/arc.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/rust/kernel/sync/arc.rs b/rust/kernel/sync/arc.rs index 289f77abf415..921e19333b89 100644 --- a/rust/kernel/sync/arc.rs +++ b/rust/kernel/sync/arc.rs @@ -240,6 +240,9 @@ impl Arc { // `Arc` object. Ok(unsafe { Self::from_inner(inner) }) } + + /// The offset that the value is stored at. + pub const DATA_OFFSET: usize = core::mem::offset_of!(ArcInner, data); } impl Arc { -- 2.47.3