summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorNeil Brown <neilb@cse.unsw.edu.au>2002-07-18 19:07:59 -0700
committerTrond Myklebust <trond.myklebust@fys.uio.no>2002-07-18 19:07:59 -0700
commit2a9400e9457cb5bc2bb54c987f38b6f96fa5430e (patch)
treea50f9dda9625e870ad0ec18065dc2927983028a7 /include
parent70e96bef8aacd89af3601f63d5d1236071d7d901 (diff)
[PATCH] MD - Rdev list cleanups.
Rdev list cleanups. An "rdev" can be on three different lists. - the list of all rdevs - the list of pending rdevs - the list of rdevs for a given mddev The first list is now only used to list "unused" devices in /proc/mdstat, and only pending rdevs can be unused, so this list isn't necessary. An rdev cannot be both pending and in an mddev, so we know rdev will only be on one list at at time. This patch discards the all_raid_disks list, and changes the pending list to use "same_set" in the rdev. It also changes /proc/mdstat to iterate through pending devices, rather than through all devices. So now an rdev is only on one list, either the pending list or the list of rdevs for a given mddev. This means that ITERATE_RDEV_GENERIC doesn't need to be told which field, to walk down: there is ony one.
Diffstat (limited to 'include')
-rw-r--r--include/linux/raid/md_k.h17
1 files changed, 4 insertions, 13 deletions
diff --git a/include/linux/raid/md_k.h b/include/linux/raid/md_k.h
index c31bcc0ee766..a59767eb6de7 100644
--- a/include/linux/raid/md_k.h
+++ b/include/linux/raid/md_k.h
@@ -143,8 +143,6 @@ static inline void mark_disk_nonsync(mdp_disk_t * d)
struct mdk_rdev_s
{
struct list_head same_set; /* RAID devices within the same set */
- struct list_head all; /* all RAID devices */
- struct list_head pending; /* undetected RAID devices */
kdev_t dev; /* Device number */
kdev_t old_dev; /* "" when it was last imported */
@@ -239,30 +237,23 @@ extern mdp_disk_t *get_spare(mddev_t *mddev);
* iterates through some rdev ringlist. It's safe to remove the
* current 'rdev'. Dont touch 'tmp' though.
*/
-#define ITERATE_RDEV_GENERIC(head,field,rdev,tmp) \
+#define ITERATE_RDEV_GENERIC(head,rdev,tmp) \
\
for ((tmp) = (head).next; \
- (rdev) = (list_entry((tmp), mdk_rdev_t, field)), \
+ (rdev) = (list_entry((tmp), mdk_rdev_t, same_set)), \
(tmp) = (tmp)->next, (tmp)->prev != &(head) \
; )
/*
* iterates through the 'same array disks' ringlist
*/
#define ITERATE_RDEV(mddev,rdev,tmp) \
- ITERATE_RDEV_GENERIC((mddev)->disks,same_set,rdev,tmp)
-
-
-/*
- * Iterates through all 'RAID managed disks'
- */
-#define ITERATE_RDEV_ALL(rdev,tmp) \
- ITERATE_RDEV_GENERIC(all_raid_disks,all,rdev,tmp)
+ ITERATE_RDEV_GENERIC((mddev)->disks,rdev,tmp)
/*
* Iterates through 'pending RAID disks'
*/
#define ITERATE_RDEV_PENDING(rdev,tmp) \
- ITERATE_RDEV_GENERIC(pending_raid_disks,pending,rdev,tmp)
+ ITERATE_RDEV_GENERIC(pending_raid_disks,rdev,tmp)
#define xchg_values(x,y) do { __typeof__(x) __tmp = x; \
x = y; y = __tmp; } while (0)