On 3/16/26 2:00 PM, Joel Fernandes wrote: > On Mon, 16 Mar 2026, John Hubbard wrote: > >> Alex, have you seen my Alignment patch [1], for that? It's sitting >> around with only Miguel having responded, but seems like exactly >> what you're talking about here. >> >> [1] https://lore.kernel.org/[email protected] > > `Alignment` is already in core Rust for Linux > (`rust/kernel/ptr.rs`) and I'm already using it in my nova-core v9 > patches. >
Right, but the patch I linked doesn't introduce Alignment. It adds a new from_u64() constructor to the existing Alignment type. Today the only constructors take usize, so there's no way to go from a u64 DeviceSize constant to an Alignment without a manual cast. Alex wanted to use Alignment for chunk_size but said "doing so would mean we cannot use an Alignment" if the field conforms to the C API's u64. So again, I think that patch is worth looking at. thanks, -- John Hubbard
