]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
New method: load_container
authorNeilBrown <neilb@suse.de>
Mon, 22 Nov 2010 09:24:50 +0000 (20:24 +1100)
committerNeilBrown <neilb@suse.de>
Mon, 22 Nov 2010 09:24:50 +0000 (20:24 +1100)
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 <neilb@suse.de>
mdadm.h
super-ddf.c
super-intel.c

diff --git a/mdadm.h b/mdadm.h
index 109f6efe233e4e4b609638c5ea6c35a013adcf34..0dca8d2688111a934f5154d9bcb12f1695f6f94c 100644 (file)
--- 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,
index d756d8b14dbbfa0ef725ebc3a47a801aa7f8d15f..7a368d7cb6dbd8db2d655a6950c2ea81751df7ed 100644 (file)
@@ -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,
index 335f516bac7cd5798b218067d6b012b9b0cc0554..430c5edf61c16115c0ec622bd699be7f31a7a771 100644 (file)
@@ -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,