aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/raid
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2006-03-27 04:18:07 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2006-03-27 11:45:01 -0500
commitad01c9e3752f4ba4f3d99c89b7370fa4983a25b5 (patch)
tree856868aa97332d6d15d4cad412e0ebe3576bb571 /include/linux/raid
parentb55e6bfcd23cb2f7249095050c649f7aea813f9f (diff)
[PATCH] md: Allow stripes to be expanded in preparation for expanding an array
Before a RAID-5 can be expanded, we need to be able to expand the stripe-cache data structure. This requires allocating new stripes in a new kmem_cache. If this succeeds, we copy cache pages over and release the old stripes and kmem_cache. We then allocate new pages. If that fails, we leave the stripe cache at it's new size. It isn't worth the effort to shrink it back again. Unfortuanately this means we need two kmem_cache names as we, for a short period of time, we have two kmem_caches. So they are raid5/%s and raid5/%s-alt 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/linux/raid')
-rw-r--r--include/linux/raid/raid5.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/include/linux/raid/raid5.h b/include/linux/raid/raid5.h
index 94dbdd406f12..b7b2653af7bb 100644
--- a/include/linux/raid/raid5.h
+++ b/include/linux/raid/raid5.h
@@ -216,7 +216,11 @@ struct raid5_private_data {
216 struct list_head bitmap_list; /* stripes delaying awaiting bitmap update */ 216 struct list_head bitmap_list; /* stripes delaying awaiting bitmap update */
217 atomic_t preread_active_stripes; /* stripes with scheduled io */ 217 atomic_t preread_active_stripes; /* stripes with scheduled io */
218 218
219 char cache_name[20]; 219 /* unfortunately we need two cache names as we temporarily have
220 * two caches.
221 */
222 int active_name;
223 char cache_name[2][20];
220 kmem_cache_t *slab_cache; /* for allocating stripes */ 224 kmem_cache_t *slab_cache; /* for allocating stripes */
221 225
222 int seq_flush, seq_write; 226 int seq_flush, seq_write;
@@ -238,7 +242,8 @@ struct raid5_private_data {
238 wait_queue_head_t wait_for_overlap; 242 wait_queue_head_t wait_for_overlap;
239 int inactive_blocked; /* release of inactive stripes blocked, 243 int inactive_blocked; /* release of inactive stripes blocked,
240 * waiting for 25% to be free 244 * waiting for 25% to be free
241 */ 245 */
246 int pool_size; /* number of disks in stripeheads in pool */
242 spinlock_t device_lock; 247 spinlock_t device_lock;
243 struct disk_info *disks; 248 struct disk_info *disks;
244}; 249};