summaryrefslogtreecommitdiff
path: root/super1.c
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2010-11-22 19:35:26 +1100
committerNeilBrown <neilb@suse.de>2010-11-22 19:35:26 +1100
commit00bbdbdac69e6d90fc71b8a2bfe574928ec66da3 (patch)
treeae9c3a9478cee36dcef0ab1c85fc75bd2a5f2062 /super1.c
parentca145a1e4c9ec2c95f95f6283a3ce290f3d4da0d (diff)
Add subarray arg to container_content.
This allows the info for a single array to be extracted, so we don't have to write it into st->subarray. For consistency, implement container_content for super0 and super1, to just return the mdinfo for the single array. Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'super1.c')
-rw-r--r--super1.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/super1.c b/super1.c
index a52df645..bc5f4a7f 100644
--- a/super1.c
+++ b/super1.c
@@ -645,6 +645,18 @@ static void getinfo_super1(struct supertype *st, struct mdinfo *info, char *map)
info->array.working_disks = working;
}
+static struct mdinfo *container_content1(struct supertype *st, char *subarray)
+{
+ struct mdinfo *info;
+
+ if (subarray)
+ return NULL;
+
+ info = malloc(sizeof(*info));
+ getinfo_super1(st, info, NULL);
+ return info;
+}
+
static int update_super1(struct supertype *st, struct mdinfo *info,
char *update,
char *devname, int verbose,
@@ -1683,6 +1695,7 @@ struct superswitch super1 = {
.match_home = match_home1,
.uuid_from_super = uuid_from_super1,
.getinfo_super = getinfo_super1,
+ .container_content = container_content1,
.update_super = update_super1,
.init_super = init_super1,
.store_super = store_super1,