diff options
author | Boaz Harrosh <bharrosh@panasas.com> | 2014-04-03 10:53:31 -0400 |
---|---|---|
committer | Boaz Harrosh <bharrosh@panasas.com> | 2014-05-22 07:45:21 -0400 |
commit | 101a642781cf6b37848c5468d6c1a20a76c35ea9 (patch) | |
tree | 2b0c11576456b8d21bc468502d321b1983c214f5 /fs | |
parent | d6d211db37e75de2ddc3a4f979038c40df7cc79c (diff) |
ore: (trivial) reformat some code
rearrange some source lines. Nothing changed.
Signed-off-by: Boaz Harrosh <bharrosh@panasas.com>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/exofs/ore.c | 19 | ||||
-rw-r--r-- | fs/exofs/ore_raid.c | 4 |
2 files changed, 9 insertions, 14 deletions
diff --git a/fs/exofs/ore.c b/fs/exofs/ore.c index dae884694bd9..92157b6971b3 100644 --- a/fs/exofs/ore.c +++ b/fs/exofs/ore.c | |||
@@ -675,8 +675,8 @@ static int _prepare_for_striping(struct ore_io_state *ios) | |||
675 | si->cur_pg = si->unit_off / PAGE_SIZE; | 675 | si->cur_pg = si->unit_off / PAGE_SIZE; |
676 | 676 | ||
677 | while (length) { | 677 | while (length) { |
678 | unsigned comp = dev - first_dev; | 678 | struct ore_per_dev_state *per_dev = |
679 | struct ore_per_dev_state *per_dev = &ios->per_dev[comp]; | 679 | &ios->per_dev[dev - first_dev]; |
680 | unsigned cur_len, page_off = 0; | 680 | unsigned cur_len, page_off = 0; |
681 | 681 | ||
682 | if (!per_dev->length) { | 682 | if (!per_dev->length) { |
@@ -708,11 +708,9 @@ static int _prepare_for_striping(struct ore_io_state *ios) | |||
708 | if (unlikely(ret)) | 708 | if (unlikely(ret)) |
709 | goto out; | 709 | goto out; |
710 | 710 | ||
711 | dev += mirrors_p1; | ||
712 | dev = (dev % devs_in_group) + first_dev; | ||
713 | |||
714 | length -= cur_len; | 711 | length -= cur_len; |
715 | 712 | ||
713 | dev = ((dev + mirrors_p1) % devs_in_group) + first_dev; | ||
716 | si->cur_comp = (si->cur_comp + 1) % group_width; | 714 | si->cur_comp = (si->cur_comp + 1) % group_width; |
717 | if (unlikely((dev == si->par_dev) || (!length && ios->sp2d))) { | 715 | if (unlikely((dev == si->par_dev) || (!length && ios->sp2d))) { |
718 | if (!length && ios->sp2d) { | 716 | if (!length && ios->sp2d) { |
@@ -721,11 +719,6 @@ static int _prepare_for_striping(struct ore_io_state *ios) | |||
721 | */ | 719 | */ |
722 | dev = si->par_dev; | 720 | dev = si->par_dev; |
723 | } | 721 | } |
724 | if (ios->sp2d) | ||
725 | /* In writes cur_len just means if it's the | ||
726 | * last one. See _ore_add_parity_unit. | ||
727 | */ | ||
728 | cur_len = length; | ||
729 | per_dev = &ios->per_dev[dev - first_dev]; | 722 | per_dev = &ios->per_dev[dev - first_dev]; |
730 | if (!per_dev->length) { | 723 | if (!per_dev->length) { |
731 | /* Only/always the parity unit of the first | 724 | /* Only/always the parity unit of the first |
@@ -736,7 +729,11 @@ static int _prepare_for_striping(struct ore_io_state *ios) | |||
736 | per_dev->offset = si->obj_offset - si->unit_off; | 729 | per_dev->offset = si->obj_offset - si->unit_off; |
737 | } | 730 | } |
738 | 731 | ||
739 | ret = _ore_add_parity_unit(ios, si, per_dev, cur_len); | 732 | /* In writes cur_len just means if it's the |
733 | * last one. See _ore_add_parity_unit. | ||
734 | */ | ||
735 | ret = _ore_add_parity_unit(ios, si, per_dev, | ||
736 | ios->sp2d ? length : cur_len); | ||
740 | if (unlikely(ret)) | 737 | if (unlikely(ret)) |
741 | goto out; | 738 | goto out; |
742 | 739 | ||
diff --git a/fs/exofs/ore_raid.c b/fs/exofs/ore_raid.c index 4e2c032ab8a1..af417d351535 100644 --- a/fs/exofs/ore_raid.c +++ b/fs/exofs/ore_raid.c | |||
@@ -226,9 +226,7 @@ static void _gen_xor_unit(struct __stripe_pages_2d *sp2d) | |||
226 | 226 | ||
227 | init_async_submit(&_1ps->submit, | 227 | init_async_submit(&_1ps->submit, |
228 | ASYNC_TX_XOR_ZERO_DST | ASYNC_TX_ACK, | 228 | ASYNC_TX_XOR_ZERO_DST | ASYNC_TX_ACK, |
229 | NULL, | 229 | NULL, NULL, NULL, (addr_conv_t *)_1ps->scribble); |
230 | NULL, NULL, | ||
231 | (addr_conv_t *)_1ps->scribble); | ||
232 | 230 | ||
233 | /* TODO: raid6 */ | 231 | /* TODO: raid6 */ |
234 | _1ps->tx = async_xor(_1ps->pages[sp2d->data_devs], _1ps->pages, | 232 | _1ps->tx = async_xor(_1ps->pages[sp2d->data_devs], _1ps->pages, |