From: David Laight <David.Laight@ACULAB.COM>
To: 'chi wu' <wuchi.zero@gmail.com>, Christoph Hellwig <hch@infradead.org>
Cc: "tytso@mit.edu" <tytso@mit.edu>,
"adilger.kernel@dilger.ca" <adilger.kernel@dilger.ca>,
"ojaswin@linux.ibm.com" <ojaswin@linux.ibm.com>,
"ritesh.list@gmail.com" <ritesh.list@gmail.com>,
"linux-ext4@vger.kernel.org" <linux-ext4@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: RE: [PATCH] ext4: simplify 32bit calculation of lblk
Date: Wed, 5 Apr 2023 11:43:47 +0000 [thread overview]
Message-ID: <d04ead6617314074b297c10458010d6b@AcuMS.aculab.com> (raw)
In-Reply-To: <CA+tQmHA_3_Oc-0AQ0a29DTwU4mkEqhOiAE6gXa4Ly4gZGpn5Vw@mail.gmail.com>
From: chi wu
> Sent: 05 April 2023 09:48
>
> Christoph Hellwig <hch@infradead.org> 于2023年4月5日周三 13:40写道:
> >
> > On Mon, Apr 03, 2023 at 09:53:04PM +0800, wuchi wrote:
> > > - if (block > ext_block)
> > > - return ext_pblk + (block - ext_block);
> > > - else
> > > - return ext_pblk - (ext_block - block);
> > > + return ext_pblk + ((signed long long)block - (signed long long)ext_block);
> >
> > And what exactly is the value add here, except for turning an easy
> > to parse statement into a complex expression using casts?
> >
> Yes,it will be more complex. the original intention is to reduce the
> conditional branch.
What is wrong with just:
return ext_pblk + block - ext_block;
(64bit + 32bit - 32bit)
David
-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)
next prev parent reply other threads:[~2023-04-05 11:45 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-03 13:53 wuchi
2023-04-05 5:40 ` Christoph Hellwig
2023-04-05 8:47 ` chi wu
2023-04-05 11:43 ` David Laight [this message]
2023-04-05 12:47 ` chi wu
2023-04-05 13:55 ` David Laight
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=d04ead6617314074b297c10458010d6b@AcuMS.aculab.com \
--to=david.laight@aculab.com \
--cc=adilger.kernel@dilger.ca \
--cc=hch@infradead.org \
--cc=linux-ext4@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=ojaswin@linux.ibm.com \
--cc=ritesh.list@gmail.com \
--cc=tytso@mit.edu \
--cc=wuchi.zero@gmail.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
all inboxes | Powered by JetHome®