diff options
author | Dan Williams <dan.j.williams@intel.com> | 2010-11-23 05:31:18 +0100 |
---|---|---|
committer | NeilBrown <neilb@suse.de> | 2010-11-23 05:31:18 +0100 |
commit | 5f7e44b29fe3fd9bf77c27e375c92046bf00d0c4 (patch) | |
tree | 2f9f54ffd3b0c96d7ad5adbb31bf9ce1e5a2190b /Detail.c | |
parent | Create: cleanup/unify default geometry handling (diff) | |
download | mdadm-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.c | 11 |
1 files changed, 4 insertions, 7 deletions
@@ -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); } |