summaryrefslogtreecommitdiff
path: root/fs/xfs/libxfs/xfs_rtbitmap.c
diff options
context:
space:
mode:
authorDarrick J. Wong <djwong@kernel.org>2023-10-16 09:47:34 -0700
committerDarrick J. Wong <djwong@kernel.org>2023-10-17 17:45:38 -0700
commit097b4b7b64ef67a4703b89fd4064480b61557fd5 (patch)
treeef89174ec6a976be4b31c180ffdab24809ac71ed /fs/xfs/libxfs/xfs_rtbitmap.c
parenta9948626849c2c65dfd201b5e9d855e62937de61 (diff)
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 <djwong@kernel.org> Reviewed-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'fs/xfs/libxfs/xfs_rtbitmap.c')
-rw-r--r--fs/xfs/libxfs/xfs_rtbitmap.c10
1 files changed, 6 insertions, 4 deletions
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);