]> git.karo-electronics.de Git - karo-tx-linux.git/commit
md: add possibility to change data-offset for devices.
authorNeilBrown <neilb@suse.de>
Thu, 12 Apr 2012 06:12:19 +0000 (16:12 +1000)
committerNeilBrown <neilb@suse.de>
Thu, 12 Apr 2012 06:12:19 +0000 (16:12 +1000)
commit714f8ef52975916f30a12c4889cc95d44875827c
tree36cce1c59cd3e2e4ac90e0f9e2fb8b91180c0e9e
parent983b04779dafd3d4681128dab9612eac0a7379f9
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>
drivers/md/md.c
drivers/md/md.h
drivers/md/raid1.c
drivers/md/raid10.c
drivers/md/raid5.c
include/linux/raid/md_p.h