From 00bbdbdac69e6d90fc71b8a2bfe574928ec66da3 Mon Sep 17 00:00:00 2001 From: NeilBrown Date: Mon, 22 Nov 2010 19:35:26 +1100 Subject: 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 --- super0.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'super0.c') diff --git a/super0.c b/super0.c index b9d149e..3e17b80 100644 --- a/super0.c +++ b/super0.c @@ -401,6 +401,17 @@ static void getinfo_super0(struct supertype *st, struct mdinfo *info, char *map) info->array.working_disks = working; } +static struct mdinfo *container_content0(struct supertype *st, char *subarray) +{ + struct mdinfo *info; + + if (subarray) + return NULL; + + info = malloc(sizeof(*info)); + getinfo_super0(st, info, NULL); + return info; +} static int update_super0(struct supertype *st, struct mdinfo *info, char *update, @@ -1136,6 +1147,7 @@ struct superswitch super0 = { .match_home = match_home0, .uuid_from_super = uuid_from_super0, .getinfo_super = getinfo_super0, + .container_content = container_content0, .update_super = update_super0, .init_super = init_super0, .store_super = store_super0, -- cgit v1.2.1