summaryrefslogtreecommitdiffstats
path: root/fs/exofs/ore.c
diff options
context:
space:
mode:
authorBoaz Harrosh <bharrosh@panasas.com>2014-04-03 17:53:31 +0300
committerBoaz Harrosh <bharrosh@panasas.com>2014-05-22 14:45:21 +0300
commit101a642781cf6b37848c5468d6c1a20a76c35ea9 (patch)
tree2b0c11576456b8d21bc468502d321b1983c214f5 /fs/exofs/ore.c
parentd6d211db37e75de2ddc3a4f979038c40df7cc79c (diff)
downloadlinux-101a642781cf6b37848c5468d6c1a20a76c35ea9.tar.bz2
ore: (trivial) reformat some code
rearrange some source lines. Nothing changed. Signed-off-by: Boaz Harrosh <bharrosh@panasas.com>
Diffstat (limited to 'fs/exofs/ore.c')
-rw-r--r--fs/exofs/ore.c19
1 files changed, 8 insertions, 11 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)
si->cur_pg = si->unit_off / PAGE_SIZE;
while (length) {
- unsigned comp = dev - first_dev;
- struct ore_per_dev_state *per_dev = &ios->per_dev[comp];
+ struct ore_per_dev_state *per_dev =
+ &ios->per_dev[dev - first_dev];
unsigned cur_len, page_off = 0;
if (!per_dev->length) {
@@ -708,11 +708,9 @@ static int _prepare_for_striping(struct ore_io_state *ios)
if (unlikely(ret))
goto out;
- dev += mirrors_p1;
- dev = (dev % devs_in_group) + first_dev;
-
length -= cur_len;
+ dev = ((dev + mirrors_p1) % devs_in_group) + first_dev;
si->cur_comp = (si->cur_comp + 1) % group_width;
if (unlikely((dev == si->par_dev) || (!length && ios->sp2d))) {
if (!length && ios->sp2d) {
@@ -721,11 +719,6 @@ static int _prepare_for_striping(struct ore_io_state *ios)
*/
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];
if (!per_dev->length) {
/* Only/always the parity unit of the first
@@ -736,7 +729,11 @@ static int _prepare_for_striping(struct ore_io_state *ios)
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))
goto out;