From: Czarnowska, Anna Sent: Monday, July 05, 2010 11:24 AM To: Neil Brown Cc: linux-raid@xxxxxxxxxxxxxxx; Czarnowska, Anna; Hawrylewicz Czarnowski, Przemyslaw; Labun, Marcin; Neubauer, Wojciech; Williams, Dan J; Ciechanowski, Ed; dledford@xxxxxxxxxx Subject: [PATCH 08/33] imsm: platform dependent domain boundaries From: Przemyslaw Czarnowski <przemyslaw.hawrylewicz.czarnowski@xxxxxxxxx> two supertype primitives: struct subset *platform_domain(struct supertype *) char *get_spare_group(struct supertype *) has been added in order to allow future support of implicit platform boundaries. For imsm metadata platform_domain() provides list of subsets created in accordance with capabilities of this platform. The second will provide metadata dependent spare group identifier. Signed-off-by: Przemyslaw Czarnowski <przemyslaw.hawrylewicz.czarnowski@xxxxxxxxx> --- mdadm.h | 10 ++++++++++ super-intel.c | 26 ++++++++++++++++++++++++++ 2 files changed, 36 insertions(+), 0 deletions(-) diff --git a/mdadm.h b/mdadm.h index 7b950f8..a0b1ab9 100644 --- a/mdadm.h +++ b/mdadm.h @@ -680,6 +680,16 @@ extern struct superswitch { /* Allow a metadata handler to override mdadm's default layouts */ int (*default_layout)(int level); /* optional */ + /* returns subsets of domain_ent structure according to implicit + * boundaries related to the capabilities of hardware or platform + */ + struct subset *(*platform_domain)(struct supertype *st); + + /* returns sparegroup string representing internal identifier + * used for device grouping by high level management tools (like CIM) + */ + char *(*get_spare_group)(struct supertype *st); + /* for mdmon */ int (*open_new)(struct supertype *c, struct active_array *a, char *inst); diff --git a/super-intel.c b/super-intel.c index d6d8b09..f704c43 100644 --- a/super-intel.c +++ b/super-intel.c @@ -5296,6 +5296,31 @@ static void imsm_delete(struct intel_super *super, struct dl **dlp, int index) __free_imsm_disk(dl); } } + +/* leaving supertype for future use */ +static struct subset *platform_domain_imsm(struct supertype *st) { + struct subset *s = malloc(sizeof(*s)); + + if (!s) { + fprintf(stderr, Name ": unable to allocate memory for domain " + "subset entry\n"); + return NULL; + } + s->paths = malloc(sizeof(*s->paths)); + if (!s->paths) { + free(s); + return NULL; + } + /* this is the only type of controller we know of */ + s->paths->path = strdup("pci-0000:00:1f.2-*"); + s->paths->next = NULL; + s->spare_group = NULL; + s->next = NULL; + + return s; +} + #endif /* MDASSEMBLE */ struct superswitch super_imsm = { @@ -5327,6 +5352,7 @@ struct superswitch super_imsm = { .match_metadata_desc = match_metadata_desc_imsm, .container_content = container_content_imsm, .default_layout = imsm_level_to_layout, + .platform_domain = platform_domain_imsm, .external = 1, .name = "imsm", -- 1.6.4.2 -- To unsubscribe from this list: send the line "unsubscribe linux-raid" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html