Add reshape restart support for external metadata

Patch introduces support for reshape process restart for external metadata
using metadata specific data handling methods.
It introduces recover_backup() function that restores array to stable state
It is equivalent to Grow_restart() functionality for native metadata.

Signed-off-by: Maciej Trela <maciej.trela@intel.com>
Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
Signed-off-by: Krzysztof Wojcik <krzysztof.wojcik@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
This commit is contained in:
Adam Kwolek 2011-06-08 17:11:11 +10:00 committed by NeilBrown
parent c47b0ff69a
commit ba53ea59ad
2 changed files with 13 additions and 4 deletions

View File

@ -1190,8 +1190,11 @@ int Assemble(struct supertype *st, char *mddev,
fdlist[i] = -1;
}
if (!err) {
err = Grow_restart(st, content, fdlist, bestcnt,
backup_file, verbose > 0);
if (st->ss->external && st->ss->recover_backup)
err = st->ss->recover_backup(st, content);
else
err = Grow_restart(st, content, fdlist, bestcnt,
backup_file, verbose > 0);
if (err && invalid_backup) {
if (verbose > 0)
fprintf(stderr, Name ": continuing"
@ -1571,8 +1574,11 @@ int assemble_container_content(struct supertype *st, int mdfd,
else
fdlist[spare++] = fd;
}
err = Grow_restart(st, content, fdlist, spare,
backup_file, verbose > 0);
if (st->ss->external && st->ss->recover_backup)
err = st->ss->recover_backup(st, content);
else
err = Grow_restart(st, content, fdlist, spare,
backup_file, verbose > 0);
while (spare > 0) {
spare--;
if (fdlist[spare] >= 0)

View File

@ -786,6 +786,9 @@ extern struct superswitch {
*/
const char *(*get_disk_controller_domain)(const char *path);
/* for external backup area */
int (*recover_backup)(struct supertype *st, struct mdinfo *info);
int swapuuid; /* true if uuid is bigending rather than hostendian */
int external;
const char *name; /* canonical metadata name */