diff options
| author | Darrick J. Wong <[email protected]> | 2023-10-16 16:38:28 +0000 |
|---|---|---|
| committer | Darrick J. Wong <[email protected]> | 2023-10-17 23:26:25 +0000 |
| commit | 5f57f7309d9ab9d24d50c5707472b1ed8af4eabc (patch) | |
| tree | 9708cc6ce8ea5d8a3606606de39ee093d8ba49d7 /fs/xfs/libxfs/xfs_rtbitmap.h | |
| parent | xfs: convert do_div calls to xfs_rtb_to_rtx helper calls (diff) | |
| download | kernel-5f57f7309d9ab9d24d50c5707472b1ed8af4eabc.tar.gz kernel-5f57f7309d9ab9d24d50c5707472b1ed8af4eabc.zip | |
xfs: create rt extent rounding helpers for realtime extent blocks
Create a pair of functions to round rtblock numbers up or down to the
nearest rt extent.
Signed-off-by: Darrick J. Wong <[email protected]>
Reviewed-by: Christoph Hellwig <[email protected]>
Diffstat (limited to 'fs/xfs/libxfs/xfs_rtbitmap.h')
| -rw-r--r-- | fs/xfs/libxfs/xfs_rtbitmap.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/fs/xfs/libxfs/xfs_rtbitmap.h b/fs/xfs/libxfs/xfs_rtbitmap.h index ff901bf3d1ee..ecf5645dd670 100644 --- a/fs/xfs/libxfs/xfs_rtbitmap.h +++ b/fs/xfs/libxfs/xfs_rtbitmap.h @@ -84,6 +84,24 @@ xfs_rtb_to_rtxup( return rtbno; } +/* Round this rtblock up to the nearest rt extent size. */ +static inline xfs_rtblock_t +xfs_rtb_roundup_rtx( + struct xfs_mount *mp, + xfs_rtblock_t rtbno) +{ + return roundup_64(rtbno, mp->m_sb.sb_rextsize); +} + +/* Round this rtblock down to the nearest rt extent size. */ +static inline xfs_rtblock_t +xfs_rtb_rounddown_rtx( + struct xfs_mount *mp, + xfs_rtblock_t rtbno) +{ + return rounddown_64(rtbno, mp->m_sb.sb_rextsize); +} + /* * Functions for walking free space rtextents in the realtime bitmap. */ |
