summaryrefslogtreecommitdiff
path: root/fs/xfs/libxfs/xfs_rtbitmap.h
diff options
context:
space:
mode:
authorDarrick J. Wong <djwong@kernel.org>2023-10-16 09:35:23 -0700
committerDarrick J. Wong <djwong@kernel.org>2023-10-17 16:24:22 -0700
commit2c2b981b737a519907429f62148bbd9e40e01132 (patch)
tree1927c4278c463d432f3c2ea4c955496cf0a96568 /fs/xfs/libxfs/xfs_rtbitmap.h
parent68db60bf01c131c09bbe35adf43bd957a4c124bc (diff)
xfs: create a helper to convert extlen to rtextlen
Create a helper to compute the realtime extent (xfs_rtxlen_t) from an extent length (xfs_extlen_t) value. 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.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/fs/xfs/libxfs/xfs_rtbitmap.h b/fs/xfs/libxfs/xfs_rtbitmap.h
index b6a4c46bddc0..e2a36fc157c4 100644
--- a/fs/xfs/libxfs/xfs_rtbitmap.h
+++ b/fs/xfs/libxfs/xfs_rtbitmap.h
@@ -31,6 +31,14 @@ xfs_extlen_to_rtxmod(
return len % mp->m_sb.sb_rextsize;
}
+static inline xfs_rtxlen_t
+xfs_extlen_to_rtxlen(
+ 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.
*/