]> git.ipfire.org Git - thirdparty/mdadm.git/commit - Grow.c
External reshape (step 1): container reshape and ->reshape_super()
authorDan Williams <dan.j.williams@intel.com>
Thu, 18 Nov 2010 09:22:59 +0000 (10:22 +0100)
committerNeilBrown <neilb@suse.de>
Tue, 23 Nov 2010 05:09:27 +0000 (16:09 +1100)
commit7bc7119671cceb8cba4c8b1622680b27e90417d4
treef74da6dad18ca8f78379b1d2818e72015d67a17c
parentd54d79bdc47fd3f2c312c11d544fc02ec86a06d8
External reshape (step 1): container reshape and ->reshape_super()

In the native metadata case Grow_reshape() and the kernel validate what
reshapes are possible / supported and the kernel handles all the metadata
updates.  In the external case the metadata format may have specific
constraints above this baseline.  External formats also introduce the
constraint of only permitting some reshapes at container scope versus subarray
scope.  For exmaple imsm changes to 'raiddisks' must be applied to all arrays
in the container.

This operation assumes that its 'st' parameter has been obtained from
super_by_fd() (such that st->subarray is up to date), and that a snapshot of
the metadata has been loaded from the container.

Why a new method, versus extending an existing one?
->validate_geometry: this routine assumes it is being called from Create(),
adding reshape complicates the cases that this routine needs to handle.  Where
we find that checks can be shared between the two cases those routines
refactored into common code internal to the metadata handler, i.e. no need to
provide a unified external interface.  ->validate_geometry() also does not
expect to update the metadata.

->update_super: this is meant to update single fields at Assembly() and only at
the container scope.  Reshape potentially wants to update multiple fields at
either container or subarray scope.

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
Grow.c
mdadm.h