Re: [PATCH 10/22] xfs: pass perags around in fsmap data dev functions

Dave Chinner
2021-05-18T01:01:00Z

On Wed, May 12, 2021 at 03:23:23PM -0700, Darrick J. Wong wrote:
> On Thu, May 06, 2021 at 05:20:42PM +1000, Dave Chinner wrote:
> > From: Dave Chinner <dchinner@redhat.com>
> >
> > Needs a [from, to] ranged AG walk, and the perag to be stuffed into
> > the info structure for callouts to use.
> >
> > Signed-off-by: Dave Chinner <dchinner@redhat.com>
> > ---
> > fs/xfs/libxfs/xfs_ag.h | 14 ++++++--
> > fs/xfs/xfs_fsmap.c | 75 ++++++++++++++++++++++++++----------------
> > 2 files changed, 58 insertions(+), 31 deletions(-)
> >
> > diff --git a/fs/xfs/libxfs/xfs_ag.h b/fs/xfs/libxfs/xfs_ag.h
> > index 3fa88222dacd..bebbe1bfce27 100644
> > --- a/fs/xfs/libxfs/xfs_ag.h
> > +++ b/fs/xfs/libxfs/xfs_ag.h
> > @@ -116,14 +116,24 @@ void xfs_perag_put(struct xfs_perag *pag);
> >
> > /*
> > * Perag iteration APIs
> > + *
> > + * XXX: for_each_perag_range() usage really needs an iterator to clean up when
> > + * we terminate at end_agno because we may have taken a reference to the perag
> > + * beyond end_agno. RIght now callers have to be careful to catch and clean that
> > + * up themselves. This is not necessary for the callers of for_each_perag() and
> > + * for_each_perag_from() because they terminate at sb_agcount where there are
> > + * no perag structures in tree beyond end_agno.
>
> I think I'll wait and see what this becomes with the next iteration
> before RVBing things. The conversions look correct in this patch.

I wasn't planning on addressing this immediately (i.e. in this patch
set), so it's not actually going to change yet. I'll do this as a
standalone conversion in the next series of changes leading up to
active references...

-Dave.

--
Dave Chinner
david@fromorbit.com