Re: [PATCH] f2fs: fix 32-bit build

From: Jaegeuk Kim
Date: Wed Nov 23 2016 - 16:19:00 EST


On Wed, Nov 23, 2016 at 10:05:41PM +0100, Arnd Bergmann wrote:
> On Wednesday, November 23, 2016 10:42:26 AM CET Jaegeuk Kim wrote:
> >
> > Unfortunately, the sector number is usually a 64-bit number, and
> > we guarantee that bdev_zone_size() returns a power-of-two number.
>
> The sentence no longer makes sense. Maybe
>
> Fortunately, bdev_zone_size() is guaranteed to return a power-of-two
> number, so we can replace the % operator with a cheaper bit mask.

Got it.
Added it with modifed version.
Thanks,

>
> > @@ -693,7 +693,8 @@ static int __f2fs_issue_discard_zone(struct f2fs_sb_info *sbi,
> > }
> > sector = SECTOR_FROM_BLOCK(blkstart);
> >
> > - if (sector % bdev_zone_size(bdev) || nr_sects != bdev_zone_size(bdev)) {
> > + if (sector & (bdev_zone_size(bdev) - 1) ||
> >
>
> looks good, thanks for following up!
>
> Arnd