summaryrefslogtreecommitdiff
path: root/mapfile.c
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2010-11-22 20:24:35 +1100
committerNeilBrown <neilb@suse.de>2010-11-22 20:24:35 +1100
commita1f976a013ab738affd54a1ba737107aa05c26ad (patch)
tree8919bbb59796f94bbc840fcca30fa0355dd08fa1 /mapfile.c
parent00bbdbdac69e6d90fc71b8a2bfe574928ec66da3 (diff)
downloadmdadm-a1f976a013ab738affd54a1ba737107aa05c26ad.tar.gz
Use new container_content rather than passing subarray to load_super.
Now that we can ask container_content for a specific subarray, we don't need to pass the subarray name to load_super, and have it secretly modify the returned state. Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'mapfile.c')
-rw-r--r--mapfile.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/mapfile.c b/mapfile.c
index 2645aa9..be58436 100644
--- a/mapfile.c
+++ b/mapfile.c
@@ -380,8 +380,9 @@ void RebuildMap(void)
int dfd;
int ok;
struct supertype *st;
+ char *subarray;
char *path;
- struct mdinfo info;
+ struct mdinfo *info;
sprintf(dn, "%d:%d", sd->disk.major, sd->disk.minor);
dfd = dev_open(dn, O_RDONLY);
@@ -391,14 +392,14 @@ void RebuildMap(void)
if ( st == NULL)
ok = -1;
else {
- char *subarray = get_member_info(md);
- strcpy(st->subarray, subarray);
+ subarray = get_member_info(md);
ok = st->ss->load_super(st, dfd, NULL);
}
close(dfd);
if (ok != 0)
continue;
- st->ss->getinfo_super(st, &info, NULL);
+ info = st->ss->container_content(st, subarray);
+
if (md->devnum >= 0)
path = map_dev(MD_MAJOR, md->devnum, 0);
else
@@ -418,7 +419,7 @@ void RebuildMap(void)
* find a unique name based on metadata name.
*
*/
- struct mddev_ident_s *match = conf_match(&info, st);
+ struct mddev_ident_s *match = conf_match(info, st);
struct stat stb;
if (match && match->devname && match->devname[0] == '/') {
path = match->devname;
@@ -436,13 +437,13 @@ void RebuildMap(void)
st->ss->match_home(st, homehost) != 1) &&
st->ss->match_home(st, "any") != 1 &&
(require_homehost
- || ! conf_name_is_free(info.name)))
+ || ! conf_name_is_free(info->name)))
/* require a numeric suffix */
unum = 0;
else
/* allow name to be used as-is if no conflict */
unum = -1;
- name = info.name;
+ name = info->name;
if (!*name) {
name = st->ss->name;
if (!isdigit(name[strlen(name)-1]) &&
@@ -475,9 +476,10 @@ void RebuildMap(void)
}
}
map_add(&map, md->devnum,
- info.text_version,
- info.uuid, path);
+ info->text_version,
+ info->uuid, path);
st->ss->free_super(st);
+ free(info);
break;
}
sysfs_free(sra);