diff options
Diffstat (limited to 'include/linux/raid/md_k.h')
-rw-r--r-- | include/linux/raid/md_k.h | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/include/linux/raid/md_k.h b/include/linux/raid/md_k.h index 663803eaf0d..8f9a54c1fb0 100644 --- a/include/linux/raid/md_k.h +++ b/include/linux/raid/md_k.h | |||
@@ -335,17 +335,14 @@ static inline char * mdname (mddev_t * mddev) | |||
335 | * iterates through some rdev ringlist. It's safe to remove the | 335 | * iterates through some rdev ringlist. It's safe to remove the |
336 | * current 'rdev'. Dont touch 'tmp' though. | 336 | * current 'rdev'. Dont touch 'tmp' though. |
337 | */ | 337 | */ |
338 | #define rdev_for_each_list(rdev, tmp, list) \ | 338 | #define rdev_for_each_list(rdev, tmp, head) \ |
339 | \ | 339 | list_for_each_entry_safe(rdev, tmp, head, same_set) |
340 | for ((tmp) = (list).next; \ | 340 | |
341 | (rdev) = (list_entry((tmp), mdk_rdev_t, same_set)), \ | ||
342 | (tmp) = (tmp)->next, (tmp)->prev != &(list) \ | ||
343 | ; ) | ||
344 | /* | 341 | /* |
345 | * iterates through the 'same array disks' ringlist | 342 | * iterates through the 'same array disks' ringlist |
346 | */ | 343 | */ |
347 | #define rdev_for_each(rdev, tmp, mddev) \ | 344 | #define rdev_for_each(rdev, tmp, mddev) \ |
348 | rdev_for_each_list(rdev, tmp, (mddev)->disks) | 345 | list_for_each_entry_safe(rdev, tmp, &((mddev)->disks), same_set) |
349 | 346 | ||
350 | #define rdev_for_each_rcu(rdev, mddev) \ | 347 | #define rdev_for_each_rcu(rdev, mddev) \ |
351 | list_for_each_entry_rcu(rdev, &((mddev)->disks), same_set) | 348 | list_for_each_entry_rcu(rdev, &((mddev)->disks), same_set) |