Remove subarray detection from load_super.
Nothing relies on this any more, so remove it. Signed-off-by: NeilBrown <neilb@suse.de>
This commit is contained in:
parent
a951a4f78f
commit
e32bd33f44
41
super-ddf.c
41
super-ddf.c
|
@ -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)
|
if (load_super_ddf_all(st, fd, &st->sb, devname, 1) == 0)
|
||||||
return 0;
|
return 0;
|
||||||
#endif
|
#endif
|
||||||
if (st->subarray[0])
|
|
||||||
return 1; /* FIXME Is this correct */
|
|
||||||
|
|
||||||
if (get_dev_size(fd, devname, &dsize) == 0)
|
if (get_dev_size(fd, devname, &dsize) == 0)
|
||||||
return 1;
|
return 1;
|
||||||
|
@ -844,26 +842,6 @@ static int load_super_ddf(struct supertype *st, int fd,
|
||||||
return rv;
|
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 .... */
|
/* Should possibly check the sections .... */
|
||||||
|
|
||||||
st->sb = super;
|
st->sb = super;
|
||||||
|
@ -2892,25 +2870,6 @@ static int load_super_ddf_all(struct supertype *st, int fd,
|
||||||
if (rv)
|
if (rv)
|
||||||
return 1;
|
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;
|
*sbp = super;
|
||||||
if (st->ss == NULL) {
|
if (st->ss == NULL) {
|
||||||
|
|
|
@ -76,9 +76,6 @@ static int load_gpt(struct supertype *st, int fd, char *devname)
|
||||||
|
|
||||||
free_gpt(st);
|
free_gpt(st);
|
||||||
|
|
||||||
if (st->subarray[0])
|
|
||||||
return 1;
|
|
||||||
|
|
||||||
if (posix_memalign((void**)&super, 512, 32*512) != 0) {
|
if (posix_memalign((void**)&super, 512, 32*512) != 0) {
|
||||||
fprintf(stderr, Name ": %s could not allocate superblock\n",
|
fprintf(stderr, Name ": %s could not allocate superblock\n",
|
||||||
__func__);
|
__func__);
|
||||||
|
|
|
@ -2852,25 +2852,6 @@ static int load_super_imsm_all(struct supertype *st, int fd, void **sbp,
|
||||||
err = 2;
|
err = 2;
|
||||||
goto error;
|
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;
|
err = 0;
|
||||||
|
|
||||||
error:
|
error:
|
||||||
|
@ -2933,24 +2914,6 @@ static int load_super_imsm(struct supertype *st, int fd, char *devname)
|
||||||
return rv;
|
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;
|
st->sb = super;
|
||||||
if (st->ss == NULL) {
|
if (st->ss == NULL) {
|
||||||
st->ss = &super_imsm;
|
st->ss = &super_imsm;
|
||||||
|
|
|
@ -80,9 +80,6 @@ static int load_super_mbr(struct supertype *st, int fd, char *devname)
|
||||||
|
|
||||||
free_mbr(st);
|
free_mbr(st);
|
||||||
|
|
||||||
if (st->subarray[0])
|
|
||||||
return 1;
|
|
||||||
|
|
||||||
if (posix_memalign((void**)&super, 512, 512) != 0) {
|
if (posix_memalign((void**)&super, 512, 512) != 0) {
|
||||||
fprintf(stderr, Name ": %s could not allocate superblock\n",
|
fprintf(stderr, Name ": %s could not allocate superblock\n",
|
||||||
__func__);
|
__func__);
|
||||||
|
|
3
super0.c
3
super0.c
|
@ -820,9 +820,6 @@ static int load_super0(struct supertype *st, int fd, char *devname)
|
||||||
|
|
||||||
free_super0(st);
|
free_super0(st);
|
||||||
|
|
||||||
if (st->subarray[0])
|
|
||||||
return 1;
|
|
||||||
|
|
||||||
if (!get_dev_size(fd, devname, &dsize))
|
if (!get_dev_size(fd, devname, &dsize))
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
|
|
3
super1.c
3
super1.c
|
@ -1217,9 +1217,6 @@ static int load_super1(struct supertype *st, int fd, char *devname)
|
||||||
|
|
||||||
free_super1(st);
|
free_super1(st);
|
||||||
|
|
||||||
if (st->subarray[0])
|
|
||||||
return 1;
|
|
||||||
|
|
||||||
if (st->ss == NULL || st->minor_version == -1) {
|
if (st->ss == NULL || st->minor_version == -1) {
|
||||||
int bestvers = -1;
|
int bestvers = -1;
|
||||||
struct supertype tst;
|
struct supertype tst;
|
||||||
|
|
Loading…
Reference in New Issue