[PATCH] md: Make 'reshape' a possible sync_action action
authorNeilBrown <neilb@suse.de>
Mon, 27 Mar 2006 09:18:13 +0000 (01:18 -0800)
committerLinus Torvalds <torvalds@g5.osdl.org>
Mon, 27 Mar 2006 16:45:02 +0000 (08:45 -0800)
This allows reshape to be triggerred via sysfs (which is the only way to start
it happening).

Signed-off-by: Neil Brown <neilb@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
drivers/md/md.c

index 1a637676a930d1f85ef5a6ddda2bfe9702f1d5fd..a79dd33d343dbf6963df0788cc228751dd72efe5 100644 (file)
@@ -2247,7 +2247,14 @@ action_store(mddev_t *mddev, const char *page, size_t len)
                return -EBUSY;
        else if (cmd_match(page, "resync") || cmd_match(page, "recover"))
                set_bit(MD_RECOVERY_NEEDED, &mddev->recovery);
-       else {
+       else if (cmd_match(page, "reshape")) {
+               int err;
+               if (mddev->pers->start_reshape == NULL)
+                       return -EINVAL;
+               err = mddev->pers->start_reshape(mddev);
+               if (err)
+                       return err;
+       } else {
                if (cmd_match(page, "check"))
                        set_bit(MD_RECOVERY_CHECK, &mddev->recovery);
                else if (cmd_match(page, "repair"))