aboutsummaryrefslogtreecommitdiff
path: root/fs/xfs/libxfs/xfs_rtbitmap.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/xfs/libxfs/xfs_rtbitmap.c')
-rw-r--r--fs/xfs/libxfs/xfs_rtbitmap.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/fs/xfs/libxfs/xfs_rtbitmap.c b/fs/xfs/libxfs/xfs_rtbitmap.c
index e9b80ef166c0..54079edfe10f 100644
--- a/fs/xfs/libxfs/xfs_rtbitmap.c
+++ b/fs/xfs/libxfs/xfs_rtbitmap.c
@@ -20,6 +20,7 @@
#include "xfs_error.h"
#include "xfs_rtbitmap.h"
#include "xfs_health.h"
+#include "xfs_sb.h"
/*
* Realtime allocator bitmap functions shared with userspace.
@@ -1166,16 +1167,20 @@ xfs_rtbitmap_blockcount(
return xfs_rtbitmap_blockcount_len(mp, mp->m_sb.sb_rextents);
}
-/* Compute the number of rtsummary blocks needed to track the given rt space. */
+/*
+ * Compute the geometry of the rtsummary file needed to track the given rt
+ * space.
+ */
xfs_filblks_t
xfs_rtsummary_blockcount(
struct xfs_mount *mp,
- unsigned int rsumlevels,
- xfs_extlen_t rbmblocks)
+ unsigned int *rsumlevels)
{
unsigned long long rsumwords;
- rsumwords = (unsigned long long)rsumlevels * rbmblocks;
+ *rsumlevels = xfs_compute_rextslog(mp->m_sb.sb_rextents) + 1;
+
+ rsumwords = xfs_rtbitmap_blockcount(mp) * (*rsumlevels);
return XFS_B_TO_FSB(mp, rsumwords << XFS_WORDLOG);
}