aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/scrub.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/btrfs/scrub.c')
-rw-r--r--fs/btrfs/scrub.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/fs/btrfs/scrub.c b/fs/btrfs/scrub.c
index db21f17df996..07be15d4ce7b 100644
--- a/fs/btrfs/scrub.c
+++ b/fs/btrfs/scrub.c
@@ -2624,9 +2624,8 @@ static int get_raid56_logic_offset(u64 physical, int num,
2624 for (i = 0; i < nr_data_stripes(map); i++) { 2624 for (i = 0; i < nr_data_stripes(map); i++) {
2625 *offset = last_offset + i * map->stripe_len; 2625 *offset = last_offset + i * map->stripe_len;
2626 2626
2627 stripe_nr = *offset; 2627 stripe_nr = div_u64(*offset, map->stripe_len);
2628 do_div(stripe_nr, map->stripe_len); 2628 stripe_nr = div_u64(stripe_nr, nr_data_stripes(map));
2629 do_div(stripe_nr, nr_data_stripes(map));
2630 2629
2631 /* Work out the disk rotation on this stripe-set */ 2630 /* Work out the disk rotation on this stripe-set */
2632 rot = do_div(stripe_nr, map->num_stripes); 2631 rot = do_div(stripe_nr, map->num_stripes);
@@ -2995,10 +2994,9 @@ static noinline_for_stack int scrub_stripe(struct scrub_ctx *sctx,
2995 int extent_mirror_num; 2994 int extent_mirror_num;
2996 int stop_loop = 0; 2995 int stop_loop = 0;
2997 2996
2998 nstripes = length;
2999 physical = map->stripes[num].physical; 2997 physical = map->stripes[num].physical;
3000 offset = 0; 2998 offset = 0;
3001 do_div(nstripes, map->stripe_len); 2999 nstripes = div_u64(length, map->stripe_len);
3002 if (map->type & BTRFS_BLOCK_GROUP_RAID0) { 3000 if (map->type & BTRFS_BLOCK_GROUP_RAID0) {
3003 offset = map->stripe_len * num; 3001 offset = map->stripe_len * num;
3004 increment = map->stripe_len * map->num_stripes; 3002 increment = map->stripe_len * map->num_stripes;