diff options
author | Dan Williams <dan.j.williams@intel.com> | 2008-12-08 16:59:18 -0700 |
---|---|---|
committer | Dan Williams <dan.j.williams@intel.com> | 2008-12-08 16:59:18 -0700 |
commit | 4cce4069597491f5714fd81605f212ad2da62e06 (patch) | |
tree | da92c65cc25139409f3f23c7b0f5d1ec243dd754 /Detail.c | |
parent | 88c32bb1ec5d0c12eb557c4f46832fa4e1076784 (diff) | |
download | mdadm-4cce4069597491f5714fd81605f212ad2da62e06.tar.gz |
introduce --detail-platform to display platform raid capabilities
Metadata formats like imsm work in concert with platform firmware and
hardware, so provide a way for mdadm to display this info to the user.
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'Detail.c')
-rw-r--r-- | Detail.c | 41 |
1 files changed, 41 insertions, 0 deletions
@@ -530,3 +530,44 @@ out: 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); + 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); + } + + return err; +} |