On Mon, Oct 16, 2023 at 05:48:31PM -0700, Darrick J. Wong wrote: > We can do it crappily in C with __bitwise and letting the static checker > bots go wild. Some day when someone rewrites the entire codebase in > Rust (HA!) then we'll be able to do: > > struct xfs_fsblock_t(u64); > struct xfs_agblock_t(u32); > > and (to the extent that I understand Rust) the Rust compiler will > complain about stuffing xfs_agblock_t into an xfs_fsblock_t without a > proper conversion. You can do the struct in C already. Linux actually does it for PTE types optionally. It's just a real pain in the butt if your regularly do arithmetics on it, which we do for the various block/size/offset types. > > --D ---end quoted text---