aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2006-03-27 04:18:08 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2006-03-27 11:45:01 -0500
commit7ecaa1e6a1ad69862e9980b6c777e11f26c4782d (patch)
tree3cbd64ebc2a45f6b5ac45b0305fd3cf2c6916070 /include
parentad01c9e3752f4ba4f3d99c89b7370fa4983a25b5 (diff)
[PATCH] md: Infrastructure to allow normal IO to continue while array is expanding
We need to allow that different stripes are of different effective sizes, and use the appropriate size. Also, when a stripe is being expanded, we must block any IO attempts until the stripe is stable again. Key elements in this change are: - each stripe_head gets a 'disk' field which is part of the key, thus there can sometimes be two stripe heads of the same area of the array, but covering different numbers of devices. One of these will be marked STRIPE_EXPANDING and so won't accept new requests. - conf->expand_progress tracks how the expansion is progressing and is used to determine whether the target part of the array has been expanded yet or not. Signed-off-by: Neil Brown <neilb@suse.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include')
-rw-r--r--include/linux/raid/raid5.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/linux/raid/raid5.h b/include/linux/raid/raid5.h
index b7b2653af7bb..6fa274aea2a0 100644
--- a/include/linux/raid/raid5.h
+++ b/include/linux/raid/raid5.h
@@ -135,6 +135,7 @@ struct stripe_head {
135 atomic_t count; /* nr of active thread/requests */ 135 atomic_t count; /* nr of active thread/requests */
136 spinlock_t lock; 136 spinlock_t lock;
137 int bm_seq; /* sequence number for bitmap flushes */ 137 int bm_seq; /* sequence number for bitmap flushes */
138 int disks; /* disks in stripe */
138 struct r5dev { 139 struct r5dev {
139 struct bio req; 140 struct bio req;
140 struct bio_vec vec; 141 struct bio_vec vec;
@@ -174,6 +175,7 @@ struct stripe_head {
174#define STRIPE_DELAYED 6 175#define STRIPE_DELAYED 6
175#define STRIPE_DEGRADED 7 176#define STRIPE_DEGRADED 7
176#define STRIPE_BIT_DELAY 8 177#define STRIPE_BIT_DELAY 8
178#define STRIPE_EXPANDING 9
177 179
178/* 180/*
179 * Plugging: 181 * Plugging:
@@ -211,6 +213,10 @@ struct raid5_private_data {
211 int raid_disks, working_disks, failed_disks; 213 int raid_disks, working_disks, failed_disks;
212 int max_nr_stripes; 214 int max_nr_stripes;
213 215
216 /* used during an expand */
217 sector_t expand_progress; /* MaxSector when no expand happening */
218 int previous_raid_disks;
219
214 struct list_head handle_list; /* stripes needing handling */ 220 struct list_head handle_list; /* stripes needing handling */
215 struct list_head delayed_list; /* stripes that have plugged requests */ 221 struct list_head delayed_list; /* stripes that have plugged requests */
216 struct list_head bitmap_list; /* stripes delaying awaiting bitmap update */ 222 struct list_head bitmap_list; /* stripes delaying awaiting bitmap update */