Assemble: remove support for assembling arrays with ancient kernel.

Using "START_ARRAY" ioctl never really worked reliably,
was removed a decade ago, and just clutters the code.
So remove it.

Signed-off-by: NeilBrown <neilb@suse.de>
This commit is contained in:
NeilBrown 2012-10-22 17:23:25 +11:00
parent 4ec2cbe96d
commit 6f4dbdc4e8
1 changed files with 50 additions and 74 deletions

View File

@ -1146,13 +1146,12 @@ int Assemble(struct supertype *st, char *mddev,
* START_ARRAY
*
*/
int rv;
int mdfd;
int clean;
int auto_assem = (mddev == NULL && !ident->uuid_set &&
ident->super_minor == UnSet && ident->name[0] == 0
&& (ident->container == NULL || ident->member == NULL));
int old_linux = 0;
int vers = vers; /* Keep gcc quite - it really is initialised */
struct devs *devices;
char *devmap;
int *best = NULL; /* indexed by raid_disk */
@ -1177,9 +1176,6 @@ int Assemble(struct supertype *st, char *mddev,
struct map_ent *map = NULL;
struct map_ent *mp;
if (get_linux_version() < 2004000)
old_linux = 1;
/*
* If any subdevs are listed, then any that don't
* match ident are discarded. Remainder must all match and
@ -1323,9 +1319,10 @@ int Assemble(struct supertype *st, char *mddev,
return 1;
}
mddev = chosen_name;
vers = md_get_version(mdfd);
if (vers < 9000) {
pr_err("Assemble requires driver version 0.90.0 or later.\n"
if (get_linux_version() < 2004000 ||
md_get_version(mdfd) < 9000) {
pr_err("Assemble requires Linux 2.4 or later, and\n"
" md driver version 0.90.0 or later.\n"
" Upgrade your kernel or try --build\n");
close(mdfd);
return 1;
@ -1628,9 +1625,6 @@ int Assemble(struct supertype *st, char *mddev,
#endif
/* Almost ready to actually *do* something */
if (!old_linux) {
int rv;
/* First, fill in the map, so that udev can find our name
* as soon as we become active.
*/
@ -1679,24 +1673,6 @@ int Assemble(struct supertype *st, char *mddev,
}
/* '2' means 'OK, but not started yet' */
return rv == 2 ? 0 : rv;
} else {
/* The "chosen_drive" is a good choice, and if necessary, the superblock has
* been updated to point to the current locations of devices.
* so we can just start the array
*/
unsigned long dev;
dev = makedev(devices[chosen_drive].i.disk.major,
devices[chosen_drive].i.disk.minor);
if (ioctl(mdfd, START_ARRAY, dev)) {
pr_err("Cannot start array: %s\n",
strerror(errno));
}
}
close(mdfd);
free(devices);
map_unlock(&map);
return 0;
}
#ifndef MDASSEMBLE