Re: [RFC v1 2/4] xfs: Introduce xfs_rtginodes_ensure_all()

Nirjhar Roy (IBM)
2026-02-25T05:18:37Z

On Wed, 2026-02-18 at 22:15 -0800, Christoph Hellwig wrote:
> > +int
> > +xfs_rtginodes_ensure_all(struct xfs_rtgroup *rtg)
>
> Please use the usual XFS function definition style.

Will fix this.
>
> > +{
> > + int i = 0;
>
> The for loop already does this.
>
> > + int error = 0;
> > +
> > + ASSERT(rtg);
>
> The assert isn't needed.
>
> > +
> > + for (i = 0; i < XFS_RTGI_MAX; i++) {
> > + error = xfs_rtginode_ensure(rtg, i);
> > + if (error)
> > + break;
> > + }
> > + return error;
>
> Just return the error directly from the loop and 0 if you make it
> through, then there is no need for the error initialization at the
> top either.
+1 for all of the above.
--NR