[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <rjazpdvhkyz5xzl3rndpfuwqcnqevhcjp3rs7iy2utd7gwleqc@zjiy73y73lt2>
Date: Wed, 30 Apr 2025 11:34:50 +0200
From: Carlos Maiolino <cem@...nel.org>
To: Markus Elfring <Markus.Elfring@....de>
Cc: linux-xfs@...r.kernel.org, kernel-janitors@...r.kernel.org,
Chandan Babu R <chandanbabu@...nel.org>, "Darrick J. Wong" <djwong@...nel.org>,
LKML <linux-kernel@...r.kernel.org>, Qasim Ijaz <qasdev00@...il.com>,
Natalie Vock <natalie.vock@....de>
Subject: Re: [PATCH] xfs: Simplify maximum determination in
xrep_calc_ag_resblks()
On Wed, Apr 30, 2025 at 10:34:59AM +0200, Markus Elfring wrote:
> …
> >> +++ b/fs/xfs/scrub/repair.c
> >> @@ -382,7 +382,7 @@ xrep_calc_ag_resblks(
> >> refcbt_sz);
> >> xfs_perag_put(pag);
> >>
> >> - return max(max(bnobt_sz, inobt_sz), max(rmapbt_sz, refcbt_sz));
> >> + return max3(bnobt_sz, inobt_sz, max(rmapbt_sz, refcbt_sz));
> >
> > I have nothing against the patch itself, but honestly I don't see how it
> > improves anything. It boils down to nesting comparison instructions too, and
> > doesn't make the code more clear IMHO.
> > So, unless somebody else has a stronger reason to have this change, NAK from my side.
> Would you be looking for a wrapper call variant like max4()?
I have no preference really, between a max(max(), max()) and a max4(a, b, c, d),
the latter is a tad easier to the eyes, if it's worth adding a new max() macro
for that, it's another thing. Although a quick search on the source code
returned returned several usages of the max(max3(a,b,c), d) patterns, so I think
indeed the kernel could benefit of a max4() :)
>
> Regards,
> Markus
Powered by blists - more mailing lists