diff options
Diffstat (limited to 'drivers/md/raid1.h')
-rw-r--r-- | drivers/md/raid1.h | 30 |
1 files changed, 8 insertions, 22 deletions
diff --git a/drivers/md/raid1.h b/drivers/md/raid1.h index 80ded139314c..0ff3715fb7eb 100644 --- a/drivers/md/raid1.h +++ b/drivers/md/raid1.h | |||
@@ -1,9 +1,15 @@ | |||
1 | #ifndef _RAID1_H | 1 | #ifndef _RAID1_H |
2 | #define _RAID1_H | 2 | #define _RAID1_H |
3 | 3 | ||
4 | struct mirror_info { | 4 | struct raid1_info { |
5 | struct md_rdev *rdev; | 5 | struct md_rdev *rdev; |
6 | sector_t head_position; | 6 | sector_t head_position; |
7 | |||
8 | /* When choose the best device for a read (read_balance()) | ||
9 | * we try to keep sequential reads one the same device | ||
10 | */ | ||
11 | sector_t next_seq_sect; | ||
12 | sector_t seq_start; | ||
7 | }; | 13 | }; |
8 | 14 | ||
9 | /* | 15 | /* |
@@ -24,17 +30,11 @@ struct pool_info { | |||
24 | 30 | ||
25 | struct r1conf { | 31 | struct r1conf { |
26 | struct mddev *mddev; | 32 | struct mddev *mddev; |
27 | struct mirror_info *mirrors; /* twice 'raid_disks' to | 33 | struct raid1_info *mirrors; /* twice 'raid_disks' to |
28 | * allow for replacements. | 34 | * allow for replacements. |
29 | */ | 35 | */ |
30 | int raid_disks; | 36 | int raid_disks; |
31 | 37 | ||
32 | /* When choose the best device for a read (read_balance()) | ||
33 | * we try to keep sequential reads one the same device | ||
34 | * using 'last_used' and 'next_seq_sect' | ||
35 | */ | ||
36 | int last_used; | ||
37 | sector_t next_seq_sect; | ||
38 | /* During resync, read_balancing is only allowed on the part | 38 | /* During resync, read_balancing is only allowed on the part |
39 | * of the array that has been resynced. 'next_resync' tells us | 39 | * of the array that has been resynced. 'next_resync' tells us |
40 | * where that is. | 40 | * where that is. |
@@ -135,20 +135,6 @@ struct r1bio { | |||
135 | /* DO NOT PUT ANY NEW FIELDS HERE - bios array is contiguously alloced*/ | 135 | /* DO NOT PUT ANY NEW FIELDS HERE - bios array is contiguously alloced*/ |
136 | }; | 136 | }; |
137 | 137 | ||
138 | /* when we get a read error on a read-only array, we redirect to another | ||
139 | * device without failing the first device, or trying to over-write to | ||
140 | * correct the read error. To keep track of bad blocks on a per-bio | ||
141 | * level, we store IO_BLOCKED in the appropriate 'bios' pointer | ||
142 | */ | ||
143 | #define IO_BLOCKED ((struct bio *)1) | ||
144 | /* When we successfully write to a known bad-block, we need to remove the | ||
145 | * bad-block marking which must be done from process context. So we record | ||
146 | * the success by setting bios[n] to IO_MADE_GOOD | ||
147 | */ | ||
148 | #define IO_MADE_GOOD ((struct bio *)2) | ||
149 | |||
150 | #define BIO_SPECIAL(bio) ((unsigned long)bio <= 2) | ||
151 | |||
152 | /* bits for r1bio.state */ | 138 | /* bits for r1bio.state */ |
153 | #define R1BIO_Uptodate 0 | 139 | #define R1BIO_Uptodate 0 |
154 | #define R1BIO_IsSync 1 | 140 | #define R1BIO_IsSync 1 |