xfs: merge the perag freeing helpers
authorChristoph Hellwig <hch@lst.de>
Mon, 14 Oct 2024 06:04:51 +0000 (08:04 +0200)
committerCarlos Maiolino <cem@kernel.org>
Tue, 22 Oct 2024 11:37:18 +0000 (13:37 +0200)
commitaa67ec6a25617e36eba4fb28a88159f500a6cac6
tree7bec443b6eabddd4908fdb9af9c24d1dc87250f5
parent82742f8c3f1a93787a05a00aca50c2a565231f84
xfs: merge the perag freeing helpers

There is no good reason to have two different routines for freeing perag
structures for the unmount and error cases.  Add two arguments to specify
the range of AGs to free to xfs_free_perag, and use that to replace
xfs_free_unused_perag_range.

The addition RCU grace period for the error case is harmless, and the
extra check for the AG to actually exist is not required now that the
callers pass the exact known allocated range.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Carlos Maiolino <cem@kernel.org>
fs/xfs/libxfs/xfs_ag.c
fs/xfs/libxfs/xfs_ag.h
fs/xfs/xfs_fsops.c
fs/xfs/xfs_mount.c