All of lore.kernel.org
 help / color / mirror / Atom feed
From: Boaz Harrosh <bharrosh@panasas.com>
To: open-osd <osd-dev@open-osd.org>,
	NFS list <linux-nfs@vger.kernel.org>,
	Daniel Gryniewicz <dang@linuxbox.com>,
	Elizabeth Ellenbogen Ziph <elizabeth@linuxbox.com>,
	"Pathak, Santosh" <santoshp@panasas.com>,
	linux-fsdevel <linux-fsdevel@vger.kernel.org>
Cc: Tigran Mkrtchyan <tigran.mkrtchyan@desy.de>,
	Benny Halevy <bhalevy@primarydata.com>,
	Sachin bhamare <sachin.bhamare@gmail.com>
Subject: [PATCH 1/3] ore: (trivial) reformat some code
Date: Thu, 22 May 2014 16:07:38 +0300	[thread overview]
Message-ID: <537DF69A.5020602@panasas.com> (raw)
In-Reply-To: <537DF5B4.4070001@panasas.com>


rearrange some source lines. Nothing changed.

Signed-off-by: Boaz Harrosh <bharrosh@panasas.com>
---
 fs/exofs/ore.c      | 19 ++++++++-----------
 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 dae8846..92157b6 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;
 
diff --git a/fs/exofs/ore_raid.c b/fs/exofs/ore_raid.c
index 4e2c032..af417d3 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)
 
 		init_async_submit(&_1ps->submit,
 			ASYNC_TX_XOR_ZERO_DST | ASYNC_TX_ACK,
-			NULL,
-			NULL, NULL,
-			(addr_conv_t *)_1ps->scribble);
+			NULL, NULL, NULL, (addr_conv_t *)_1ps->scribble);
 
 		/* TODO: raid6 */
 		_1ps->tx = async_xor(_1ps->pages[sp2d->data_devs], _1ps->pages,
-- 
1.9.0



WARNING: multiple messages have this Message-ID (diff)
From: Boaz Harrosh <bharrosh-C4P08NqkoRlBDgjK7y7TUQ@public.gmane.org>
To: open-osd <osd-dev-yNzVSZO3znNg9hUCZPvPmw@public.gmane.org>,
	NFS list <linux-nfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	Daniel Gryniewicz <dang-Jp3n8lUXroRWk0Htik3J/w@public.gmane.org>,
	Elizabeth Ellenbogen Ziph
	<elizabeth-Jp3n8lUXroRWk0Htik3J/w@public.gmane.org>,
	"Pathak,
	Santosh" <santoshp-C4P08NqkoRlBDgjK7y7TUQ@public.gmane.org>,
	linux-fsdevel
	<linux-fsdevel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Cc: Tigran Mkrtchyan <tigran.mkrtchyan-T5F83Mi6MZE@public.gmane.org>,
	Benny Halevy <bhalevy-7I+n7zu2hftEKMMhf/gKZA@public.gmane.org>,
	Sachin bhamare
	<sachin.bhamare-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Subject: [PATCH 1/3] ore: (trivial) reformat some code
Date: Thu, 22 May 2014 16:07:38 +0300	[thread overview]
Message-ID: <537DF69A.5020602@panasas.com> (raw)
In-Reply-To: <537DF5B4.4070001-C4P08NqkoRlBDgjK7y7TUQ@public.gmane.org>


rearrange some source lines. Nothing changed.

Signed-off-by: Boaz Harrosh <bharrosh-C4P08NqkoRlBDgjK7y7TUQ@public.gmane.org>
---
 fs/exofs/ore.c      | 19 ++++++++-----------
 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 dae8846..92157b6 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;
 
diff --git a/fs/exofs/ore_raid.c b/fs/exofs/ore_raid.c
index 4e2c032..af417d3 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)
 
 		init_async_submit(&_1ps->submit,
 			ASYNC_TX_XOR_ZERO_DST | ASYNC_TX_ACK,
-			NULL,
-			NULL, NULL,
-			(addr_conv_t *)_1ps->scribble);
+			NULL, NULL, NULL, (addr_conv_t *)_1ps->scribble);
 
 		/* TODO: raid6 */
 		_1ps->tx = async_xor(_1ps->pages[sp2d->data_devs], _1ps->pages,
-- 
1.9.0


--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2014-05-22 13:08 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-22 13:03 [PACHSET 0/3] ore: raid6 Boaz Harrosh
2014-05-22 13:03 ` Boaz Harrosh
2014-05-22 13:07 ` Boaz Harrosh [this message]
2014-05-22 13:07   ` [PATCH 1/3] ore: (trivial) reformat some code Boaz Harrosh
2014-05-22 13:08 ` [PATCH 2/3] ore: Remove redundant dev_order(), more cleanups Boaz Harrosh
2014-05-22 13:11 ` [PATCH 3/3] ore: Support for raid 6 Boaz Harrosh
2014-05-22 13:11   ` Boaz Harrosh
  -- strict thread matches above, loose matches on Subject: below --
2014-04-10 10:45 [RFC 0/3] ore: raid6 Boaz Harrosh
2014-04-10 10:49 ` [PATCH 1/3] ore: (trivial) reformat some code Boaz Harrosh
2014-04-11 11:12   ` Mkrtchyan, Tigran
2014-04-12  9:07     ` Boaz Harrosh

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=537DF69A.5020602@panasas.com \
    --to=bharrosh@panasas.com \
    --cc=bhalevy@primarydata.com \
    --cc=dang@linuxbox.com \
    --cc=elizabeth@linuxbox.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-nfs@vger.kernel.org \
    --cc=osd-dev@open-osd.org \
    --cc=sachin.bhamare@gmail.com \
    --cc=santoshp@panasas.com \
    --cc=tigran.mkrtchyan@desy.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.