diff options
author | NeilBrown <neilb@suse.de> | 2012-05-20 19:27:00 -0400 |
---|---|---|
committer | NeilBrown <neilb@suse.de> | 2012-05-20 19:27:00 -0400 |
commit | c6563a8c38fde3c1c7fc925a10bde3ca20799301 (patch) | |
tree | 3916ae8247149a9dcf39ee1ca262f97be39071eb /include/linux/raid | |
parent | 2c810cddc44d6f95cef75df3f07fc0850ff92417 (diff) |
md: add possibility to change data-offset for devices.
When reshaping we can avoid costly intermediate backup by
changing the 'start' address of the array on the device
(if there is enough room).
So as a first step, allow such a change to be requested
through sysfs, and recorded in v1.x metadata.
(As we didn't previous check that all 'pad' fields were zero,
we need a new FEATURE flag for this.
A (belatedly) check that all remaining 'pad' fields are
zero to avoid a repeat of this)
The new data offset must be requested separately for each device.
This allows each to have a different change in the data offset.
This is not likely to be used often but as data_offset can be
set per-device, new_data_offset should be too.
This patch also removes the 'acknowledged' arg to rdev_set_badblocks as
it is never used and never will be. At the same time we add a new
arg ('in_new') which is currently always zero but will be used more
soon.
When a reshape finishes we will need to update the data_offset
and rdev->sectors. So provide an exported function to do that.
Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'include/linux/raid')
-rw-r--r-- | include/linux/raid/md_p.h | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/include/linux/raid/md_p.h b/include/linux/raid/md_p.h index 07e05f92d050..ee753536ab70 100644 --- a/include/linux/raid/md_p.h +++ b/include/linux/raid/md_p.h | |||
@@ -233,7 +233,10 @@ struct mdp_superblock_1 { | |||
233 | __le32 delta_disks; /* change in number of raid_disks */ | 233 | __le32 delta_disks; /* change in number of raid_disks */ |
234 | __le32 new_layout; /* new layout */ | 234 | __le32 new_layout; /* new layout */ |
235 | __le32 new_chunk; /* new chunk size (512byte sectors) */ | 235 | __le32 new_chunk; /* new chunk size (512byte sectors) */ |
236 | __u8 pad1[128-124]; /* set to 0 when written */ | 236 | __le32 new_offset; /* signed number to add to data_offset in new |
237 | * layout. 0 == no-change. This can be | ||
238 | * different on each device in the array. | ||
239 | */ | ||
237 | 240 | ||
238 | /* constant this-device information - 64 bytes */ | 241 | /* constant this-device information - 64 bytes */ |
239 | __le64 data_offset; /* sector start of data, often 0 */ | 242 | __le64 data_offset; /* sector start of data, often 0 */ |
@@ -285,11 +288,14 @@ struct mdp_superblock_1 { | |||
285 | * of devices, but is going | 288 | * of devices, but is going |
286 | * backwards anyway. | 289 | * backwards anyway. |
287 | */ | 290 | */ |
291 | #define MD_FEATURE_NEW_OFFSET 64 /* new_offset must be honoured */ | ||
288 | #define MD_FEATURE_ALL (MD_FEATURE_BITMAP_OFFSET \ | 292 | #define MD_FEATURE_ALL (MD_FEATURE_BITMAP_OFFSET \ |
289 | |MD_FEATURE_RECOVERY_OFFSET \ | 293 | |MD_FEATURE_RECOVERY_OFFSET \ |
290 | |MD_FEATURE_RESHAPE_ACTIVE \ | 294 | |MD_FEATURE_RESHAPE_ACTIVE \ |
291 | |MD_FEATURE_BAD_BLOCKS \ | 295 | |MD_FEATURE_BAD_BLOCKS \ |
292 | |MD_FEATURE_REPLACEMENT \ | 296 | |MD_FEATURE_REPLACEMENT \ |
293 | |MD_FEATURE_RESHAPE_BACKWARDS) | 297 | |MD_FEATURE_RESHAPE_BACKWARDS \ |
298 | |MD_FEATURE_NEW_OFFSET \ | ||
299 | ) | ||
294 | 300 | ||
295 | #endif | 301 | #endif |