common/xfs: refactor agcount calculation for mounted filesystems