aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/raid1.h
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2011-12-22 18:17:56 -0500
committerNeilBrown <neilb@suse.de>2011-12-22 18:17:56 -0500
commit8f19ccb2fd70deb1f278be5e75076074cfddee46 (patch)
tree59419e814d4d02dfdefaf6f5ef152c3468c890e8 /drivers/md/raid1.h
parent301946364e0aa67c4cfaec82e94c389993c9f7c6 (diff)
md/raid1: Allocate spare to store replacement devices and their bios.
In RAID1, a replacement is much like a normal device, so we just double the size of the relevant arrays and look at all possible devices for reads and writes. This means that the array looks like it is now double the size in some way - we need to be careful about that. In particular, we checking if the array is still degraded while creating a recovery request we need to only consider the first 'half' - i.e. the real (non-replacement) devices. Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'drivers/md/raid1.h')
-rw-r--r--drivers/md/raid1.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/md/raid1.h b/drivers/md/raid1.h
index c732b6cce935..80ded139314c 100644
--- a/drivers/md/raid1.h
+++ b/drivers/md/raid1.h
@@ -12,6 +12,9 @@ struct mirror_info {
12 * pool was allocated for, so they know how much to allocate and free. 12 * pool was allocated for, so they know how much to allocate and free.
13 * mddev->raid_disks cannot be used, as it can change while a pool is active 13 * mddev->raid_disks cannot be used, as it can change while a pool is active
14 * These two datums are stored in a kmalloced struct. 14 * These two datums are stored in a kmalloced struct.
15 * The 'raid_disks' here is twice the raid_disks in r1conf.
16 * This allows space for each 'real' device can have a replacement in the
17 * second half of the array.
15 */ 18 */
16 19
17struct pool_info { 20struct pool_info {
@@ -21,7 +24,9 @@ struct pool_info {
21 24
22struct r1conf { 25struct r1conf {
23 struct mddev *mddev; 26 struct mddev *mddev;
24 struct mirror_info *mirrors; 27 struct mirror_info *mirrors; /* twice 'raid_disks' to
28 * allow for replacements.
29 */
25 int raid_disks; 30 int raid_disks;
26 31
27 /* When choose the best device for a read (read_balance()) 32 /* When choose the best device for a read (read_balance())