summaryrefslogtreecommitdiffstats
path: root/Detail.c
diff options
context:
space:
mode:
authorDan Williams <dan.j.williams@intel.com>2010-11-23 05:31:18 +0100
committerNeilBrown <neilb@suse.de>2010-11-23 05:31:18 +0100
commit5f7e44b29fe3fd9bf77c27e375c92046bf00d0c4 (patch)
tree2f9f54ffd3b0c96d7ad5adbb31bf9ce1e5a2190b /Detail.c
parentCreate: cleanup/unify default geometry handling (diff)
downloadmdadm-5f7e44b29fe3fd9bf77c27e375c92046bf00d0c4.tar.xz
mdadm-5f7e44b29fe3fd9bf77c27e375c92046bf00d0c4.zip
Initialize st->devnum and st->container_dev in super_by_fd
Precludes needing to deduce this information later, like in Detail.c and soon in Grow.c. Signed-off-by: Dan Williams <dan.j.williams@intel.com> Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'Detail.c')
-rw-r--r--Detail.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/Detail.c b/Detail.c
index 2cd4e9d3..94156288 100644
--- a/Detail.c
+++ b/Detail.c
@@ -98,16 +98,13 @@ int Detail(char *dev, int brief, int export, int test, char *homehost)
if (st)
max_disks = st->max_devs;
- if (sra && is_subarray(sra->text_version) &&
- strchr(sra->text_version+1, '/')) {
+ if (subarray) {
/* This is a subarray of some container.
* We want the name of the container, and the member
*/
- char *s = strchr(sra->text_version+1, '/');
- int dn;
- *s++ = '\0';
- member = s;
- dn = devname2devnum(sra->text_version+1);
+ int dn = st->container_dev;
+
+ member = subarray;
container = map_dev(dev2major(dn), dev2minor(dn), 1);
}