From: Qu Wenruo <quwenruo.btrfs@gmx.com>
To: dsterba@suse.cz, Nikolay Borisov <nborisov@suse.com>,
Qu Wenruo <wqu@suse.com>,
linux-btrfs@vger.kernel.org
Subject: Re: [PATCH v2 3/3] btrfs: file-item: refactor btrfs_lookup_bio_sums() to handle out-of-order bvecs
Date: Thu, 29 Oct 2020 22:11:38 +0800 [thread overview]
Message-ID: <214e0c82-db77-1b28-eadd-97bca06a5aed@gmx.com> (raw)
In-Reply-To: <20201029135415.GK6756@twin.jikos.cz>
On 2020/10/29 下午9:54, David Sterba wrote:
> On Thu, Oct 29, 2020 at 08:43:12PM +0800, Qu Wenruo wrote:
>> On 2020/10/29 下午7:50, Nikolay Borisov wrote:
>>> On 29.10.20 г. 9:12 ч., Qu Wenruo wrote:
>>>> +{
>>>> + struct btrfs_csum_item *item = NULL;
>>>> + struct btrfs_key key;
>>>> + u32 csum_size = btrfs_super_csum_size(fs_info->super_copy);
>>>
>>> nit: Why u32, btrfs_super_csum_size is defined as returning 'int',
>>> however this function is really returning u16 since "struct btrfs_csums"
>>> is defined as u16.
>>
>> It was misguided by u32 from btrfs super block, where sectorsize,
>> nodesize are all u32.
>>
>> Any recommendation on this? Just u16 for csum_size or follow
>> nodesize/sectorsize to use u32?
>
> u32 is ok, this generates a bit better assembly than u16. I'm about to
> send the patchset lifting it to fs_info and it uses u32.
>
BTW, if you're going to change that, what about adding some thing like
nodesize_bits/sectorsize_bits/csumsize_bits?
There are a lot of locations that u64/u32 leads to 32bit compiling
error, and a bit shifting would be a much better solution than div_u64()
macro.
Thanks,
Qu
prev parent reply other threads:[~2020-10-29 14:11 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-29 7:12 [PATCH v2 0/3] btrfs: btrfs_lookup_bio_sums() related fixes Qu Wenruo
2020-10-29 7:12 ` [PATCH v2 1/3] btrfs: file-item: use nodesize to determine whether we need readhead for btrfs_lookup_bio_sums() Qu Wenruo
2020-10-29 18:57 ` Josef Bacik
2020-10-29 23:57 ` Qu Wenruo
2020-10-29 7:12 ` [PATCH v2 2/3] btrfs: file-item: remove the btrfs_find_ordered_sum() call in btrfs_lookup_bio_sums() Qu Wenruo
2020-10-29 7:47 ` Nikolay Borisov
2020-10-29 7:53 ` Qu Wenruo
2020-10-29 18:51 ` Josef Bacik
2020-10-29 7:12 ` [PATCH v2 3/3] btrfs: file-item: refactor btrfs_lookup_bio_sums() to handle out-of-order bvecs Qu Wenruo
2020-10-29 11:50 ` Nikolay Borisov
2020-10-29 12:43 ` Qu Wenruo
2020-10-29 13:54 ` David Sterba
2020-10-29 14:11 ` Qu Wenruo [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=214e0c82-db77-1b28-eadd-97bca06a5aed@gmx.com \
--to=quwenruo.btrfs@gmx.com \
--cc=dsterba@suse.cz \
--cc=linux-btrfs@vger.kernel.org \
--cc=nborisov@suse.com \
--cc=wqu@suse.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