aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/md/raid5.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c
index 1c8ab340a11d..46fd651539fe 100644
--- a/drivers/md/raid5.c
+++ b/drivers/md/raid5.c
@@ -1351,10 +1351,9 @@ static int page_is_zero(struct page *p)
1351static int stripe_to_pdidx(sector_t stripe, raid5_conf_t *conf, int disks) 1351static int stripe_to_pdidx(sector_t stripe, raid5_conf_t *conf, int disks)
1352{ 1352{
1353 int sectors_per_chunk = conf->chunk_size >> 9; 1353 int sectors_per_chunk = conf->chunk_size >> 9;
1354 sector_t x = stripe;
1355 int pd_idx, dd_idx; 1354 int pd_idx, dd_idx;
1356 int chunk_offset = sector_div(x, sectors_per_chunk); 1355 int chunk_offset = sector_div(stripe, sectors_per_chunk);
1357 stripe = x; 1356
1358 raid5_compute_sector(stripe*(disks-1)*sectors_per_chunk 1357 raid5_compute_sector(stripe*(disks-1)*sectors_per_chunk
1359 + chunk_offset, disks, disks-1, &dd_idx, &pd_idx, conf); 1358 + chunk_offset, disks, disks-1, &dd_idx, &pd_idx, conf);
1360 return pd_idx; 1359 return pd_idx;