Commit 83c3e5e1 authored by Yufen Yu's avatar Yufen Yu Committed by Song Liu

md/raid5: use do_div() for 64 bit divisions in raid5_sync_request

We get compilation error on 32-bit architectures (e.g. m68k), as:

  ERROR: modpost: "__udivdi3" [drivers/md/raid456.ko] undefined!

Since 'sync_blocks' is defined as u64, use do_div() to fix this error.

Fixes: c911c46c ("md/raid456: convert macro STRIPE_* to RAID5_STRIPE_*")
Signed-off-by: default avatarYufen Yu <yuyufen@huawei.com>
Signed-off-by: default avatarSong Liu <songliubraving@fb.com>
parent ef67744e
...@@ -6104,7 +6104,7 @@ static inline sector_t raid5_sync_request(struct mddev *mddev, sector_t sector_n ...@@ -6104,7 +6104,7 @@ static inline sector_t raid5_sync_request(struct mddev *mddev, sector_t sector_n
!md_bitmap_start_sync(mddev->bitmap, sector_nr, &sync_blocks, 1) && !md_bitmap_start_sync(mddev->bitmap, sector_nr, &sync_blocks, 1) &&
sync_blocks >= RAID5_STRIPE_SECTORS(conf)) { sync_blocks >= RAID5_STRIPE_SECTORS(conf)) {
/* we can skip this block, and probably more */ /* we can skip this block, and probably more */
sync_blocks /= RAID5_STRIPE_SECTORS(conf); do_div(sync_blocks, RAID5_STRIPE_SECTORS(conf));
*skipped = 1; *skipped = 1;
/* keep things rounded to whole stripes */ /* keep things rounded to whole stripes */
return sync_blocks * RAID5_STRIPE_SECTORS(conf); return sync_blocks * RAID5_STRIPE_SECTORS(conf);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment