From 097b4b7b64ef67a4703b89fd4064480b61557fd5 Mon Sep 17 00:00:00 2001 From: "Darrick J. Wong" Date: Mon, 16 Oct 2023 09:47:34 -0700 Subject: xfs: convert rt summary macros to helpers Convert the realtime summary file macros to helper functions so that we can improve type checking. Signed-off-by: Darrick J. Wong Reviewed-by: Christoph Hellwig --- fs/xfs/libxfs/xfs_rtbitmap.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'fs/xfs/libxfs/xfs_rtbitmap.c') diff --git a/fs/xfs/libxfs/xfs_rtbitmap.c b/fs/xfs/libxfs/xfs_rtbitmap.c index cc3e70b7fbe5..efa084de58c2 100644 --- a/fs/xfs/libxfs/xfs_rtbitmap.c +++ b/fs/xfs/libxfs/xfs_rtbitmap.c @@ -455,17 +455,18 @@ xfs_rtmodify_summary_int( struct xfs_buf *bp; /* buffer for the summary block */ int error; /* error value */ xfs_fileoff_t sb; /* summary fsblock */ - int so; /* index into the summary file */ + xfs_rtsumoff_t so; /* index into the summary file */ xfs_suminfo_t *sp; /* pointer to returned data */ + unsigned int infoword; /* * Compute entry number in the summary file. */ - so = XFS_SUMOFFS(mp, log, bbno); + so = xfs_rtsumoffs(mp, log, bbno); /* * Compute the block number in the summary file. */ - sb = XFS_SUMOFFSTOBLOCK(mp, so); + sb = xfs_rtsumoffs_to_block(mp, so); /* * If we have an old buffer, and the block number matches, use that. */ @@ -493,7 +494,8 @@ xfs_rtmodify_summary_int( /* * Point to the summary information, modify/log it, and/or copy it out. */ - sp = XFS_SUMPTR(mp, bp, so); + infoword = xfs_rtsumoffs_to_infoword(mp, so); + sp = xfs_rsumblock_infoptr(bp, infoword); if (delta) { uint first = (uint)((char *)sp - (char *)bp->b_addr); -- cgit v1.2.3-70-g09d2