if (st && st->sb) {
struct mdinfo info;
char nbuf[64];
+ struct map_ent *mp, *map = NULL;
st->ss->getinfo_super(st, &info);
fname_from_uuid(st, &info, nbuf, ':');
printf("MD_UUID=%s\n", nbuf+5);
+ mp = map_by_uuid(&map, info.uuid);
+ if (mp && mp->path &&
+ strncmp(mp->path, "/dev/md/", 8) == 0)
+ printf("MD_DEVNAME=%s\n", mp->path+8);
if (st->ss->export_detail_super)
st->ss->export_detail_super(st);
+ } else {
+ struct map_ent *mp, *map = NULL;
+ mp = map_by_devnum(&map, fd2devnum(fd));
+ if (mp && mp->path &&
+ strncmp(mp->path, "/dev/md/", 8) == 0)
+ printf("MD_DEVNAME=%s\n", mp->path+8);
}
goto out;
}
unsigned long long dsize = get_component_size(fd);
if (dsize > 0)
printf(" Used Dev Size : %llu%s\n",
- dsize,
- human_size((long long)dsize<<10));
+ dsize/2,
+ human_size((long long)dsize<<9));
else
printf(" Used Dev Size : unknown\n");
} else
close(fd);
return rv;
}
+
+int Detail_Platform(struct superswitch *ss, int scan, int verbose)
+{
+ /* display platform capabilities for the given metadata format
+ * 'scan' in this context means iterate over all metadata types
+ */
+ int i;
+ int err = 1;
+
+ if (ss && ss->detail_platform)
+ err = ss->detail_platform(verbose, 0);
+ else if (ss) {
+ if (verbose)
+ fprintf(stderr, Name ": %s metadata is platform independent\n",
+ ss->name ? : "[no name]");
+ } else if (!scan) {
+ if (verbose)
+ fprintf(stderr, Name ": specify a metadata type or --scan\n");
+ }
+
+ if (!scan)
+ return err;
+
+ for (i = 0; superlist[i]; i++) {
+ struct superswitch *meta = superlist[i];
+
+ if (meta == ss)
+ continue;
+ if (verbose)
+ fprintf(stderr, Name ": checking metadata %s\n",
+ meta->name ? : "[no name]");
+ if (!meta->detail_platform) {
+ if (verbose)
+ fprintf(stderr, Name ": %s metadata is platform independent\n",
+ meta->name ? : "[no name]");
+ } else
+ err |= meta->detail_platform(verbose, 0);
+ }
+
+ return err;
+}