Re: [PATCH -next] btrfs: lzo: Mask instead of divide to fix 32-bit build
From: David Sterba
Date: Tue Oct 05 2021 - 19:23:46 EST
On Tue, Oct 05, 2021 at 11:34:06AM +0200, Geert Uytterhoeven wrote:
> On 32-bit builds (e.g. m68k):
>
> ERROR: modpost: "__umoddi3" [fs/btrfs/btrfs.ko] undefined!
>
> "cur_in - start" is 64-bit, while sectorsize is u32.
>
> As sectorsize is always a power of two, the 64-by-32 modulo operation
> can be replaced by a much cheaper bitwise AND with "sectorsize - 1".
>
> Fixes: 0078783c7089fc83 ("btrfs: rework lzo_compress_pages() to make it subpage compatible")
> Reported-by: noreply@xxxxxxxxxxxxxx
> Signed-off-by: Geert Uytterhoeven <geert@xxxxxxxxxxxxxx>
Thanks. Folded to the patch as it's still in the devel queue.