diff options
author | Neil Brown <neilb@suse.de> | 2008-07-12 20:27:39 +1000 |
---|---|---|
committer | Neil Brown <neilb@suse.de> | 2008-07-12 20:27:39 +1000 |
commit | ba7eb04f71b0f5add796bd94319d1a0671b566de (patch) | |
tree | c963b12819b4558fa7c82119a616a8f4c5acc349 /super-ddf.c | |
parent | d2ca644994d642c31b41242140e1fe819711c8f7 (diff) | |
download | mdadm-ba7eb04f71b0f5add796bd94319d1a0671b566de.tar.gz mdadm-ba7eb04f71b0f5add796bd94319d1a0671b566de.tar.xz mdadm-ba7eb04f71b0f5add796bd94319d1a0671b566de.zip |
Remove silly convention that major='-1' means 'zero superblock'.
Use 'info pointer is NULL' instead.
Diffstat (limited to 'super-ddf.c')
-rw-r--r-- | super-ddf.c | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/super-ddf.c b/super-ddf.c index a547006..cfa79c5 100644 --- a/super-ddf.c +++ b/super-ddf.c @@ -1455,6 +1455,11 @@ static int init_super_ddf(struct supertype *st, struct phys_disk *pd; struct virtual_disk *vd; + if (!info) { + st->sb = NULL; + return 0; + } + ddf = malloc(sizeof(*ddf)); memset(ddf, 0, sizeof(*ddf)); ddf->dlist = NULL; /* no physical disks yet */ @@ -2558,15 +2563,6 @@ static struct mdinfo *container_content_ddf(struct supertype *st) return rest; } -static int init_zero_ddf(struct supertype *st, - mdu_array_info_t *info, - unsigned long long size, char *name, - char *homehost, int *uuid) -{ - st->sb = NULL; - return 0; -} - static int store_zero_ddf(struct supertype *st, int fd) { unsigned long long dsize; @@ -3115,7 +3111,7 @@ struct superswitch super_ddf = { .compare_super = compare_super_ddf, .load_super = load_super_ddf, - .init_super = init_zero_ddf, + .init_super = init_super_ddf, .store_super = store_zero_ddf, .free_super = free_super_ddf, .match_metadata_desc = match_metadata_desc_ddf, |