Re: [PATCH] xfs: Use for_each_perag() to iterate all available AGs

From: Eric Sandeen
Date: Fri Apr 07 2023 - 09:25:09 EST


On 4/6/23 11:03 AM, Ryosuke Yasuoka wrote:
> Eric,
>
> I failed to reply to you since I got some mistakes.
> Let me re-send my reply just in case.
>
> Thank you for reviewing my requests.
>
>> Can you explain what goes wrong if it is zero? Is there a test for this?
>>
>> If it's a general problem, what if the other 2 callers pass in the variable
>> start_agno with a value of 0?
> Sorry I couldn't prepare any tests to confirm what happens if it is zero
> because it is a kind of general problem.
>
> IIUC, passing zero to for_each_perag_wrap() is not problematic.

...

> OTOH, since we have already a for_each_perag() macro, which just iterates all AG
> from 0 and doesn't wrap, I think it is simpler to use for_earch_perag().
>
> Regards,
> Ryosuke

Ok - I couldn't tell from the original email if this was a bugfix or a
cleanup, and wanted to be sure.

Thanks!
-Eric