Hi all, In preparation for adding block headers and enforcing endian order in rtbitmap and rtsummary blocks, replace open-coded geometry computations and fugly macros with proper helper functions that can be typechecked. Soon we'll be needing to add more complex logic to the helpers. v1.1: various cleanups suggested by hch If you're going to start using this code, I strongly recommend pulling from my git trees, which are linked below. With a bit of luck, this should all go splendidly. Comments and questions are, as always, welcome. --D kernel git tree: https://git.kernel.org/cgit/linux/kernel/git/djwong/xfs-linux.git/log/?h=refactor-rtbitmap-macros-6.7 --- fs/xfs/libxfs/xfs_format.h | 16 ----- fs/xfs/libxfs/xfs_rtbitmap.c | 142 +++++++++++++++++++++++++--------------- fs/xfs/libxfs/xfs_rtbitmap.h | 100 ++++++++++++++++++++++++++++ fs/xfs/libxfs/xfs_trans_resv.c | 9 +-- fs/xfs/libxfs/xfs_types.h | 2 + fs/xfs/scrub/rtsummary.c | 23 +++--- fs/xfs/xfs_rtalloc.c | 22 +++--- 7 files changed, 218 insertions(+), 96 deletions(-)