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

From: Arnd Bergmann
Date: Wed Nov 23 2016 - 16:06:30 EST


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.

> @@ -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