File systems with a zoned RT device have a large number of reserved
blocks that are required for garbage collection, and which can't be
filled with user data. Exclude them from the available blocks reported
through stat(v)fs.
Signed-off-by: Christoph Hellwig <hch@lst.de>
{
st->f_bfree = xfs_rtbxlen_to_blen(mp,
xfs_sum_freecounter(mp, XC_FREE_RTEXTENTS));
- st->f_blocks = mp->m_sb.sb_rblocks;
+ st->f_blocks = mp->m_sb.sb_rblocks -
+ xfs_rtbxlen_to_blen(mp, mp->m_resblks[XC_FREE_RTEXTENTS].total);
}
static void