diff options
author | NeilBrown <neilb@suse.de> | 2012-03-18 21:46:39 -0400 |
---|---|---|
committer | NeilBrown <neilb@suse.de> | 2012-03-18 21:46:39 -0400 |
commit | dafb20fa34320a472deb7442f25a0c086e0feb33 (patch) | |
tree | 2ff501805f8a6d08119f1f1a7248f579d52e491b /drivers/md/md.h | |
parent | d6b42dcb995e6acd7cc276774e751ffc9f0ef4bf (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/md.h')
-rw-r--r-- | drivers/md/md.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/md/md.h b/drivers/md/md.h index 44c63dfeeb2b..39acfe90cc26 100644 --- a/drivers/md/md.h +++ b/drivers/md/md.h | |||
@@ -519,7 +519,10 @@ static inline void sysfs_unlink_rdev(struct mddev *mddev, struct md_rdev *rdev) | |||
519 | /* | 519 | /* |
520 | * iterates through the 'same array disks' ringlist | 520 | * iterates through the 'same array disks' ringlist |
521 | */ | 521 | */ |
522 | #define rdev_for_each(rdev, tmp, mddev) \ | 522 | #define rdev_for_each(rdev, mddev) \ |
523 | list_for_each_entry(rdev, &((mddev)->disks), same_set) | ||
524 | |||
525 | #define rdev_for_each_safe(rdev, tmp, mddev) \ | ||
523 | list_for_each_entry_safe(rdev, tmp, &((mddev)->disks), same_set) | 526 | list_for_each_entry_safe(rdev, tmp, &((mddev)->disks), same_set) |
524 | 527 | ||
525 | #define rdev_for_each_rcu(rdev, mddev) \ | 528 | #define rdev_for_each_rcu(rdev, mddev) \ |