}
}
-static void getinfo_super0(struct supertype *st, struct mdinfo *info)
+static void getinfo_super0(struct supertype *st, struct mdinfo *info, char *map)
{
mdp_super_t *sb = st->sb;
int working = 0;
int i;
+ int map_disks = info->array.raid_disks;
info->array.major_version = sb->major_version;
info->array.minor_version = sb->minor_version;
if ((sb->disks[i].state & (1<<MD_DISK_SYNC)) &&
(sb->disks[i].raid_disk < (unsigned)info->array.raid_disks) &&
(sb->disks[i].state & (1<<MD_DISK_ACTIVE)) &&
- !(sb->disks[i].state & (1<<MD_DISK_FAULTY)))
+ !(sb->disks[i].state & (1<<MD_DISK_FAULTY))) {
working ++;
+ if (map && i < map_disks)
+ map[i] = 1;
+ } else if (map && i < map_disks)
+ map[i] = 0;
info->array.working_disks = working;
}
+static struct mdinfo *container_content0(struct supertype *st, char *subarray)
+{
+ struct mdinfo *info;
+
+ if (subarray)
+ return NULL;
+
+ info = malloc(sizeof(*info));
+ getinfo_super0(st, info, NULL);
+ return info;
+}
static int update_super0(struct supertype *st, struct mdinfo *info,
char *update,
char *devname, int verbose,
int uuid_set, char *homehost)
{
- /* NOTE: for 'assemble' and 'force' we need to return non-zero if any change was made.
- * For others, the return value is ignored.
+ /* NOTE: for 'assemble' and 'force' we need to return non-zero
+ * if any change was made. For others, the return value is
+ * ignored.
*/
int rv = 0;
mdp_super_t *sb = st->sb;
bm = (struct bitmap_super_s*)(sb+1);
uuid_from_super0(st, (int*)bm->uuid);
}
+ } else if (strcmp(update, "no-bitmap") == 0) {
+ sb->state &= ~(1<<MD_SB_BITMAP_PRESENT);
} else if (strcmp(update, "_reshape_progress")==0)
sb->reshape_position = info->reshape_progress;
else
free_super0(st);
- if (st->subarray[0])
- return 1;
-
if (!get_dev_size(fd, devname, &dsize))
return 1;
if (!st) return st;
memset(st, 0, sizeof(*st));
+ st->container_dev = NoMdDev;
st->ss = &super0;
st->info = NULL;
st->minor_version = 90;
.match_home = match_home0,
.uuid_from_super = uuid_from_super0,
.getinfo_super = getinfo_super0,
+ .container_content = container_content0,
.update_super = update_super0,
.init_super = init_super0,
.store_super = store_super0,