summaryrefslogtreecommitdiffstats
path: root/drivers/md
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2014-09-25 17:43:47 +1000
committerNeilBrown <neilb@suse.de>2014-10-14 13:08:28 +1100
commit0638bb0e732fa2c839fceec93fc02e2347e0f596 (patch)
treeb03ef8d06fd4305177e2e8f85ebaa1d4d90d3b15 /drivers/md
parent4878e9eb88c3a3223de68760e64dd71da01a3118 (diff)
downloadop-kernel-dev-0638bb0e732fa2c839fceec93fc02e2347e0f596.zip
op-kernel-dev-0638bb0e732fa2c839fceec93fc02e2347e0f596.tar.gz
md: simplify export_array()
We don't really need that for_each loop, or those MD_BUGs. Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'drivers/md')
-rw-r--r--drivers/md/md.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/drivers/md/md.c b/drivers/md/md.c
index 73451f3..d96aa80 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -2187,17 +2187,13 @@ static void kick_rdev_from_array(struct md_rdev * rdev)
static void export_array(struct mddev *mddev)
{
- struct md_rdev *rdev, *tmp;
+ struct md_rdev *rdev;
- rdev_for_each_safe(rdev, tmp, mddev) {
- if (!rdev->mddev) {
- MD_BUG();
- continue;
- }
+ while (!list_empty(&mddev->disks)) {
+ rdev = list_first_entry(&mddev->disks, struct md_rdev,
+ same_set);
kick_rdev_from_array(rdev);
}
- if (!list_empty(&mddev->disks))
- MD_BUG();
mddev->raid_disks = 0;
mddev->major_version = 0;
}
OpenPOWER on IntegriCloud