Commit 101a6427 authored by Boaz Harrosh's avatar Boaz Harrosh

ore: (trivial) reformat some code

rearrange some source lines. Nothing changed.
Signed-off-by: default avatarBoaz Harrosh <bharrosh@panasas.com>
parent d6d211db
...@@ -675,8 +675,8 @@ static int _prepare_for_striping(struct ore_io_state *ios) ...@@ -675,8 +675,8 @@ static int _prepare_for_striping(struct ore_io_state *ios)
si->cur_pg = si->unit_off / PAGE_SIZE; si->cur_pg = si->unit_off / PAGE_SIZE;
while (length) { while (length) {
unsigned comp = dev - first_dev; struct ore_per_dev_state *per_dev =
struct ore_per_dev_state *per_dev = &ios->per_dev[comp]; &ios->per_dev[dev - first_dev];
unsigned cur_len, page_off = 0; unsigned cur_len, page_off = 0;
if (!per_dev->length) { if (!per_dev->length) {
...@@ -708,11 +708,9 @@ static int _prepare_for_striping(struct ore_io_state *ios) ...@@ -708,11 +708,9 @@ static int _prepare_for_striping(struct ore_io_state *ios)
if (unlikely(ret)) if (unlikely(ret))
goto out; goto out;
dev += mirrors_p1;
dev = (dev % devs_in_group) + first_dev;
length -= cur_len; length -= cur_len;
dev = ((dev + mirrors_p1) % devs_in_group) + first_dev;
si->cur_comp = (si->cur_comp + 1) % group_width; si->cur_comp = (si->cur_comp + 1) % group_width;
if (unlikely((dev == si->par_dev) || (!length && ios->sp2d))) { if (unlikely((dev == si->par_dev) || (!length && ios->sp2d))) {
if (!length && ios->sp2d) { if (!length && ios->sp2d) {
...@@ -721,11 +719,6 @@ static int _prepare_for_striping(struct ore_io_state *ios) ...@@ -721,11 +719,6 @@ static int _prepare_for_striping(struct ore_io_state *ios)
*/ */
dev = si->par_dev; dev = si->par_dev;
} }
if (ios->sp2d)
/* In writes cur_len just means if it's the
* last one. See _ore_add_parity_unit.
*/
cur_len = length;
per_dev = &ios->per_dev[dev - first_dev]; per_dev = &ios->per_dev[dev - first_dev];
if (!per_dev->length) { if (!per_dev->length) {
/* Only/always the parity unit of the first /* Only/always the parity unit of the first
...@@ -736,7 +729,11 @@ static int _prepare_for_striping(struct ore_io_state *ios) ...@@ -736,7 +729,11 @@ static int _prepare_for_striping(struct ore_io_state *ios)
per_dev->offset = si->obj_offset - si->unit_off; per_dev->offset = si->obj_offset - si->unit_off;
} }
ret = _ore_add_parity_unit(ios, si, per_dev, cur_len); /* In writes cur_len just means if it's the
* last one. See _ore_add_parity_unit.
*/
ret = _ore_add_parity_unit(ios, si, per_dev,
ios->sp2d ? length : cur_len);
if (unlikely(ret)) if (unlikely(ret))
goto out; goto out;
......
...@@ -226,9 +226,7 @@ static void _gen_xor_unit(struct __stripe_pages_2d *sp2d) ...@@ -226,9 +226,7 @@ static void _gen_xor_unit(struct __stripe_pages_2d *sp2d)
init_async_submit(&_1ps->submit, init_async_submit(&_1ps->submit,
ASYNC_TX_XOR_ZERO_DST | ASYNC_TX_ACK, ASYNC_TX_XOR_ZERO_DST | ASYNC_TX_ACK,
NULL, NULL, NULL, NULL, (addr_conv_t *)_1ps->scribble);
NULL, NULL,
(addr_conv_t *)_1ps->scribble);
/* TODO: raid6 */ /* TODO: raid6 */
_1ps->tx = async_xor(_1ps->pages[sp2d->data_devs], _1ps->pages, _1ps->tx = async_xor(_1ps->pages[sp2d->data_devs], _1ps->pages,
......
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