diff options
author | NeilBrown <neilb@suse.de> | 2008-02-06 04:39:59 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2008-02-06 13:41:19 -0500 |
commit | 73c34431c7119d0bc7d3436abfad75fe47b2c51f (patch) | |
tree | c91210130d1115354f011e55c98db9361d4416f8 | |
parent | d089c6af10c2be5988f03667d6d22fe6085fbe5e (diff) |
md: change ITERATE_RDEV_GENERIC to rdev_for_each_list, and remove ITERATE_RDEV_PENDING.
Finish ITERATE_ to for_each conversion.
Signed-off-by: Neil Brown <neilb@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r-- | drivers/md/md.c | 8 | ||||
-rw-r--r-- | include/linux/raid/md_k.h | 14 |
2 files changed, 8 insertions, 14 deletions
diff --git a/drivers/md/md.c b/drivers/md/md.c index e02022864f08..5fc326d3970e 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c | |||
@@ -3766,7 +3766,7 @@ static void autorun_devices(int part) | |||
3766 | printk(KERN_INFO "md: considering %s ...\n", | 3766 | printk(KERN_INFO "md: considering %s ...\n", |
3767 | bdevname(rdev0->bdev,b)); | 3767 | bdevname(rdev0->bdev,b)); |
3768 | INIT_LIST_HEAD(&candidates); | 3768 | INIT_LIST_HEAD(&candidates); |
3769 | ITERATE_RDEV_PENDING(rdev,tmp) | 3769 | rdev_for_each_list(rdev, tmp, pending_raid_disks) |
3770 | if (super_90_load(rdev, rdev0, 0) >= 0) { | 3770 | if (super_90_load(rdev, rdev0, 0) >= 0) { |
3771 | printk(KERN_INFO "md: adding %s ...\n", | 3771 | printk(KERN_INFO "md: adding %s ...\n", |
3772 | bdevname(rdev->bdev,b)); | 3772 | bdevname(rdev->bdev,b)); |
@@ -3810,7 +3810,7 @@ static void autorun_devices(int part) | |||
3810 | } else { | 3810 | } else { |
3811 | printk(KERN_INFO "md: created %s\n", mdname(mddev)); | 3811 | printk(KERN_INFO "md: created %s\n", mdname(mddev)); |
3812 | mddev->persistent = 1; | 3812 | mddev->persistent = 1; |
3813 | ITERATE_RDEV_GENERIC(candidates,rdev,tmp) { | 3813 | rdev_for_each_list(rdev, tmp, candidates) { |
3814 | list_del_init(&rdev->same_set); | 3814 | list_del_init(&rdev->same_set); |
3815 | if (bind_rdev_to_array(rdev, mddev)) | 3815 | if (bind_rdev_to_array(rdev, mddev)) |
3816 | export_rdev(rdev); | 3816 | export_rdev(rdev); |
@@ -3821,7 +3821,7 @@ static void autorun_devices(int part) | |||
3821 | /* on success, candidates will be empty, on error | 3821 | /* on success, candidates will be empty, on error |
3822 | * it won't... | 3822 | * it won't... |
3823 | */ | 3823 | */ |
3824 | ITERATE_RDEV_GENERIC(candidates,rdev,tmp) | 3824 | rdev_for_each_list(rdev, tmp, candidates) |
3825 | export_rdev(rdev); | 3825 | export_rdev(rdev); |
3826 | mddev_put(mddev); | 3826 | mddev_put(mddev); |
3827 | } | 3827 | } |
@@ -4936,7 +4936,7 @@ static void status_unused(struct seq_file *seq) | |||
4936 | 4936 | ||
4937 | seq_printf(seq, "unused devices: "); | 4937 | seq_printf(seq, "unused devices: "); |
4938 | 4938 | ||
4939 | ITERATE_RDEV_PENDING(rdev,tmp) { | 4939 | rdev_for_each_list(rdev, tmp, pending_raid_disks) { |
4940 | char b[BDEVNAME_SIZE]; | 4940 | char b[BDEVNAME_SIZE]; |
4941 | i++; | 4941 | i++; |
4942 | seq_printf(seq, "%s ", | 4942 | seq_printf(seq, "%s ", |
diff --git a/include/linux/raid/md_k.h b/include/linux/raid/md_k.h index 9c19555f314b..85a068bab625 100644 --- a/include/linux/raid/md_k.h +++ b/include/linux/raid/md_k.h | |||
@@ -313,23 +313,17 @@ static inline char * mdname (mddev_t * mddev) | |||
313 | * iterates through some rdev ringlist. It's safe to remove the | 313 | * iterates through some rdev ringlist. It's safe to remove the |
314 | * current 'rdev'. Dont touch 'tmp' though. | 314 | * current 'rdev'. Dont touch 'tmp' though. |
315 | */ | 315 | */ |
316 | #define ITERATE_RDEV_GENERIC(head,rdev,tmp) \ | 316 | #define rdev_for_each_list(rdev, tmp, list) \ |
317 | \ | 317 | \ |
318 | for ((tmp) = (head).next; \ | 318 | for ((tmp) = (list).next; \ |
319 | (rdev) = (list_entry((tmp), mdk_rdev_t, same_set)), \ | 319 | (rdev) = (list_entry((tmp), mdk_rdev_t, same_set)), \ |
320 | (tmp) = (tmp)->next, (tmp)->prev != &(head) \ | 320 | (tmp) = (tmp)->next, (tmp)->prev != &(list) \ |
321 | ; ) | 321 | ; ) |
322 | /* | 322 | /* |
323 | * iterates through the 'same array disks' ringlist | 323 | * iterates through the 'same array disks' ringlist |
324 | */ | 324 | */ |
325 | #define rdev_for_each(rdev, tmp, mddev) \ | 325 | #define rdev_for_each(rdev, tmp, mddev) \ |
326 | ITERATE_RDEV_GENERIC((mddev)->disks,rdev,tmp) | 326 | rdev_for_each_list(rdev, tmp, (mddev)->disks) |
327 | |||
328 | /* | ||
329 | * Iterates through 'pending RAID disks' | ||
330 | */ | ||
331 | #define ITERATE_RDEV_PENDING(rdev,tmp) \ | ||
332 | ITERATE_RDEV_GENERIC(pending_raid_disks,rdev,tmp) | ||
333 | 327 | ||
334 | typedef struct mdk_thread_s { | 328 | typedef struct mdk_thread_s { |
335 | void (*run) (mddev_t *mddev); | 329 | void (*run) (mddev_t *mddev); |