Skip to content

Commit 035e32f

Browse files
author
Chandan Babu R
committed
Merge tag 'refactor-rtbitmap-macros-6.7_2023-10-19' of https://git.kernel.org/pub/scm/linux/kernel/git/djwong/xfs-linux into xfs-6.7-mergeA
xfs: refactor rtbitmap/summary macros [v1.1] 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 With a bit of luck, this should all go splendidly. Signed-off-by: Darrick J. Wong <djwong@kernel.org> Signed-off-by: Chandan Babu R <chandanbabu@kernel.org> * tag 'refactor-rtbitmap-macros-6.7_2023-10-19' of https://git.kernel.org/pub/scm/linux/kernel/git/djwong/xfs-linux: xfs: create helpers for rtbitmap block/wordcount computations xfs: convert rt summary macros to helpers xfs: convert open-coded xfs_rtword_t pointer accesses to helper xfs: remove XFS_BLOCKWSIZE and XFS_BLOCKWMASK macros xfs: convert the rtbitmap block and bit macros to static inline functions
2 parents 9d4ca5a + d0448fe commit 035e32f

File tree

7 files changed

+218
-96
lines changed

7 files changed

+218
-96
lines changed

fs/xfs/libxfs/xfs_format.h

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1142,24 +1142,10 @@ static inline bool xfs_dinode_has_large_extent_counts(
11421142

11431143
#define XFS_BLOCKSIZE(mp) ((mp)->m_sb.sb_blocksize)
11441144
#define XFS_BLOCKMASK(mp) ((mp)->m_blockmask)
1145-
#define XFS_BLOCKWSIZE(mp) ((mp)->m_blockwsize)
1146-
#define XFS_BLOCKWMASK(mp) ((mp)->m_blockwmask)
11471145

11481146
/*
1149-
* RT Summary and bit manipulation macros.
1147+
* RT bit manipulation macros.
11501148
*/
1151-
#define XFS_SUMOFFS(mp,ls,bb) ((int)((ls) * (mp)->m_sb.sb_rbmblocks + (bb)))
1152-
#define XFS_SUMOFFSTOBLOCK(mp,s) \
1153-
(((s) * (uint)sizeof(xfs_suminfo_t)) >> (mp)->m_sb.sb_blocklog)
1154-
#define XFS_SUMPTR(mp,bp,so) \
1155-
((xfs_suminfo_t *)((bp)->b_addr + \
1156-
(((so) * (uint)sizeof(xfs_suminfo_t)) & XFS_BLOCKMASK(mp))))
1157-
1158-
#define XFS_BITTOBLOCK(mp,bi) ((bi) >> (mp)->m_blkbit_log)
1159-
#define XFS_BLOCKTOBIT(mp,bb) ((bb) << (mp)->m_blkbit_log)
1160-
#define XFS_BITTOWORD(mp,bi) \
1161-
((int)(((bi) >> XFS_NBWORDLOG) & XFS_BLOCKWMASK(mp)))
1162-
11631149
#define XFS_RTMIN(a,b) ((a) < (b) ? (a) : (b))
11641150
#define XFS_RTMAX(a,b) ((a) > (b) ? (a) : (b))
11651151

0 commit comments

Comments
 (0)