diff options
author | NeilBrown <neilb@suse.de> | 2010-11-22 19:35:25 +1100 |
---|---|---|
committer | NeilBrown <neilb@suse.de> | 2010-11-22 19:35:25 +1100 |
commit | 4725bc31fb3d7fc207671e851617852dc8034cd5 (patch) | |
tree | a79c3c1d0565aaaab0658c95e8033ed23072c4a4 /Detail.c | |
parent | feab51f8f710f28a63a5b01ec59a5a609a45525b (diff) |
super_by_fd: return subarray info explicitly.
Rather than hiding this in the 'st', return it explicitly.
In the one case we still need it, copy it into st where needed.
This will disappear in a future patch.
Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'Detail.c')
-rw-r--r-- | Detail.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -49,6 +49,7 @@ int Detail(char *dev, int brief, int export, int test, char *homehost) int is_rebuilding = 0; int failed = 0; struct supertype *st; + char *subarray = NULL; int max_disks = MD_SB_DISKS; /* just a default */ struct mdinfo info; struct mdinfo *sra; @@ -88,7 +89,7 @@ int Detail(char *dev, int brief, int export, int test, char *homehost) return rv; } sra = sysfs_read(fd, 0, GET_VERSION); - st = super_by_fd(fd); + st = super_by_fd(fd, &subarray); if (fstat(fd, &stb) != 0 && !S_ISBLK(stb.st_mode)) stb.st_rdev = 0; @@ -139,6 +140,8 @@ int Detail(char *dev, int brief, int export, int test, char *homehost) if (st->sb) st->ss->free_super(st); + if (subarray) + strcpy(st->subarray, subarray); err = st->ss->load_super(st, fd2, NULL); close(fd2); if (err) @@ -581,6 +584,7 @@ This is pretty boring free(disks); out: close(fd); + free(subarray); return rv; } |