aboutsummaryrefslogtreecommitdiffstats
path: root/fs/exofs/ore_raid.c
diff options
context:
space:
mode:
authorBoaz Harrosh <bharrosh@panasas.com>2014-04-09 16:14:38 -0400
committerBoaz Harrosh <bharrosh@panasas.com>2014-05-22 07:46:15 -0400
commit455682ce547817d75e38028283dc8db00754005d (patch)
tree6de1f6d9e370cb4015444e6884c59fa86e7f28ce /fs/exofs/ore_raid.c
parent101a642781cf6b37848c5468d6c1a20a76c35ea9 (diff)
ore: Remove redundant dev_order(), more cleanups
Two cleanups: * si->cur_comp, si->cur_pg where always calculated after the call to ore_calc_stripe_info() with the help of _dev_order(...). But these are already calculated by ore_calc_stripe_info() and can be just set there. (This is left over from the time that si->cur_comp, si->cur_pg were only used by raid code, but now the main loop manages them anyway even though they are ultimately not used in none raid code) * si->cur_comp - For the very last stripe case, was set inside _ore_add_parity_unit(). This is not clear and will be wrong for coming raid6 so move this to only caller. Now si->cur_comp is only manipulated within _prepare_for_striping(), always next to the manipulation of cur_dev. Which is much easier to understand and follow. Signed-off-by: Boaz Harrosh <bharrosh@panasas.com>
Diffstat (limited to 'fs/exofs/ore_raid.c')
-rw-r--r--fs/exofs/ore_raid.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/fs/exofs/ore_raid.c b/fs/exofs/ore_raid.c
index af417d351535..d58a952e28bc 100644
--- a/fs/exofs/ore_raid.c
+++ b/fs/exofs/ore_raid.c
@@ -402,9 +402,8 @@ static int _add_to_r4w_last_page(struct ore_io_state *ios, u64 *offset)
402 402
403 ore_calc_stripe_info(ios->layout, *offset, 0, &si); 403 ore_calc_stripe_info(ios->layout, *offset, 0, &si);
404 404
405 p = si.unit_off / PAGE_SIZE; 405 p = si.cur_pg;
406 c = _dev_order(ios->layout->group_width * ios->layout->mirrors_p1, 406 c = si.cur_comp;
407 ios->layout->mirrors_p1, si.par_dev, si.dev);
408 page = ios->sp2d->_1p_stripes[p].pages[c]; 407 page = ios->sp2d->_1p_stripes[p].pages[c];
409 408
410 pg_len = PAGE_SIZE - (si.unit_off % PAGE_SIZE); 409 pg_len = PAGE_SIZE - (si.unit_off % PAGE_SIZE);
@@ -532,9 +531,8 @@ static int _read_4_write_last_stripe(struct ore_io_state *ios)
532 goto read_it; 531 goto read_it;
533 532
534 ore_calc_stripe_info(ios->layout, offset, 0, &read_si); 533 ore_calc_stripe_info(ios->layout, offset, 0, &read_si);
535 p = read_si.unit_off / PAGE_SIZE; 534 p = read_si.cur_pg;
536 c = _dev_order(ios->layout->group_width * ios->layout->mirrors_p1, 535 c = read_si.cur_comp;
537 ios->layout->mirrors_p1, read_si.par_dev, read_si.dev);
538 536
539 if (min_p == sp2d->pages_in_unit) { 537 if (min_p == sp2d->pages_in_unit) {
540 /* Didn't do it yet */ 538 /* Didn't do it yet */
@@ -638,9 +636,6 @@ int _ore_add_parity_unit(struct ore_io_state *ios,
638 si->cur_pg = _sp2d_min_pg(sp2d); 636 si->cur_pg = _sp2d_min_pg(sp2d);
639 num_pages = _sp2d_max_pg(sp2d) + 1 - si->cur_pg; 637 num_pages = _sp2d_max_pg(sp2d) + 1 - si->cur_pg;
640 638
641 if (!cur_len) /* If last stripe operate on parity comp */
642 si->cur_comp = sp2d->data_devs;
643
644 if (!per_dev->length) { 639 if (!per_dev->length) {
645 per_dev->offset += si->cur_pg * PAGE_SIZE; 640 per_dev->offset += si->cur_pg * PAGE_SIZE;
646 /* If first stripe, Read in all read4write pages 641 /* If first stripe, Read in all read4write pages