struct ddf_super *super;
int rv;
-#ifndef MDASSEMBLE
- /* if 'fd' is a container, load metadata from all the devices */
- if (load_super_ddf_all(st, fd, &st->sb, devname) == 0)
- return 0;
-#endif
-
if (get_dev_size(fd, devname, &dsize) == 0)
return 1;
// if (info->vendor_is_local)
// strcpy(ddf->controller.vendor_data, homehost);
rv = -1;
- } if (strcmp(update, "name") == 0) {
+ } else if (strcmp(update, "name") == 0) {
/* name is stored in virtual_entry->name */
// memset(ve->name, ' ', 16);
// strncpy(ve->name, info->name, 16);
rv = -1;
- } if (strcmp(update, "_reshape_progress") == 0) {
+ } else if (strcmp(update, "_reshape_progress") == 0) {
/* We don't support reshape yet */
+ } else if (strcmp(update, "assemble") == 0 ) {
+ /* Do nothing, just succeed */
+ rv = 0;
} else
rv = -1;
return 0;
}
+ if (name)
+ for (venum = 0; venum < __be16_to_cpu(ddf->virt->max_vdes); venum++)
+ if (!all_ff(ddf->virt->entries[venum].guid)) {
+ char *n = ddf->virt->entries[venum].name;
+
+ if (strncmp(name, n, 16) == 0) {
+ fprintf(stderr, Name ": This ddf already"
+ " has an array called %s\n",
+ name);
+ return 0;
+ }
+ }
+
for (venum = 0; venum < __be16_to_cpu(ddf->virt->max_vdes); venum++)
if (all_ff(ddf->virt->entries[venum].guid))
break;
static unsigned char null_conf[4096+512];
-static int __write_init_super_ddf(struct supertype *st, int do_close)
+static int __write_init_super_ddf(struct supertype *st)
{
struct ddf_super *ddf = st->sb;
successes++;
}
- if (do_close)
- for (d = ddf->dlist; d; d=d->next) {
- close(d->fd);
- d->fd = -1;
- }
-
return attempts != successes;
}
struct dl *d;
for (d = ddf->dlist; d; d=d->next)
while (Kill(d->devname, NULL, 0, 1, 1) == 0);
- return __write_init_super_ddf(st, 1);
+ return __write_init_super_ddf(st);
}
}
if (!ddf->updates_pending)
return;
ddf->updates_pending = 0;
- __write_init_super_ddf(st, 0);
+ __write_init_super_ddf(st);
dprintf("ddf: sync_metadata\n");
}