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 <neilb@suse.de>
This commit is contained in:
NeilBrown 2010-11-22 20:24:50 +11:00
parent e1902a7b6c
commit 2b959fbf66
3 changed files with 15 additions and 0 deletions

View File

@ -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,

View 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,

View 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,