Re: [PATCH 20/42] xfs: use xfs_alloc_vextent_first_ag() where appropriate

Dave Chinner
2023-02-06T23:16:46Z

On Wed, Feb 01, 2023 at 02:43:13PM -0800, Darrick J. Wong wrote:
> On Thu, Jan 19, 2023 at 09:44:43AM +1100, Dave Chinner wrote:
> > From: Dave Chinner <dchinner@redhat.com>
> >
> > Change obvious callers of single AG allocation to use
> > xfs_alloc_vextent_first_ag(). This gets rid of
> > XFS_ALLOCTYPE_FIRST_AG as the type used within
> > xfs_alloc_vextent_first_ag() during iteration is _THIS_AG. Hence we
> > can remove the setting of args->type from all the callers of
> > _first_ag() and remove the alloctype.
> >
> > While doing this, pass the allocation target fsb as a parameter
> > rather than encoding it in args->fsbno. This starts the process
> > of making args->fsbno an output only variable rather than
> > input/output.
> >
> > Signed-off-by: Dave Chinner <dchinner@redhat.com>
> > ---
> > fs/xfs/libxfs/xfs_alloc.c | 35 +++++++++++++++++++----------------
> > fs/xfs/libxfs/xfs_alloc.h | 10 ++++++++--
> > fs/xfs/libxfs/xfs_bmap.c | 31 ++++++++++++++++---------------
> > 3 files changed, 43 insertions(+), 33 deletions(-)
> >
> > diff --git a/fs/xfs/libxfs/xfs_alloc.c b/fs/xfs/libxfs/xfs_alloc.c
> > index 28b79facf2e3..186ce3aee9e0 100644
> > --- a/fs/xfs/libxfs/xfs_alloc.c
> > +++ b/fs/xfs/libxfs/xfs_alloc.c
> > @@ -3183,7 +3183,8 @@ xfs_alloc_read_agf(
> > */
> > static int
> > xfs_alloc_vextent_check_args(
> > - struct xfs_alloc_arg *args)
> > + struct xfs_alloc_arg *args,
> > + xfs_rfsblock_t target)
>
> Isn't xfs_rfsblock_t supposed to be used to measure quantities of raw fs
> blocks, and not the segmented agno/agbno numbers that we encode in most
> places?

Yup, just a minor braino. I'll fix those.

-Dave.
--
Dave Chinner
david@fromorbit.com