]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
Remove subarray detection from load_super.
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)
Nothing relies on this any more, so remove it.

Signed-off-by: NeilBrown <neilb@suse.de>
super-ddf.c
super-gpt.c
super-intel.c
super-mbr.c
super0.c
super1.c

index 83e4a31a062cb98f3faf3168b66e6b2ba0323e55..41947dc26a0ba2c269d9b771b68614e3d44b3436 100644 (file)
@@ -777,8 +777,6 @@ static int load_super_ddf(struct supertype *st, int fd,
        if (load_super_ddf_all(st, fd, &st->sb, devname, 1) == 0)
                return 0;
 #endif
-       if (st->subarray[0])
-               return 1; /* FIXME Is this correct */
 
        if (get_dev_size(fd, devname, &dsize) == 0)
                return 1;
@@ -844,26 +842,6 @@ static int load_super_ddf(struct supertype *st, int fd,
                return rv;
        }
 
-       if (st->subarray[0]) {
-               unsigned long val;
-               struct vcl *v;
-               char *ep;
-
-               val = strtoul(st->subarray, &ep, 10);
-               if (*ep != '\0') {
-                       free(super);
-                       return 1;
-               }
-
-               for (v = super->conflist; v; v = v->next)
-                       if (v->vcnum == val)
-                               super->currentconf = v;
-               if (!super->currentconf) {
-                       free(super);
-                       return 1;
-               }
-       }
-
        /* Should possibly check the sections .... */
 
        st->sb = super;
@@ -2892,25 +2870,6 @@ static int load_super_ddf_all(struct supertype *st, int fd,
                if (rv)
                        return 1;
        }
-       if (st->subarray[0]) {
-               unsigned long val;
-               struct vcl *v;
-               char *ep;
-
-               val = strtoul(st->subarray, &ep, 10);
-               if (*ep != '\0') {
-                       free(super);
-                       return 1;
-               }
-
-               for (v = super->conflist; v; v = v->next)
-                       if (v->vcnum == val)
-                               super->currentconf = v;
-               if (!super->currentconf) {
-                       free(super);
-                       return 1;
-               }
-       }
 
        *sbp = super;
        if (st->ss == NULL) {
index 116e568646fe80ba352841994ba3afcf89103a37..e70a6fac3be9e5f2e467f292375d45aa8386726b 100644 (file)
@@ -76,9 +76,6 @@ static int load_gpt(struct supertype *st, int fd, char *devname)
 
        free_gpt(st);
 
-       if (st->subarray[0])
-               return 1;
-
        if (posix_memalign((void**)&super, 512, 32*512) != 0) {
                fprintf(stderr, Name ": %s could not allocate superblock\n",
                        __func__);
index 03c214f9357bcf32a0a9c864d55df313b9de4d0e..3c18e575b183dc326d81eff7b99daf7bbc3c86ab 100644 (file)
@@ -2852,25 +2852,6 @@ static int load_super_imsm_all(struct supertype *st, int fd, void **sbp,
                err = 2;
                goto error;
        }
-
-       if (st->subarray[0]) {
-               unsigned long val;
-               char *ep;
-
-               err = 1;
-               val = strtoul(st->subarray, &ep, 10);
-               if (*ep != '\0') {
-                       free_imsm(super);
-                       goto error;
-               }
-
-               if (val < super->anchor->num_raid_devs)
-                       super->current_vol = val;
-               else {
-                       free_imsm(super);
-                       goto error;
-               }
-       }
        err = 0;
 
  error:
@@ -2933,24 +2914,6 @@ static int load_super_imsm(struct supertype *st, int fd, char *devname)
                return rv;
        }
 
-       if (st->subarray[0]) {
-               unsigned long val;
-               char *ep;
-
-               val = strtoul(st->subarray, &ep, 10);
-               if (*ep != '\0') {
-                       free_imsm(super);
-                       return 1;
-               }
-
-               if (val < super->anchor->num_raid_devs)
-                       super->current_vol = val;
-               else {
-                       free_imsm(super);
-                       return 1;
-               }
-       }
-
        st->sb = super;
        if (st->ss == NULL) {
                st->ss = &super_imsm;
index 0751e17cec965fd9182e8a53613070157bf3f07e..0129fd695223020ebb6f7f4d2952a7cd235f7395 100644 (file)
@@ -80,9 +80,6 @@ static int load_super_mbr(struct supertype *st, int fd, char *devname)
 
        free_mbr(st);
 
-       if (st->subarray[0])
-               return 1;
-
        if (posix_memalign((void**)&super, 512, 512) != 0) {
                fprintf(stderr, Name ": %s could not allocate superblock\n",
                        __func__);
index 3e17b803ffa2e4a407d824e28db1280fcad598b4..74b05aeda9f08b27c219961176988fd23e92d162 100644 (file)
--- a/super0.c
+++ b/super0.c
@@ -820,9 +820,6 @@ static int load_super0(struct supertype *st, int fd, char *devname)
 
        free_super0(st);
 
-       if (st->subarray[0])
-               return 1;
-
        if (!get_dev_size(fd, devname, &dsize))
                return 1;
 
index bc5f4a7f8b07c90ec8ea1d81bbe0d61f8bd385b4..ca2a54e0ae52c4a1685262701be167c82e5a013c 100644 (file)
--- a/super1.c
+++ b/super1.c
@@ -1217,9 +1217,6 @@ static int load_super1(struct supertype *st, int fd, char *devname)
 
        free_super1(st);
 
-       if (st->subarray[0])
-               return 1;
-
        if (st->ss == NULL || st->minor_version == -1) {
                int bestvers = -1;
                struct supertype tst;