summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorNeil Brown <neilb@cse.unsw.edu.au>2003-05-26 07:05:55 -0700
committerLinus Torvalds <torvalds@home.transmeta.com>2003-05-26 07:05:55 -0700
commit31458043214802d7bb86552a420f2a7e3c81e1b7 (patch)
tree2d3c4b9427390efd065c85fc65ff3ff5567a0004 /include/linux
parent757400c3f3d5d732d04fb9b20cf45797387a3917 (diff)
[PATCH] md: Remove MD_SB_DISKS limits from raid1
raid1 uses MD_SB_DISKS to size two data structures, but the new version-1 superblock allows for more than this number of disks (and most actual arrays use many fewer). This patch sizes to two arrays dynamically. One becomes a separate kmalloced array. The other is moved to the end of the containing structure and appropriate extra space is allocated. Also, change r1buf_pool_alloc (which allocates buffers for a mempool for doing re-sync) to not get r1bio structures from the r1bio pool (which could exhaust the pool) but instead to allocate them separately.
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/raid/raid1.h11
1 files changed, 6 insertions, 5 deletions
diff --git a/include/linux/raid/raid1.h b/include/linux/raid/raid1.h
index cc7aa899a613..a9d1161ccab3 100644
--- a/include/linux/raid/raid1.h
+++ b/include/linux/raid/raid1.h
@@ -14,7 +14,7 @@ typedef struct r1bio_s r1bio_t;
struct r1_private_data_s {
mddev_t *mddev;
- mirror_info_t mirrors[MD_SB_DISKS];
+ mirror_info_t *mirrors;
int raid_disks;
int working_disks;
int last_used;
@@ -67,13 +67,14 @@ struct r1bio_s {
*/
struct bio *read_bio;
int read_disk;
- /*
- * if the IO is in WRITE direction, then multiple bios are used:
- */
- struct bio *write_bios[MD_SB_DISKS];
r1bio_t *next_r1; /* next for retry or in free list */
struct list_head retry_list;
+ /*
+ * if the IO is in WRITE direction, then multiple bios are used.
+ * We choose the number when they are allocated.
+ */
+ struct bio *write_bios[0];
};
/* bits for r1bio.state */