aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/raid
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2012-05-20 19:27:00 -0400
committerNeilBrown <neilb@suse.de>2012-05-20 19:27:00 -0400
commit2c810cddc44d6f95cef75df3f07fc0850ff92417 (patch)
tree185b35ce06656a53327dd66343f0926aa5a910d7 /include/linux/raid
parentb5e1b8cee7ad58a15d2fa79bcd7946acb592602d (diff)
md: allow a reshape operation to be reversed.
Currently a reshape operation always progresses from the start of the array to the end unless the number of devices is being reduced, in which case it progressed in the opposite direction. To reverse a partial reshape which changes the number of devices you can stop the array and re-assemble with the raid-disks numbers reversed and it will undo. However for a reshape that does not change the number of devices it is not possible to reverse the reshape in the middle - you have to wait until it completes. So add a 'reshape_direction' attribute with is either 'forwards' or 'backwards' and can be explicitly set when delta_disks is zero. This will become more important when we allow the data_offset to change in a reshape. Then the explicit statement of what direction is being used will be more useful. This can be enabled in raid5 trivially as it already supports reverse reshape and just needs to use a different trigger to request it. Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'include/linux/raid')
-rw-r--r--include/linux/raid/md_p.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/include/linux/raid/md_p.h b/include/linux/raid/md_p.h
index 8c0a3adc5df5..07e05f92d050 100644
--- a/include/linux/raid/md_p.h
+++ b/include/linux/raid/md_p.h
@@ -281,10 +281,15 @@ struct mdp_superblock_1 {
281 * active device with same 'role'. 281 * active device with same 'role'.
282 * 'recovery_offset' is also set. 282 * 'recovery_offset' is also set.
283 */ 283 */
284#define MD_FEATURE_RESHAPE_BACKWARDS 32 /* Reshape doesn't change number
285 * of devices, but is going
286 * backwards anyway.
287 */
284#define MD_FEATURE_ALL (MD_FEATURE_BITMAP_OFFSET \ 288#define MD_FEATURE_ALL (MD_FEATURE_BITMAP_OFFSET \
285 |MD_FEATURE_RECOVERY_OFFSET \ 289 |MD_FEATURE_RECOVERY_OFFSET \
286 |MD_FEATURE_RESHAPE_ACTIVE \ 290 |MD_FEATURE_RESHAPE_ACTIVE \
287 |MD_FEATURE_BAD_BLOCKS \ 291 |MD_FEATURE_BAD_BLOCKS \
288 |MD_FEATURE_REPLACEMENT) 292 |MD_FEATURE_REPLACEMENT \
293 |MD_FEATURE_RESHAPE_BACKWARDS)
289 294
290#endif 295#endif