@@ -175,6 +175,8 @@
#define xfs_rmap_lookup_le_range libxfs_rmap_lookup_le_range
#define xfs_rmap_query_range libxfs_rmap_query_range
+#define xfs_rtbitmap_wordcount libxfs_rtbitmap_wordcount
+
#define xfs_rtfree_extent libxfs_rtfree_extent
#define xfs_rtfree_blocks libxfs_rtfree_blocks
#define xfs_sb_from_disk libxfs_sb_from_disk
@@ -19,6 +19,8 @@
void
rtinit(xfs_mount_t *mp)
{
+ unsigned long long wordcnt;
+
if (mp->m_sb.sb_rblocks == 0)
return;
@@ -26,11 +28,9 @@ rtinit(xfs_mount_t *mp)
* realtime init -- blockmap initialization is
* handled by incore_init()
*/
- /*
- sumfile = calloc(mp->m_rsumsize, 1);
- */
- if ((btmcompute = calloc(mp->m_sb.sb_rbmblocks *
- mp->m_sb.sb_blocksize, 1)) == NULL)
+ wordcnt = libxfs_rtbitmap_wordcount(mp, mp->m_sb.sb_rextents);
+ btmcompute = calloc(wordcnt, sizeof(xfs_rtword_t));
+ if (!btmcompute)
do_error(
_("couldn't allocate memory for incore realtime bitmap.\n"));