xfs: drop the AGI being passed to xfs_check_agi_freecount
authorDave Chinner <david@fromorbit.com>
Tue, 8 Jun 2021 16:19:22 +0000 (09:19 -0700)
committerDarrick J. Wong <djwong@kernel.org>
Tue, 8 Jun 2021 16:19:22 +0000 (09:19 -0700)
commit9ba0889e2272294bfbb5589b1b180ad2e782b2a4
tree5ba752d1575c0acea02abb8a55c741f130ac5ee1
parentc3eabd365034185840fdd26df21cdb03523f7e2b
xfs: drop the AGI being passed to xfs_check_agi_freecount

From: Dave Chinner <dchinner@redhat.com>

Stephen Rothwell reported this compiler warning from linux-next:

fs/xfs/libxfs/xfs_ialloc.c: In function 'xfs_difree_finobt':
fs/xfs/libxfs/xfs_ialloc.c:2032:20: warning: unused variable 'agi' [-Wunused-variable]
 2032 |  struct xfs_agi   *agi = agbp->b_addr;

Which is fallout from agno -> perag conversions that were done in
this function. xfs_check_agi_freecount() is the only user of "agi"
in xfs_difree_finobt() now, and it only uses the agi to get the
current free inode count. We hold that in the perag structure, so
there's not need to directly reference the raw AGI to get this
information.

The btree cursor being passed to xfs_check_agi_freecount() has a
reference to the perag being operated on, so use that directly in
xfs_check_agi_freecount() rather than passing an AGI.

Fixes: 7b13c5155182 ("xfs: use perag for ialloc btree cursors")
Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Carlos Maiolino <cmaiolino@redhat.com>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
fs/xfs/libxfs/xfs_ialloc.c