diff options
| author | Darrick J. Wong <djwong@kernel.org> | 2023-10-16 09:34:39 -0700 |
|---|---|---|
| committer | Darrick J. Wong <djwong@kernel.org> | 2023-10-17 16:24:22 -0700 |
| commit | 68db60bf01c131c09bbe35adf43bd957a4c124bc (patch) | |
| tree | 05898334658a0cc5e8d1a50dfc32d02f7e971668 /fs/xfs/libxfs/xfs_rtbitmap.h | |
| parent | fa5a387230861116c2434c20d29fc4b3fd077d24 (diff) | |
xfs: create a helper to compute leftovers of realtime extents
Create a helper to compute the misalignment between a file extent
(xfs_extlen_t) and a realtime extent.
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'fs/xfs/libxfs/xfs_rtbitmap.h')
| -rw-r--r-- | fs/xfs/libxfs/xfs_rtbitmap.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/fs/xfs/libxfs/xfs_rtbitmap.h b/fs/xfs/libxfs/xfs_rtbitmap.h index 099ea8902aaa..b6a4c46bddc0 100644 --- a/fs/xfs/libxfs/xfs_rtbitmap.h +++ b/fs/xfs/libxfs/xfs_rtbitmap.h @@ -22,6 +22,15 @@ xfs_rtxlen_to_extlen( return rtxlen * mp->m_sb.sb_rextsize; } +/* Compute the misalignment between an extent length and a realtime extent .*/ +static inline unsigned int +xfs_extlen_to_rtxmod( + struct xfs_mount *mp, + xfs_extlen_t len) +{ + return len % mp->m_sb.sb_rextsize; +} + /* * Functions for walking free space rtextents in the realtime bitmap. */ |