diff options
author | Arnd Bergmann <arnd@arndb.de> | 2016-11-22 15:20:16 +0100 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk@kernel.org> | 2016-11-25 19:16:09 +0100 |
commit | 19c526515f6b998039d5d71fea879d255f173746 (patch) | |
tree | 61e059110e7098bdc2959346f44fa31a5d5d7e64 /fs/f2fs | |
parent | f2fs: set ->owner for debugfs status file's file_operations (diff) | |
download | linux-19c526515f6b998039d5d71fea879d255f173746.tar.xz linux-19c526515f6b998039d5d71fea879d255f173746.zip |
f2fs: fix 32-bit build
The addition of multiple-device support broke CONFIG_BLK_DEV_ZONED
on 32-bit machines because of a 64-bit division:
fs/f2fs/f2fs.o: In function `__issue_discard_async':
extent_cache.c:(.text.__issue_discard_async+0xd4): undefined reference to `__aeabi_uldivmod'
Fortunately, bdev_zone_size() is guaranteed to return a power-of-two
number, so we can replace the % operator with a cheaper bit mask.
Fixes: 792b84b74b54 ("f2fs: support multiple devices")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs')
-rw-r--r-- | fs/f2fs/segment.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c index eaa0b40e1ba0..d5141a06b9a3 100644 --- a/fs/f2fs/segment.c +++ b/fs/f2fs/segment.c @@ -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) || + nr_sects != bdev_zone_size(bdev)) { f2fs_msg(sbi->sb, KERN_INFO, "(%d) %s: Unaligned discard attempted (block %x + %x)", devi, sbi->s_ndevs ? FDEV(devi).path: "", |