From: Anand Jain <anand.jain@oracle.com>
To: Qu Wenruo <quwenruo.btrfs@gmx.com>,
Arnd Bergmann <arnd@kernel.org>, Chris Mason <clm@fb.com>,
Josef Bacik <josef@toxicpanda.com>,
David Sterba <dsterba@suse.com>
Cc: Arnd Bergmann <arnd@arndb.de>, Qu Wenruo <wqu@suse.com>,
Johannes Thumshirn <johannes.thumshirn@wdc.com>,
Boris Burkov <boris@bur.io>, Naohiro Aota <naohiro.aota@wdc.com>,
linux-btrfs@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] btrfs: avoid opencoded 64-bit div/mod operation
Date: Mon, 16 Dec 2024 14:52:35 +0530 [thread overview]
Message-ID: <859ef104-2665-4de3-8d28-7652035d7fbc@oracle.com> (raw)
In-Reply-To: <b46ad433-04a5-47d4-9cd0-84f4ab3b86e5@gmx.com>
>> @@ -1433,7 +1433,9 @@ static ssize_t btrfs_read_policy_store(struct
>> kobject *kobj,
>> #ifdef CONFIG_BTRFS_EXPERIMENTAL
>> if (index == BTRFS_READ_POLICY_RR) {
>> if (value != -1) {
>> - if ((value % fs_devices->fs_info->sectorsize) != 0) {
>> + u32 rem;
>> + div_u64_rem(value, fs_devices->fs_info->sectorsize, &rem);
>
> The original check is already bad, it's just a IS_ALIGNED().
>
> So a much simpler solution is:
>
> + if (!IS_ALIGNED(value, fs_info->sectorsize)) {
Right, this was also in the review comment by David, and the change
is already in the local work-space. I will be sending v4 out.
Currently dealing with some rebase issues.
Thanks, Anand
prev parent reply other threads:[~2024-12-16 9:23 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-16 8:32 [PATCH] btrfs: avoid opencoded 64-bit div/mod operation Arnd Bergmann
2024-12-16 8:37 ` Qu Wenruo
2024-12-16 9:22 ` Anand Jain [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=859ef104-2665-4de3-8d28-7652035d7fbc@oracle.com \
--to=anand.jain@oracle.com \
--cc=arnd@arndb.de \
--cc=arnd@kernel.org \
--cc=boris@bur.io \
--cc=clm@fb.com \
--cc=dsterba@suse.com \
--cc=johannes.thumshirn@wdc.com \
--cc=josef@toxicpanda.com \
--cc=linux-btrfs@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=naohiro.aota@wdc.com \
--cc=quwenruo.btrfs@gmx.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