diff options
author | NeilBrown <neilb@suse.de> | 2006-03-27 04:18:11 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-03-27 11:45:01 -0500 |
commit | f67055780caac6a99f43834795c43acf99eba6a6 (patch) | |
tree | 6b80e7b4cb300edb0910dbad1d840ff8e2f36ae5 /include/linux/raid/md_p.h | |
parent | 292695531ae4019bb15deedc121b218d1908b648 (diff) |
[PATCH] md: Checkpoint and allow restart of raid5 reshape
We allow the superblock to record an 'old' and a 'new' geometry, and a
position where any conversion is up to. The geometry allows for changing
chunksize, layout and level as well as number of devices.
When using verion-0.90 superblock, we convert the version to 0.91 while the
conversion is happening so that an old kernel will refuse the assemble the
array. For version-1, we use a feature bit for the same effect.
When starting an array we check for an incomplete reshape and restart the
reshape process if needed. If the reshape stopped at an awkward time (like
when updating the first stripe) we refuse to assemble the array, and let
user-space worry about it.
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/md_p.h')
-rw-r--r-- | include/linux/raid/md_p.h | 32 |
1 files changed, 29 insertions, 3 deletions
diff --git a/include/linux/raid/md_p.h b/include/linux/raid/md_p.h index c100fa5d4bfa..774e1acfb8c4 100644 --- a/include/linux/raid/md_p.h +++ b/include/linux/raid/md_p.h | |||
@@ -102,6 +102,18 @@ typedef struct mdp_device_descriptor_s { | |||
102 | #define MD_SB_ERRORS 1 | 102 | #define MD_SB_ERRORS 1 |
103 | 103 | ||
104 | #define MD_SB_BITMAP_PRESENT 8 /* bitmap may be present nearby */ | 104 | #define MD_SB_BITMAP_PRESENT 8 /* bitmap may be present nearby */ |
105 | |||
106 | /* | ||
107 | * Notes: | ||
108 | * - if an array is being reshaped (restriped) in order to change the | ||
109 | * the number of active devices in the array, 'raid_disks' will be | ||
110 | * the larger of the old and new numbers. 'delta_disks' will | ||
111 | * be the "new - old". So if +ve, raid_disks is the new value, and | ||
112 | * "raid_disks-delta_disks" is the old. If -ve, raid_disks is the | ||
113 | * old value and "raid_disks+delta_disks" is the new (smaller) value. | ||
114 | */ | ||
115 | |||
116 | |||
105 | typedef struct mdp_superblock_s { | 117 | typedef struct mdp_superblock_s { |
106 | /* | 118 | /* |
107 | * Constant generic information | 119 | * Constant generic information |
@@ -146,7 +158,13 @@ typedef struct mdp_superblock_s { | |||
146 | __u32 cp_events_hi; /* 10 high-order of checkpoint update count */ | 158 | __u32 cp_events_hi; /* 10 high-order of checkpoint update count */ |
147 | #endif | 159 | #endif |
148 | __u32 recovery_cp; /* 11 recovery checkpoint sector count */ | 160 | __u32 recovery_cp; /* 11 recovery checkpoint sector count */ |
149 | __u32 gstate_sreserved[MD_SB_GENERIC_STATE_WORDS - 12]; | 161 | /* There are only valid for minor_version > 90 */ |
162 | __u64 reshape_position; /* 12,13 next address in array-space for reshape */ | ||
163 | __u32 new_level; /* 14 new level we are reshaping to */ | ||
164 | __u32 delta_disks; /* 15 change in number of raid_disks */ | ||
165 | __u32 new_layout; /* 16 new layout */ | ||
166 | __u32 new_chunk; /* 17 new chunk size (bytes) */ | ||
167 | __u32 gstate_sreserved[MD_SB_GENERIC_STATE_WORDS - 18]; | ||
150 | 168 | ||
151 | /* | 169 | /* |
152 | * Personality information | 170 | * Personality information |
@@ -207,7 +225,14 @@ struct mdp_superblock_1 { | |||
207 | * NOTE: signed, so bitmap can be before superblock | 225 | * NOTE: signed, so bitmap can be before superblock |
208 | * only meaningful of feature_map[0] is set. | 226 | * only meaningful of feature_map[0] is set. |
209 | */ | 227 | */ |
210 | __u8 pad1[128-100]; /* set to 0 when written */ | 228 | |
229 | /* These are only valid with feature bit '4' */ | ||
230 | __u64 reshape_position; /* next address in array-space for reshape */ | ||
231 | __u32 new_level; /* new level we are reshaping to */ | ||
232 | __u32 delta_disks; /* change in number of raid_disks */ | ||
233 | __u32 new_layout; /* new layout */ | ||
234 | __u32 new_chunk; /* new chunk size (bytes) */ | ||
235 | __u8 pad1[128-124]; /* set to 0 when written */ | ||
211 | 236 | ||
212 | /* constant this-device information - 64 bytes */ | 237 | /* constant this-device information - 64 bytes */ |
213 | __u64 data_offset; /* sector start of data, often 0 */ | 238 | __u64 data_offset; /* sector start of data, often 0 */ |
@@ -240,8 +265,9 @@ struct mdp_superblock_1 { | |||
240 | 265 | ||
241 | /* feature_map bits */ | 266 | /* feature_map bits */ |
242 | #define MD_FEATURE_BITMAP_OFFSET 1 | 267 | #define MD_FEATURE_BITMAP_OFFSET 1 |
268 | #define MD_FEATURE_RESHAPE_ACTIVE 4 | ||
243 | 269 | ||
244 | #define MD_FEATURE_ALL 1 | 270 | #define MD_FEATURE_ALL 5 |
245 | 271 | ||
246 | #endif | 272 | #endif |
247 | 273 | ||