summaryrefslogtreecommitdiff
path: root/rust/kernel/types.rs
diff options
context:
space:
mode:
authorDanilo Krummrich <dakr@kernel.org>2025-07-31 17:48:06 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-08-28 16:34:43 +0200
commit3340149cebd9185bba088875bd9c56a0cd1e3992 (patch)
tree628810e714b3db18affaafb33c61739456bde190 /rust/kernel/types.rs
parent6b14c9c9140648e2a4c4daaec767c5a3dd5ab8b9 (diff)
rust: alloc: replace aligned_size() with Kmalloc::aligned_layout()
[ Upstream commit fde578c86281f27b182680c7642836a0dbbd0be7 ] aligned_size() dates back to when Rust did support kmalloc() only, but is now used in ReallocFunc::call() and hence for all allocators. However, the additional padding applied by aligned_size() is only required by the kmalloc() allocator backend. Hence, replace aligned_size() with Kmalloc::aligned_layout() and use it for the affected allocators, i.e. kmalloc() and kvmalloc(), only. While at it, make Kmalloc::aligned_layout() public, such that Rust abstractions, which have to call subsystem specific kmalloc() based allocation primitives directly, can make use of it. Fixes: 8a799831fc63 ("rust: alloc: implement `ReallocFunc`") Reviewed-by: Alice Ryhl <aliceryhl@google.com> Link: https://lore.kernel.org/r/20250731154919.4132-2-dakr@kernel.org [ Remove `const` from Kmalloc::aligned_layout(). - Danilo ] Signed-off-by: Danilo Krummrich <dakr@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'rust/kernel/types.rs')
0 files changed, 0 insertions, 0 deletions