From: NeilBrown Date: Mon, 22 Nov 2010 09:24:50 +0000 (+1100) Subject: New method: load_container X-Git-Tag: mdadm-3.2~298 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2b959fbf66d35f02ea57074428268bf7cc62c18b;p=thirdparty%2Fmdadm.git New method: load_container This handles the 'container' part of 'load_super', so we can soon make them completely separate - it is just confusing to overload these two. Signed-off-by: NeilBrown --- diff --git a/mdadm.h b/mdadm.h index 109f6efe..0dca8d26 100644 --- a/mdadm.h +++ b/mdadm.h @@ -597,6 +597,7 @@ extern struct superswitch { int (*write_init_super)(struct supertype *st); int (*compare_super)(struct supertype *st, struct supertype *tst); int (*load_super)(struct supertype *st, int fd, char *devname); + int (*load_container)(struct supertype *st, int fd, char *devname); struct supertype * (*match_metadata_desc)(char *arg); __u64 (*avail_size)(struct supertype *st, __u64 size); int (*add_internal_bitmap)(struct supertype *st, int *chunkp, diff --git a/super-ddf.c b/super-ddf.c index d756d8b1..7a368d7c 100644 --- a/super-ddf.c +++ b/super-ddf.c @@ -2880,6 +2880,13 @@ static int load_super_ddf_all(struct supertype *st, int fd, st->loaded_container = 1; return 0; } + +static int load_container_ddf(struct supertype *st, int fd, + char *devname) +{ + return load_super_ddf_all(st, fd, &st->sb, devname); +} + #endif /* MDASSEMBLE */ static struct mdinfo *container_content_ddf(struct supertype *st, char *subarray) @@ -3649,6 +3656,7 @@ struct superswitch super_ddf = { .validate_geometry = validate_geometry_ddf, .write_init_super = write_init_super_ddf, .add_to_super = add_to_super_ddf, + .load_container = load_container_ddf, #endif .match_home = match_home_ddf, .uuid_from_super= uuid_from_super_ddf, diff --git a/super-intel.c b/super-intel.c index 335f516b..430c5edf 100644 --- a/super-intel.c +++ b/super-intel.c @@ -2876,6 +2876,11 @@ static int load_super_imsm_all(struct supertype *st, int fd, void **sbp, return 0; } + +static int load_container_imsm(struct supertype *st, int fd, char *devname) +{ + return load_super_imsm_all(st, fd, &st->sb, devname); +} #endif static int load_super_imsm(struct supertype *st, int fd, char *devname) @@ -5574,6 +5579,7 @@ struct superswitch super_imsm = { .detail_platform = detail_platform_imsm, .kill_subarray = kill_subarray_imsm, .update_subarray = update_subarray_imsm, + .load_container = load_container_imsm, #endif .match_home = match_home_imsm, .uuid_from_super= uuid_from_super_imsm,