提交 73c34431 编写于 作者: N NeilBrown 提交者: Linus Torvalds

md: change ITERATE_RDEV_GENERIC to rdev_for_each_list, and remove ITERATE_RDEV_PENDING.

Finish ITERATE_ to for_each conversion.
Signed-off-by: NNeil Brown <neilb@suse.de>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 d089c6af
...@@ -3766,7 +3766,7 @@ static void autorun_devices(int part) ...@@ -3766,7 +3766,7 @@ static void autorun_devices(int part)
printk(KERN_INFO "md: considering %s ...\n", printk(KERN_INFO "md: considering %s ...\n",
bdevname(rdev0->bdev,b)); bdevname(rdev0->bdev,b));
INIT_LIST_HEAD(&candidates); INIT_LIST_HEAD(&candidates);
ITERATE_RDEV_PENDING(rdev,tmp) rdev_for_each_list(rdev, tmp, pending_raid_disks)
if (super_90_load(rdev, rdev0, 0) >= 0) { if (super_90_load(rdev, rdev0, 0) >= 0) {
printk(KERN_INFO "md: adding %s ...\n", printk(KERN_INFO "md: adding %s ...\n",
bdevname(rdev->bdev,b)); bdevname(rdev->bdev,b));
...@@ -3810,7 +3810,7 @@ static void autorun_devices(int part) ...@@ -3810,7 +3810,7 @@ static void autorun_devices(int part)
} else { } else {
printk(KERN_INFO "md: created %s\n", mdname(mddev)); printk(KERN_INFO "md: created %s\n", mdname(mddev));
mddev->persistent = 1; mddev->persistent = 1;
ITERATE_RDEV_GENERIC(candidates,rdev,tmp) { rdev_for_each_list(rdev, tmp, candidates) {
list_del_init(&rdev->same_set); list_del_init(&rdev->same_set);
if (bind_rdev_to_array(rdev, mddev)) if (bind_rdev_to_array(rdev, mddev))
export_rdev(rdev); export_rdev(rdev);
...@@ -3821,7 +3821,7 @@ static void autorun_devices(int part) ...@@ -3821,7 +3821,7 @@ static void autorun_devices(int part)
/* on success, candidates will be empty, on error /* on success, candidates will be empty, on error
* it won't... * it won't...
*/ */
ITERATE_RDEV_GENERIC(candidates,rdev,tmp) rdev_for_each_list(rdev, tmp, candidates)
export_rdev(rdev); export_rdev(rdev);
mddev_put(mddev); mddev_put(mddev);
} }
...@@ -4936,7 +4936,7 @@ static void status_unused(struct seq_file *seq) ...@@ -4936,7 +4936,7 @@ static void status_unused(struct seq_file *seq)
seq_printf(seq, "unused devices: "); seq_printf(seq, "unused devices: ");
ITERATE_RDEV_PENDING(rdev,tmp) { rdev_for_each_list(rdev, tmp, pending_raid_disks) {
char b[BDEVNAME_SIZE]; char b[BDEVNAME_SIZE];
i++; i++;
seq_printf(seq, "%s ", seq_printf(seq, "%s ",
......
...@@ -313,23 +313,17 @@ static inline char * mdname (mddev_t * mddev) ...@@ -313,23 +313,17 @@ static inline char * mdname (mddev_t * mddev)
* iterates through some rdev ringlist. It's safe to remove the * iterates through some rdev ringlist. It's safe to remove the
* current 'rdev'. Dont touch 'tmp' though. * current 'rdev'. Dont touch 'tmp' though.
*/ */
#define ITERATE_RDEV_GENERIC(head,rdev,tmp) \ #define rdev_for_each_list(rdev, tmp, list) \
\ \
for ((tmp) = (head).next; \ for ((tmp) = (list).next; \
(rdev) = (list_entry((tmp), mdk_rdev_t, same_set)), \ (rdev) = (list_entry((tmp), mdk_rdev_t, same_set)), \
(tmp) = (tmp)->next, (tmp)->prev != &(head) \ (tmp) = (tmp)->next, (tmp)->prev != &(list) \
; ) ; )
/* /*
* iterates through the 'same array disks' ringlist * iterates through the 'same array disks' ringlist
*/ */
#define rdev_for_each(rdev, tmp, mddev) \ #define rdev_for_each(rdev, tmp, mddev) \
ITERATE_RDEV_GENERIC((mddev)->disks,rdev,tmp) rdev_for_each_list(rdev, tmp, (mddev)->disks)
/*
* Iterates through 'pending RAID disks'
*/
#define ITERATE_RDEV_PENDING(rdev,tmp) \
ITERATE_RDEV_GENERIC(pending_raid_disks,rdev,tmp)
typedef struct mdk_thread_s { typedef struct mdk_thread_s {
void (*run) (mddev_t *mddev); void (*run) (mddev_t *mddev);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册