Convert the AG iteration loop for this debugger command to use
for_each_perag, since it's the only place in userspace that obvious
wants it.
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
static void
print_agresv_info(
- xfs_agnumber_t agno)
+ struct xfs_perag *pag)
{
struct xfs_buf *bp;
struct xfs_agf *agf;
- struct xfs_perag *pag = libxfs_perag_get(mp, agno);
+ xfs_agnumber_t agno = pag->pag_agno;
xfs_extlen_t ask = 0;
xfs_extlen_t used = 0;
xfs_extlen_t free = 0;
if (ask - used > free)
printf(" <not enough space>");
printf("\n");
- libxfs_perag_put(pag);
}
static int
int argc,
char **argv)
{
+ struct xfs_perag *pag;
xfs_agnumber_t agno;
int i;
continue;
}
- print_agresv_info(a);
+ pag = libxfs_perag_get(mp, a);
+ print_agresv_info(pag);
+ libxfs_perag_put(pag);
}
return 0;
}
- for (agno = 0; agno < mp->m_sb.sb_agcount; agno++)
- print_agresv_info(agno);
+ for_each_perag(mp, agno, pag)
+ print_agresv_info(pag);
return 0;
}