dbmap[c] = xcalloc(mp->m_sb.sb_rblocks, sizeof(**dbmap));
inomap[c] = xcalloc(mp->m_sb.sb_rblocks, sizeof(**inomap));
- words = mp->m_rsumsize >> XFS_WORDLOG;
+ words = XFS_FSB_TO_B(mp, mp->m_rsumblocks) >> XFS_WORDLOG;
sumfile = xcalloc(words, sizeof(union xfs_suminfo_raw));
sumcompute = xcalloc(words, sizeof(union xfs_suminfo_raw));
}
xfs_agnumber_t m_maxagi; /* highest inode alloc group */
struct xfs_ino_geometry m_ino_geo; /* inode geometry */
uint m_rsumlevels; /* rt summary levels */
- uint m_rsumsize; /* size of rt summary, bytes */
+ xfs_filblks_t m_rsumblocks; /* size of rt summary, FSBs */
/*
* Optional cache of rt summary level per bitmap block with the
* invariant that m_rsum_cache[bbno] <= the minimum i for which
{
struct xfs_buf *bp; /* buffer for last block of subvolume */
xfs_daddr_t d; /* address of last block of subvolume */
- unsigned int rsumblocks;
int error;
if (mp->m_sb.sb_rblocks == 0)
return -1;
}
mp->m_rsumlevels = mp->m_sb.sb_rextslog + 1;
- rsumblocks = xfs_rtsummary_blockcount(mp, mp->m_rsumlevels,
+ mp->m_rsumblocks = xfs_rtsummary_blockcount(mp, mp->m_rsumlevels,
mp->m_sb.sb_rbmblocks);
- mp->m_rsumsize = XFS_FSB_TO_B(mp, rsumblocks);
mp->m_rbmip = mp->m_rsumip = NULL;
/*
{
struct xfs_mount *mp = ip->i_mount;
- ip->i_disk_size = mp->m_rsumsize;
+ ip->i_disk_size = mp->m_rsumblocks * mp->m_sb.sb_blocksize;
mp->m_sb.sb_rsumino = ip->i_ino;
mp->m_rsumip = ip;
fail(_("Initialization of rtbitmap inode failed"), error);
error = -libxfs_rtfile_initialize_blocks(mp->m_rsumip, 0,
- XFS_B_TO_FSB(mp, mp->m_rsumsize), NULL);
+ mp->m_rsumblocks, NULL);
if (error)
fail(_("Initialization of rtsummary inode failed"), error);
break;
case XR_INO_RTSUM:
- if (size != mp->m_rsumsize) {
+ if (size != XFS_FSB_TO_B(mp, mp->m_rsumblocks)) {
do_warn(
-_("realtime summary inode %" PRIu64 " has bad size %" PRId64 " (should be %d)\n"),
- lino, size, mp->m_rsumsize);
+_("realtime summary inode %" PRIu64 " has bad size %" PRIu64 " (should be %" PRIu64 ")\n"),
+ lino, size,
+ XFS_FSB_TO_B(mp, mp->m_rsumblocks));
return 1;
}
break;
_("couldn't iget realtime summary inode -- error - %d\n"),
error);
}
- ip->i_disk_size = mp->m_rsumsize;
+ ip->i_disk_size = mp->m_rsumblocks * mp->m_sb.sb_blocksize;
libxfs_trans_log_inode(tp, ip, XFS_ILOG_CORE);
error = -libxfs_trans_commit(tp);
if (error)
_("couldn't allocate memory for incore realtime bitmap.\n"));
words = btmcompute;
- wordcnt = mp->m_rsumsize >> XFS_WORDLOG;
+ wordcnt = XFS_FSB_TO_B(mp, mp->m_rsumblocks) >> XFS_WORDLOG;
sumcompute = calloc(wordcnt, sizeof(union xfs_suminfo_raw));
if (!sumcompute)
do_error(
return;
check_rtfile_contents(mp, "rtsummary", mp->m_sb.sb_rsumino, sumcompute,
- XFS_B_TO_FSB(mp, mp->m_rsumsize));
+ mp->m_rsumblocks);
}
void
libxfs_trans_cancel(tp);
mp->m_rsumip = ip;
- error = -libxfs_rtfile_initialize_blocks(ip, 0,
- mp->m_rsumsize >> mp->m_sb.sb_blocklog,
+ error = -libxfs_rtfile_initialize_blocks(ip, 0, mp->m_rsumblocks,
sumcompute);
mp->m_rsumip = NULL;
if (error)