From: Dave Chinner <david@fromorbit.com>
To: Fabian Frederick <fabf@skynet.be>
Cc: Al Viro <viro@ZenIV.linux.org.uk>,
linux-kernel@vger.kernel.org, xfs@oss.sgi.com
Subject: Re: [PATCH 1/4 linux-next] xfs: use swap() in xfs_dir2_leafn_rebalance()
Date: Tue, 19 May 2015 07:37:14 +1000 [thread overview]
Message-ID: <20150518213714.GV15721@dastard> (raw)
In-Reply-To: <1618479490.17551.1431972373169.open-xchange@webmail.nmp.proximus.be>
On Mon, May 18, 2015 at 08:06:13PM +0200, Fabian Frederick wrote:
>
>
> > On 18 May 2015 at 19:19 Al Viro <viro@ZenIV.linux.org.uk> wrote:
> >
> >
> > On Mon, May 18, 2015 at 07:13:48PM +0200, Fabian Frederick wrote:
> > > * If the block order is wrong, swap the arguments.
> > > */
> > > - if ((swap = xfs_dir2_leafn_order(dp, blk1->bp, blk2->bp))) {
> > > - xfs_da_state_blk_t *tmp; /* temp for block swap */
> > > + swap = xfs_dir2_leafn_order(dp, blk1->bp, blk2->bp);
> > > + if (swap)
> > > + swap(blk1, blk2);
> >
> > Egads... Have you even read what you'd written? Yes, sure, preprocessor
> > will do the right thing, but it's a very noticable annoyance for somebody
> > reading that. Rename the bleeding flag, please.
>
> I wanted to focus on the swap() update in this small patchset (some other things
> should be done in there like have xfs_dir2_leafn_order() return bool) but I can
> rename it in something like need_swap. Do I need to resend the 4 patches Dave ?
4 patches is 3 patches too many for noise like this. Anyway, two of
the patches have the same local "swap" variable problem; the context
is "swap order" not "need swap".
FWIW, I am not a fan of changing the code for no actual gain - the
compiled code is identical, there are no stack savings, and now I
have to look at an extra file to work out what the code does. If
you're changing the code and this is prep work for a large series,
then by all means clean the code up. But otherwise, changes like
this just mean work that other developers have in progress need
rebasing....
Cheers,
Dave.
--
Dave Chinner
david@fromorbit.com
prev parent reply other threads:[~2015-05-18 21:37 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-18 17:13 [PATCH 1/4 linux-next] xfs: use swap() in xfs_dir2_leafn_rebalance() Fabian Frederick
2015-05-18 17:13 ` [PATCH 2/4 linux-next] xfs: use swap() in xfs_lock_two_inodes() Fabian Frederick
2015-05-18 17:13 ` [PATCH 3/4 linux-next] xfs: use swap() in xfs_attr3_leaf_rebalance() Fabian Frederick
2015-05-18 17:13 ` [PATCH 4/4 linux-next] xfs: use swap() in xfs_da3_node_rebalance() Fabian Frederick
2015-05-18 17:19 ` [PATCH 1/4 linux-next] xfs: use swap() in xfs_dir2_leafn_rebalance() Al Viro
2015-05-18 18:06 ` Fabian Frederick
2015-05-18 21:37 ` Dave Chinner [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20150518213714.GV15721@dastard \
--to=david@fromorbit.com \
--cc=fabf@skynet.be \
--cc=linux-kernel@vger.kernel.org \
--cc=viro@ZenIV.linux.org.uk \
--cc=xfs@oss.sgi.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox