aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2015-05-20 21:50:16 -0400
committerNeilBrown <neilb@suse.de>2015-05-27 21:36:06 -0400
commit4e3d62ff4976f26d22b8b91572a49136bb3a23f1 (patch)
treea02289e88db74dfc3f750bbd43e7303cffd5383f
parentb15a9dbdbfe72848b7ed4cd3f97fe80daaf99c89 (diff)
md/raid5: remove condition test from check_break_stripe_batch_list.
handle_stripe_clean_event() contains a chunk of code very similar to check_break_stripe_batch_list(). If we make the latter more like the former, we can end up with just one copy of this code. This first step removed the condition (and the 'check_') part of the name. This has the added advantage of making it clear what check is being performed at the point where the function is called. Signed-off-by: NeilBrown <neilb@suse.de>
-rw-r--r--drivers/md/raid5.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c
index e58736740bac..fc5c4039c394 100644
--- a/drivers/md/raid5.c
+++ b/drivers/md/raid5.c
@@ -4234,16 +4234,11 @@ static int clear_batch_ready(struct stripe_head *sh)
4234 return 0; 4234 return 0;
4235} 4235}
4236 4236
4237static void check_break_stripe_batch_list(struct stripe_head *sh) 4237static void break_stripe_batch_list(struct stripe_head *head_sh)
4238{ 4238{
4239 struct stripe_head *head_sh, *next; 4239 struct stripe_head *sh, *next;
4240 int i; 4240 int i;
4241 4241
4242 if (!test_and_clear_bit(STRIPE_BATCH_ERR, &sh->state))
4243 return;
4244
4245 head_sh = sh;
4246
4247 list_for_each_entry_safe(sh, next, &head_sh->batch_list, batch_list) { 4242 list_for_each_entry_safe(sh, next, &head_sh->batch_list, batch_list) {
4248 4243
4249 list_del_init(&sh->batch_list); 4244 list_del_init(&sh->batch_list);
@@ -4290,7 +4285,8 @@ static void handle_stripe(struct stripe_head *sh)
4290 return; 4285 return;
4291 } 4286 }
4292 4287
4293 check_break_stripe_batch_list(sh); 4288 if (test_and_clear_bit(STRIPE_BATCH_ERR, &sh->state))
4289 break_stripe_batch_list(sh);
4294 4290
4295 if (test_bit(STRIPE_SYNC_REQUESTED, &sh->state) && !sh->batch_head) { 4291 if (test_bit(STRIPE_SYNC_REQUESTED, &sh->state) && !sh->batch_head) {
4296 spin_lock(&sh->stripe_lock); 4292 spin_lock(&sh->stripe_lock);