From: Shaohua Li <shli@kernel.org>
To: linux-raid@vger.kernel.org, neilb@suse.de
Subject: [patch 2/3]raid5: make raid_run_ops take reference of ops_request
Date: Thu, 22 May 2014 19:24:50 +0800 [thread overview]
Message-ID: <20140522112450.GB10509@kernel.org> (raw)
Next patch will make handle_stripe() call raid_run_ops several times, so we
need clear the operations which already are handled to avoid they are handled
multiple times.
Signed-off-by: Shaohua Li <shli@fusionio.com>
---
drivers/md/raid5.c | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
Index: linux/drivers/md/raid5.c
===================================================================
--- linux.orig/drivers/md/raid5.c 2014-05-22 14:41:05.603276379 +0800
+++ linux/drivers/md/raid5.c 2014-05-22 14:51:03.007766003 +0800
@@ -1612,7 +1612,7 @@ static void ops_run_check_pq(struct stri
&sh->ops.zero_sum_result, percpu->spare_page, &submit);
}
-static void raid_run_ops(struct stripe_head *sh, unsigned long ops_request)
+static void raid_run_ops(struct stripe_head *sh, unsigned long *ops_request)
{
int overlap_clear = 0, i, disks = sh->disks;
struct dma_async_tx_descriptor *tx = NULL;
@@ -1623,12 +1623,12 @@ static void raid_run_ops(struct stripe_h
cpu = get_cpu();
percpu = per_cpu_ptr(conf->percpu, cpu);
- if (test_bit(STRIPE_OP_BIOFILL, &ops_request)) {
+ if (__test_and_clear_bit(STRIPE_OP_BIOFILL, ops_request)) {
ops_run_biofill(sh);
overlap_clear++;
}
- if (test_bit(STRIPE_OP_COMPUTE_BLK, &ops_request)) {
+ if (__test_and_clear_bit(STRIPE_OP_COMPUTE_BLK, ops_request)) {
if (level < 6)
tx = ops_run_compute5(sh, percpu);
else {
@@ -1638,26 +1638,26 @@ static void raid_run_ops(struct stripe_h
tx = ops_run_compute6_2(sh, percpu);
}
/* terminate the chain if reconstruct is not set to be run */
- if (tx && !test_bit(STRIPE_OP_RECONSTRUCT, &ops_request))
+ if (tx && !test_bit(STRIPE_OP_RECONSTRUCT, ops_request))
async_tx_ack(tx);
}
- if (test_bit(STRIPE_OP_PREXOR, &ops_request))
+ if (__test_and_clear_bit(STRIPE_OP_PREXOR, ops_request))
tx = ops_run_prexor(sh, percpu, tx);
- if (test_bit(STRIPE_OP_BIODRAIN, &ops_request)) {
+ if (__test_and_clear_bit(STRIPE_OP_BIODRAIN, ops_request)) {
tx = ops_run_biodrain(sh, tx);
overlap_clear++;
}
- if (test_bit(STRIPE_OP_RECONSTRUCT, &ops_request)) {
+ if (__test_and_clear_bit(STRIPE_OP_RECONSTRUCT, ops_request)) {
if (level < 6)
ops_run_reconstruct5(sh, percpu, tx);
else
ops_run_reconstruct6(sh, percpu, tx);
}
- if (test_bit(STRIPE_OP_CHECK, &ops_request)) {
+ if (__test_and_clear_bit(STRIPE_OP_CHECK, ops_request)) {
if (sh->check_state == check_state_run)
ops_run_check_p(sh, percpu);
else if (sh->check_state == check_state_run_q)
@@ -3981,7 +3981,7 @@ finish:
}
if (s.ops_request)
- raid_run_ops(sh, s.ops_request);
+ raid_run_ops(sh, &s.ops_request);
ops_run_io(sh, &s);
reply other threads:[~2014-05-22 11:24 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20140522112450.GB10509@kernel.org \
--to=shli@kernel.org \
--cc=linux-raid@vger.kernel.org \
--cc=neilb@suse.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.