aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/raid5.c
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2012-03-18 21:46:39 -0400
committerNeilBrown <neilb@suse.de>2012-03-18 21:46:39 -0400
commitdafb20fa34320a472deb7442f25a0c086e0feb33 (patch)
tree2ff501805f8a6d08119f1f1a7248f579d52e491b /drivers/md/raid5.c
parentd6b42dcb995e6acd7cc276774e751ffc9f0ef4bf (diff)
md: tidy up rdev_for_each usage.
md.h has an 'rdev_for_each()' macro for iterating the rdevs in an mddev. However it uses the 'safe' version of list_for_each_entry, and so requires the extra variable, but doesn't include 'safe' in the name, which is useful documentation. Consequently some places use this safe version without needing it, and many use an explicity list_for_each entry. So: - rename rdev_for_each to rdev_for_each_safe - create a new rdev_for_each which uses the plain list_for_each_entry, - use the 'safe' version only where needed, and convert all other list_for_each_entry calls to use rdev_for_each. Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'drivers/md/raid5.c')
-rw-r--r--drivers/md/raid5.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c
index d38d235cc39d..23ac880bba9a 100644
--- a/drivers/md/raid5.c
+++ b/drivers/md/raid5.c
@@ -4842,7 +4842,7 @@ static struct r5conf *setup_conf(struct mddev *mddev)
4842 4842
4843 pr_debug("raid456: run(%s) called.\n", mdname(mddev)); 4843 pr_debug("raid456: run(%s) called.\n", mdname(mddev));
4844 4844
4845 list_for_each_entry(rdev, &mddev->disks, same_set) { 4845 rdev_for_each(rdev, mddev) {
4846 raid_disk = rdev->raid_disk; 4846 raid_disk = rdev->raid_disk;
4847 if (raid_disk >= max_disks 4847 if (raid_disk >= max_disks
4848 || raid_disk < 0) 4848 || raid_disk < 0)
@@ -5177,7 +5177,7 @@ static int run(struct mddev *mddev)
5177 blk_queue_io_opt(mddev->queue, chunk_size * 5177 blk_queue_io_opt(mddev->queue, chunk_size *
5178 (conf->raid_disks - conf->max_degraded)); 5178 (conf->raid_disks - conf->max_degraded));
5179 5179
5180 list_for_each_entry(rdev, &mddev->disks, same_set) 5180 rdev_for_each(rdev, mddev)
5181 disk_stack_limits(mddev->gendisk, rdev->bdev, 5181 disk_stack_limits(mddev->gendisk, rdev->bdev,
5182 rdev->data_offset << 9); 5182 rdev->data_offset << 9);
5183 } 5183 }
@@ -5500,7 +5500,7 @@ static int raid5_start_reshape(struct mddev *mddev)
5500 if (!check_stripe_cache(mddev)) 5500 if (!check_stripe_cache(mddev))
5501 return -ENOSPC; 5501 return -ENOSPC;
5502 5502
5503 list_for_each_entry(rdev, &mddev->disks, same_set) 5503 rdev_for_each(rdev, mddev)
5504 if (!test_bit(In_sync, &rdev->flags) 5504 if (!test_bit(In_sync, &rdev->flags)
5505 && !test_bit(Faulty, &rdev->flags)) 5505 && !test_bit(Faulty, &rdev->flags))
5506 spares++; 5506 spares++;
@@ -5546,7 +5546,7 @@ static int raid5_start_reshape(struct mddev *mddev)
5546 * such devices during the reshape and confusion could result. 5546 * such devices during the reshape and confusion could result.
5547 */ 5547 */
5548 if (mddev->delta_disks >= 0) { 5548 if (mddev->delta_disks >= 0) {
5549 list_for_each_entry(rdev, &mddev->disks, same_set) 5549 rdev_for_each(rdev, mddev)
5550 if (rdev->raid_disk < 0 && 5550 if (rdev->raid_disk < 0 &&
5551 !test_bit(Faulty, &rdev->flags)) { 5551 !test_bit(Faulty, &rdev->flags)) {
5552 if (raid5_add_disk(mddev, rdev) == 0) { 5552 if (raid5_add_disk(mddev, rdev) == 0) {