#include "md_p.h"
#include <ctype.h>
-
static int scan_assemble(struct supertype *ss,
struct context *c,
struct mddev_ident *ident);
char *dump_directory,
struct supertype *ss, struct context *c);
-
int main(int argc, char *argv[])
{
int mode = 0;
writemostly = 2;
continue;
-
case O(GROW,'z'):
case O(CREATE,'z'):
case O(BUILD,'z'): /* size */
continue;
if (strcmp(c.update, "metadata") == 0)
continue;
+ if (strcmp(c.update, "revert-reshape") == 0)
+ continue;
if (strcmp(c.update, "byteorder")==0) {
if (ss) {
pr_err("must not set metadata"
fprintf(outf, "Valid --update options are:\n"
" 'sparc2.2', 'super-minor', 'uuid', 'name', 'resync',\n"
" 'summaries', 'homehost', 'byteorder', 'devicesize',\n"
- " 'no-bitmap', 'metadata'\n");
+ " 'no-bitmap', 'metadata', 'revert-reshape'\n");
exit(outf == stdout ? 0 : 2);
case O(MANAGE,'U'):
case O(MISC, ConfigFile):
case O(MONITOR,'c'):
case O(MONITOR,ConfigFile):
+ case O(CREATE,ConfigFile):
if (configfile) {
pr_err("configfile cannot be set twice. "
"Second value is %s.\n", optarg);
c.update, c.force);
if (!rv && c.readonly < 0)
rv = Manage_ro(devlist->devname, mdfd, c.readonly);
- if (!rv && c.runstop)
- rv = Manage_runstop(devlist->devname, mdfd, c.runstop, c.verbose, 0);
+ if (!rv && c.runstop > 0)
+ rv = Manage_run(devlist->devname, mdfd, c.verbose);
+ if (!rv && c.runstop < 0)
+ rv = Manage_stop(devlist->devname, mdfd, c.verbose, 0);
break;
case ASSEMBLE:
if (devs_found == 1 && ident.uuid_set == 0 &&
break;
}
}
- if (devs_found > 1 && s.raiddisks == 0) {
+ if (devs_found > 1 && s.raiddisks == 0 && s.level == UnSet) {
/* must be '-a'. */
if (s.size > 0 || s.chunk || s.layout_str != NULL || s.bitmap_file) {
pr_err("--add cannot be used with "
if (a->devname &&
strcasecmp(a->devname, "<ignore>") == 0)
continue;
-
+
r = Assemble(ss, a->devname,
a, NULL, c);
if (r == 0) {
}
mdfd = open_mddev(name, 1);
if (mdfd >= 0) {
- if (Manage_runstop(name, mdfd, -1, verbose, !last))
+ if (Manage_stop(name, mdfd, verbose, !last))
err = 1;
else
progress = 1;
(dv == devlist && dv->next == NULL));
continue;
}
- mdfd = open_mddev(dv->devname, 1);
+ if (dv->devname[0] == '/')
+ mdfd = open_mddev(dv->devname, 1);
+ else {
+ mdfd = open_dev(dv->devname);
+ if (mdfd < 0)
+ pr_err("Cannot open %s\n", dv->devname);
+ }
if (mdfd>=0) {
switch(dv->disposition) {
case 'R':
- rv |= Manage_runstop(dv->devname, mdfd, 1, c->verbose, 0); break;
+ rv |= Manage_run(dv->devname, mdfd, c->verbose); break;
case 'S':
- rv |= Manage_runstop(dv->devname, mdfd, -1, c->verbose, 0); break;
+ rv |= Manage_stop(dv->devname, mdfd, c->verbose, 0); break;
case 'o':
rv |= Manage_ro(dv->devname, mdfd, 1); break;
case 'w':