aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md
diff options
context:
space:
mode:
authorRobert P. J. Day <rpjday@crashcourse.ca>2008-04-24 16:42:44 -0400
committerAlasdair G Kergon <agk@redhat.com>2008-04-25 08:26:36 -0400
commitc12bfc923ee02de5611730ddec087c11b3947038 (patch)
tree0b90122bfeaefc1acd78f4d968c29e03cf322ce9 /drivers/md
parent8ee2767a5903fde549fd3597690f64c8d951051a (diff)
dm raid1: use list_split_init
Use shorter list_splice_init() for brevity. Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca> Signed-off-by: Alasdair G Kergon <agk@redhat.com>
Diffstat (limited to 'drivers/md')
-rw-r--r--drivers/md/dm-raid1.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/drivers/md/dm-raid1.c b/drivers/md/dm-raid1.c
index 762cb086bb7f..64489e714c95 100644
--- a/drivers/md/dm-raid1.c
+++ b/drivers/md/dm-raid1.c
@@ -405,24 +405,22 @@ static void rh_update_states(struct region_hash *rh)
405 write_lock_irq(&rh->hash_lock); 405 write_lock_irq(&rh->hash_lock);
406 spin_lock(&rh->region_lock); 406 spin_lock(&rh->region_lock);
407 if (!list_empty(&rh->clean_regions)) { 407 if (!list_empty(&rh->clean_regions)) {
408 list_splice(&rh->clean_regions, &clean); 408 list_splice_init(&rh->clean_regions, &clean);
409 INIT_LIST_HEAD(&rh->clean_regions);
410 409
411 list_for_each_entry(reg, &clean, list) 410 list_for_each_entry(reg, &clean, list)
412 list_del(&reg->hash_list); 411 list_del(&reg->hash_list);
413 } 412 }
414 413
415 if (!list_empty(&rh->recovered_regions)) { 414 if (!list_empty(&rh->recovered_regions)) {
416 list_splice(&rh->recovered_regions, &recovered); 415 list_splice_init(&rh->recovered_regions, &recovered);
417 INIT_LIST_HEAD(&rh->recovered_regions);
418 416
419 list_for_each_entry (reg, &recovered, list) 417 list_for_each_entry (reg, &recovered, list)
420 list_del(&reg->hash_list); 418 list_del(&reg->hash_list);
421 } 419 }
422 420
423 if (!list_empty(&rh->failed_recovered_regions)) { 421 if (!list_empty(&rh->failed_recovered_regions)) {
424 list_splice(&rh->failed_recovered_regions, &failed_recovered); 422 list_splice_init(&rh->failed_recovered_regions,
425 INIT_LIST_HEAD(&rh->failed_recovered_regions); 423 &failed_recovered);
426 424
427 list_for_each_entry(reg, &failed_recovered, list) 425 list_for_each_entry(reg, &failed_recovered, list)
428 list_del(&reg->hash_list); 426 list_del(&reg->hash_list);