xfs: give xfs_bmap_intent its own perag reference
authorDarrick J. Wong <djwong@kernel.org>
Wed, 12 Apr 2023 01:59:53 +0000 (18:59 -0700)
committerDarrick J. Wong <djwong@kernel.org>
Wed, 12 Apr 2023 01:59:53 +0000 (18:59 -0700)
commit774a99b47b588bf0bd9f65d3b241d5bba0b2fcb0
tree20513aa21006f369d324ba6e73f44db572535ddf
parent03786f0afb2ed5705a0478e14fea50a7f1a44f7e
xfs: give xfs_bmap_intent its own perag reference

Give the xfs_bmap_intent an active reference to the perag structure
data.  This reference will be used to enable scrub intent draining
functionality in subsequent patches.  Later, shrink will use these
passive references to know if an AG is quiesced or not.

The reason why we take a passive ref for a file mapping operation is
simple: we're committing to some sort of action involving space in an
AG, so we want to indicate our interest in that AG.  The space is
already allocated, so we need to be able to operate on AGs that are
offline or being shrunk.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
fs/xfs/libxfs/xfs_bmap.c
fs/xfs/libxfs/xfs_bmap.h
fs/xfs/xfs_bmap_item.c