summaryrefslogtreecommitdiff
path: root/include/linux/raid
diff options
context:
space:
mode:
authorNeil Brown <neilb@cse.unsw.edu.au>2004-06-04 20:56:50 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2004-06-04 20:56:50 -0700
commitf6a0ebcab2093d6bad49949df0ab055eb47cc07c (patch)
tree9a653ab8a30a61ce735f46fabf113209907d40d9 /include/linux/raid
parentf23b262d654bdf04a8d18b7f1d909930cc5695d6 (diff)
[PATCH] md: support reshaping raid1 arrays - adding or removing drives.
This allows the number of "raid_disks" in a raid1 to be changed. This requires allocating a new pool of "r1bio" structures which a different number of bios, suspending IO, and swapping the new pool in place of the old. (and a few other related changes). Signed-off-by: Neil Brown <neilb@cse.unsw.edu.au> 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/md_k.h1
-rw-r--r--include/linux/raid/raid1.h16
2 files changed, 17 insertions, 0 deletions
diff --git a/include/linux/raid/md_k.h b/include/linux/raid/md_k.h
index 1af736b37d0b..faa400cf25e4 100644
--- a/include/linux/raid/md_k.h
+++ b/include/linux/raid/md_k.h
@@ -280,6 +280,7 @@ struct mdk_personality_s
int (*spare_active) (mddev_t *mddev);
int (*sync_request)(mddev_t *mddev, sector_t sector_nr, int go_faster);
int (*resize) (mddev_t *mddev, sector_t sectors);
+ int (*reshape) (mddev_t *mddev, int raid_disks);
};
diff --git a/include/linux/raid/raid1.h b/include/linux/raid/raid1.h
index 96abcad3a307..50965d9680b6 100644
--- a/include/linux/raid/raid1.h
+++ b/include/linux/raid/raid1.h
@@ -10,6 +10,20 @@ struct mirror_info {
sector_t head_position;
};
+/*
+ * memory pools need a pointer to the mddev, so they can force an unplug
+ * when memory is tight, and a count of the number of drives that the
+ * pool was allocated for, so they know how much to allocate and free.
+ * mddev->raid_disks cannot be used, as it can change while a pool is active
+ * These two datums are stored in a kmalloced struct.
+ */
+
+struct pool_info {
+ mddev_t *mddev;
+ int raid_disks;
+};
+
+
typedef struct r1bio_s r1bio_t;
struct r1_private_data_s {
@@ -31,6 +45,8 @@ struct r1_private_data_s {
wait_queue_head_t wait_idle;
wait_queue_head_t wait_resume;
+ struct pool_info *poolinfo;
+
mempool_t *r1bio_pool;
mempool_t *r1buf_pool;
};