[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <859ef104-2665-4de3-8d28-7652035d7fbc@oracle.com>
Date: Mon, 16 Dec 2024 14:52:35 +0530
From: Anand Jain <anand.jain@...cle.com>
To: Qu Wenruo <quwenruo.btrfs@....com>, Arnd Bergmann <arnd@...nel.org>,
Chris Mason <clm@...com>, Josef Bacik <josef@...icpanda.com>,
David Sterba <dsterba@...e.com>
Cc: Arnd Bergmann <arnd@...db.de>, Qu Wenruo <wqu@...e.com>,
Johannes Thumshirn <johannes.thumshirn@....com>,
Boris Burkov
<boris@....io>, Naohiro Aota <naohiro.aota@....com>,
linux-btrfs@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] btrfs: avoid opencoded 64-bit div/mod operation
>> @@ -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
Powered by blists - more mailing lists