linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dan Williams <dan.j.williams@intel.com>
To: neilb@suse.de
Cc: linux-raid@vger.kernel.org, yur@emcraft.com
Subject: [PATCH 1/8] md/raid5: factor out mark_uptodate from ops_complete_compute5
Date: Wed, 03 Jun 2009 18:29:03 -0700	[thread overview]
Message-ID: <20090604012903.11507.39866.stgit@dwillia2-linux.ch.intel.com> (raw)
In-Reply-To: <20090604012709.11507.15528.stgit@dwillia2-linux.ch.intel.com>

ops_complete_compute5 can be reused in the raid6 path if it is updated to
generically handle a second target.

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
---
 drivers/md/raid5.c |   21 ++++++++++++++++-----
 1 files changed, 16 insertions(+), 5 deletions(-)

diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c
index 48aa114..45eeefd 100644
--- a/drivers/md/raid5.c
+++ b/drivers/md/raid5.c
@@ -651,18 +651,29 @@ static void ops_run_biofill(struct stripe_head *sh)
 	async_trigger_callback(&submit);
 }
 
+static void mark_target_uptodate(struct stripe_head *sh, int target)
+{
+	struct r5dev *tgt;
+
+	if (target < 0)
+		return;
+
+	tgt = &sh->dev[target];
+	set_bit(R5_UPTODATE, &tgt->flags);
+	BUG_ON(!test_bit(R5_Wantcompute, &tgt->flags));
+	clear_bit(R5_Wantcompute, &tgt->flags);
+}
+
 static void ops_complete_compute5(void *stripe_head_ref)
 {
 	struct stripe_head *sh = stripe_head_ref;
-	int target = sh->ops.target;
-	struct r5dev *tgt = &sh->dev[target];
 
 	pr_debug("%s: stripe %llu\n", __func__,
 		(unsigned long long)sh->sector);
 
-	set_bit(R5_UPTODATE, &tgt->flags);
-	BUG_ON(!test_bit(R5_Wantcompute, &tgt->flags));
-	clear_bit(R5_Wantcompute, &tgt->flags);
+	/* mark the computed target as uptodate */
+	mark_target_uptodate(sh, sh->ops.target);
+
 	clear_bit(STRIPE_COMPUTE_RUN, &sh->state);
 	if (sh->check_state == check_state_compute_run)
 		sh->check_state = check_state_compute_result;


  reply	other threads:[~2009-06-04  1:29 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-04  1:28 [PATCH 0/8] Asynchronous raid6 acceleration (part 3 of 3) Dan Williams
2009-06-04  1:29 ` Dan Williams [this message]
2009-06-04  1:29 ` [PATCH 2/8] md/raid6: asynchronous raid6 operations Dan Williams
2009-06-04  6:33   ` Neil Brown
2009-06-04  1:29 ` [PATCH 3/8] md/raid5,6: common schedule_reconstruction for raid5/6 Dan Williams
2009-06-04  1:29 ` [PATCH 4/8] md/raid6: asynchronous handle_stripe_fill6 Dan Williams
2009-06-04  6:37   ` Neil Brown
2009-06-04  1:29 ` [PATCH 5/8] md/raid6: asynchronous handle_stripe_dirtying6 Dan Williams
2009-06-04  1:29 ` [PATCH 6/8] md/raid6: asynchronous handle_parity_check6 Dan Williams
2009-06-04  1:29 ` [PATCH 7/8] md/raid6: asynchronous handle_stripe6 Dan Williams
2009-06-04  1:29 ` [PATCH 8/8] md/raid6: remove synchronous infrastructure Dan Williams

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=20090604012903.11507.39866.stgit@dwillia2-linux.ch.intel.com \
    --to=dan.j.williams@intel.com \
    --cc=linux-raid@vger.kernel.org \
    --cc=neilb@suse.de \
    --cc=yur@emcraft.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).