Remove compatibility shims for legacy ATA device names.

We got new ATA stack in FreeBSD 8.x, switched to it at 9.x, completely
removed old stack at 10.x, so at 11.x it is time to remove compat shims.
This commit is contained in:
mav 2015-10-11 13:01:51 +00:00
parent 1fd9c17d05
commit 64d53c4c7d
23 changed files with 11 additions and 141 deletions

View File

@ -31,6 +31,12 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 11.x IS SLOW:
disable the most expensive debugging functionality run
"ln -s 'abort:false,junk:false' /etc/malloc.conf".)
20151011:
Compatibility shims for legacy ATA device names have been removed.
It includes ATA_STATIC_ID kernel option, kern.cam.ada.legacy_aliases
and kern.geom.raid.legacy_aliases loader tunables, kern.devalias.*
environment variables, /dev/ad* and /dev/ar* symbolic links.
20151006:
Clang, llvm, lldb, compiler-rt and libc++ have been upgraded to 3.7.0.
Please see the 20141231 entry below for information about prerequisites

View File

@ -304,9 +304,6 @@ Write errors are always considered as disk failures.
Time to wait for missing array components on startup.
.It Va kern.geom.raid. Ns Ar X Ns Va .enable : No 1
Enable taste for specific metadata or transformation module.
.It Va kern.geom.raid.legacy_aliases : No 0
Enable geom raid emulation of legacy /dev/ar%d devices.
This should aid the upgrade of systems from legacy to modern releases.
.El
.Sh EXIT STATUS
Exit status is 0 on success, and non-zero if the command fails.

View File

@ -146,16 +146,6 @@ instead of
.Pa /etc/sysctl.conf .
The global default is currently 1.
The per-device default is to leave it as-is (follow global setting).
.It Va kern.cam.ada.legacy_aliases
.Pp
This variable determines whether
.Pa /dev/ad Ns Ar Y
symbolic links are created,
which tries to mimic old
.Xr ata 4
numbering.
Set to 1 to enable legacy aliases symlinks, 0 to disable.
The default is currently enabled.
.El
.Sh FILES
.Bl -tag -width ".Pa /dev/ada*" -compact

View File

@ -109,7 +109,6 @@ device fdc
# ATA controllers
device ahci # AHCI-compatible SATA controllers
device ata # Legacy ATA/SATA controllers
options ATA_STATIC_ID # Static device numbering
device mvs # Marvell 88SX50XX/88SX60XX/88SX70XX/SoC SATA
device siis # SiliconImage SiI3124/SiI3132/SiI3531 SATA

View File

@ -62,7 +62,6 @@ device mmcsd # mmc/sd flash cards
# ATA controllers
device ahci # AHCI-compatible SATA controllers
#device ata # Legacy ATA/SATA controllers
#options ATA_STATIC_ID # Static device numbering
# Console and misc
device uart

View File

@ -48,7 +48,6 @@ device gpio
# ATA controllers
device ahci # AHCI-compatible SATA controllers
device ata # Legacy ATA/SATA controllers
options ATA_STATIC_ID # Static device numbering
# ATA/SCSI peripherals
device scbus # SCSI bus (required for ATA/SCSI)

View File

@ -76,7 +76,6 @@ device uart
device pci
device ata
options ATA_STATIC_ID # Static device numbering
device scbus # SCSI bus (required for ATA/SCSI)
device cd # CD

View File

@ -59,7 +59,6 @@ device mmcsd # mmc/sd flash cards
# ATA controllers
device ahci # AHCI-compatible SATA controllers
#device ata # Legacy ATA/SATA controllers
#options ATA_STATIC_ID # Static device numbering
# Console and misc
device uart

View File

@ -91,7 +91,6 @@ options ALT_BREAK_TO_DEBUGGER
device ata
device atapci # Only for helper functions
device imxata
options ATA_STATIC_ID # Static device numbering
device gpio
device gpioled

View File

@ -76,7 +76,6 @@ device uart
device pci
device ata
options ATA_STATIC_ID # Static device numbering
device scbus # SCSI bus (required for ATA/SCSI)
device cd # CD

View File

@ -80,7 +80,6 @@ options ALT_BREAK_TO_DEBUGGER
device ata
device atapci # Only for helper functions
device imxata
options ATA_STATIC_ID # Static device numbering
device gpio
device gpioled

View File

@ -75,7 +75,6 @@ device uart
device pci
device ata
options ATA_STATIC_ID # Static device numbering
device scbus # SCSI bus (required for ATA/SCSI)
device cd # CD

View File

@ -582,7 +582,6 @@ static void adaresume(void *arg);
#define ata_disk_firmware_geom_adjust(disk)
#endif
static int ada_legacy_aliases = ADA_DEFAULT_LEGACY_ALIASES;
static int ada_retry_count = ADA_DEFAULT_RETRY;
static int ada_default_timeout = ADA_DEFAULT_TIMEOUT;
static int ada_send_ordered = ADA_DEFAULT_SEND_ORDERED;
@ -593,8 +592,6 @@ static int ada_write_cache = ADA_DEFAULT_WRITE_CACHE;
static SYSCTL_NODE(_kern_cam, OID_AUTO, ada, CTLFLAG_RD, 0,
"CAM Direct Access Disk driver");
SYSCTL_INT(_kern_cam_ada, OID_AUTO, legacy_aliases, CTLFLAG_RWTUN,
&ada_legacy_aliases, 0, "Create legacy-like device aliases");
SYSCTL_INT(_kern_cam_ada, OID_AUTO, retry_count, CTLFLAG_RWTUN,
&ada_retry_count, 0, "Normal I/O retry count");
SYSCTL_INT(_kern_cam_ada, OID_AUTO, default_timeout, CTLFLAG_RWTUN,
@ -1164,11 +1161,11 @@ adaregister(struct cam_periph *periph, void *arg)
struct ada_softc *softc;
struct ccb_pathinq cpi;
struct ccb_getdev *cgd;
char announce_buf[80], buf1[32];
char announce_buf[80];
struct disk_params *dp;
caddr_t match;
u_int maxio;
int legacy_id, quirks;
int quirks;
cgd = (struct ccb_getdev *)arg;
if (cgd == NULL) {
@ -1331,22 +1328,6 @@ adaregister(struct cam_periph *periph, void *arg)
softc->disk->d_fwheads = softc->params.heads;
ata_disk_firmware_geom_adjust(softc->disk);
if (ada_legacy_aliases) {
#ifdef ATA_STATIC_ID
legacy_id = xpt_path_legacy_ata_id(periph->path);
#else
legacy_id = softc->disk->d_unit;
#endif
if (legacy_id >= 0) {
snprintf(announce_buf, sizeof(announce_buf),
"kern.devalias.%s%d",
softc->disk->d_name, softc->disk->d_unit);
snprintf(buf1, sizeof(buf1),
"ad%d", legacy_id);
kern_setenv(announce_buf, buf1);
}
} else
legacy_id = -1;
/*
* Acquire a reference to the periph before we register with GEOM.
* We'll release this reference once GEOM calls us back (via
@ -1372,9 +1353,6 @@ adaregister(struct cam_periph *periph, void *arg)
dp->secs_per_track, dp->cylinders);
xpt_announce_periph(periph, announce_buf);
xpt_announce_quirks(periph, softc->quirks, ADA_Q_BIT_STRING);
if (legacy_id >= 0)
printf("%s%d: Previously was known as ad%d\n",
periph->periph_name, periph->unit_number, legacy_id);
/*
* Create our sysctl variables, now that we know

View File

@ -3756,45 +3756,6 @@ xpt_path_periph(struct cam_path *path)
return (path->periph);
}
int
xpt_path_legacy_ata_id(struct cam_path *path)
{
struct cam_eb *bus;
int bus_id;
if ((strcmp(path->bus->sim->sim_name, "ata") != 0) &&
strcmp(path->bus->sim->sim_name, "ahcich") != 0 &&
strcmp(path->bus->sim->sim_name, "mvsch") != 0 &&
strcmp(path->bus->sim->sim_name, "siisch") != 0)
return (-1);
if (strcmp(path->bus->sim->sim_name, "ata") == 0 &&
path->bus->sim->unit_number < 2) {
bus_id = path->bus->sim->unit_number;
} else {
bus_id = 2;
xpt_lock_buses();
TAILQ_FOREACH(bus, &xsoftc.xpt_busses, links) {
if (bus == path->bus)
break;
if ((strcmp(bus->sim->sim_name, "ata") == 0 &&
bus->sim->unit_number >= 2) ||
strcmp(bus->sim->sim_name, "ahcich") == 0 ||
strcmp(bus->sim->sim_name, "mvsch") == 0 ||
strcmp(bus->sim->sim_name, "siisch") == 0)
bus_id++;
}
xpt_unlock_buses();
}
if (path->target != NULL) {
if (path->target->target_id < 2)
return (bus_id * 2 + path->target->target_id);
else
return (-1);
} else
return (bus_id * 2);
}
/*
* Release a CAM control block for the caller. Remit the cost of the structure
* to the device referenced by the path. If the this device had no 'credits'

View File

@ -101,7 +101,6 @@ int xpt_path_string(struct cam_path *path, char *str,
path_id_t xpt_path_path_id(struct cam_path *path);
target_id_t xpt_path_target_id(struct cam_path *path);
lun_id_t xpt_path_lun_id(struct cam_path *path);
int xpt_path_legacy_ata_id(struct cam_path *path);
struct cam_sim *xpt_path_sim(struct cam_path *path);
struct cam_periph *xpt_path_periph(struct cam_path *path);
void xpt_async(u_int32_t async_code, struct cam_path *path,

View File

@ -1759,12 +1759,9 @@ hint.ata.1.irq="15"
#
# The following options are valid on the ATA driver:
#
# ATA_STATIC_ID: controller numbering is static ie depends on location
# else the device numbers are dynamically allocated.
# ATA_REQUEST_TIMEOUT: the number of seconds to wait for an ATA request
# before timing out.
options ATA_STATIC_ID
#options ATA_REQUEST_TIMEOUT=10
#

View File

@ -280,9 +280,9 @@ g_dev_taste(struct g_class *mp, struct g_provider *pp, int insist __unused)
struct g_geom *gp;
struct g_consumer *cp;
struct g_dev_softc *sc;
int error, len;
struct cdev *dev, *adev;
char buf[SPECNAMELEN + 6], *val;
int error;
struct cdev *dev;
char buf[SPECNAMELEN + 6];
g_trace(G_T_TOPOLOGY, "dev_taste(%s,%s)", mp->name, pp->name);
g_topology_assert();
@ -310,33 +310,9 @@ g_dev_taste(struct g_class *mp, struct g_provider *pp, int insist __unused)
dev->si_flags |= SI_UNMAPPED;
sc->sc_dev = dev;
/* Search for device alias name and create it if found. */
adev = NULL;
for (len = MIN(strlen(gp->name), sizeof(buf) - 15); len > 0; len--) {
snprintf(buf, sizeof(buf), "kern.devalias.%s", gp->name);
buf[14 + len] = 0;
val = kern_getenv(buf);
if (val != NULL) {
snprintf(buf, sizeof(buf), "%s%s",
val, gp->name + len);
freeenv(val);
if ((make_dev_alias_p(MAKEDEV_CHECKNAME|MAKEDEV_WAITOK,
&adev, dev, "%s", buf)) != 0)
printf("Warning: unable to create device "
"alias %s\n", buf);
break;
}
}
dev->si_iosize_max = MAXPHYS;
dev->si_drv2 = cp;
init_dumpdev(dev);
if (adev != NULL) {
adev->si_iosize_max = MAXPHYS;
adev->si_drv2 = cp;
adev->si_flags |= SI_UNMAPPED;
init_dumpdev(adev);
}
g_dev_attrchanged(cp, "GEOM::physpath");
snprintf(buf, sizeof(buf), "cdev=%s", gp->name);

View File

@ -82,10 +82,6 @@ static u_int g_raid_idle_threshold = 1000000;
SYSCTL_UINT(_kern_geom_raid, OID_AUTO, idle_threshold, CTLFLAG_RWTUN,
&g_raid_idle_threshold, 1000000,
"Time in microseconds to consider a volume idle.");
static u_int ar_legacy_aliases = 1;
SYSCTL_INT(_kern_geom_raid, OID_AUTO, legacy_aliases, CTLFLAG_RWTUN,
&ar_legacy_aliases, 0, "Create aliases named as the legacy ataraid style.");
#define MSLEEP(rv, ident, mtx, priority, wmesg, timeout) do { \
G_RAID_DEBUG(4, "%s: Sleeping %p.", __func__, (ident)); \
@ -1628,7 +1624,6 @@ g_raid_launch_provider(struct g_raid_volume *vol)
struct g_raid_softc *sc;
struct g_provider *pp;
char name[G_RAID_MAX_VOLUMENAME];
char announce_buf[80], buf1[32];
off_t off;
int i;
@ -1644,21 +1639,6 @@ g_raid_launch_provider(struct g_raid_volume *vol)
snprintf(name, sizeof(name), "raid/r%d", vol->v_global_id);
}
/*
* Create a /dev/ar%d that the old ataraid(4) stack once
* created as an alias for /dev/raid/r%d if requested.
* This helps going from stable/7 ataraid devices to newer
* FreeBSD releases. sbruno 07 MAY 2013
*/
if (ar_legacy_aliases) {
snprintf(announce_buf, sizeof(announce_buf),
"kern.devalias.%s", name);
snprintf(buf1, sizeof(buf1),
"ar%d", vol->v_global_id);
kern_setenv(announce_buf, buf1);
}
pp = g_new_providerf(sc->sc_geom, "%s", name);
pp->flags |= G_PF_DIRECT_RECEIVE;
if (vol->v_tr->tro_class->trc_accept_unmapped) {

View File

@ -109,7 +109,6 @@ device fdc
# ATA controllers
device ahci # AHCI-compatible SATA controllers
device ata # Legacy ATA/SATA controllers
options ATA_STATIC_ID # Static device numbering
device mvs # Marvell 88SX50XX/88SX60XX/88SX70XX/SoC SATA
device siis # SiliconImage SiI3124/SiI3132/SiI3531 SATA

View File

@ -51,7 +51,6 @@ device pci
# ATA and ATAPI devices
device ata
options ATA_STATIC_ID # Static device numbering
# ATA/SCSI peripherals
device scbus # SCSI bus (required for ATA/SCSI)

View File

@ -108,7 +108,6 @@ device pci
# ATA controllers
device ahci # AHCI-compatible SATA controllers
device ata # Legacy ATA/SATA controllers
options ATA_STATIC_ID # Static device numbering
device mvs # Marvell 88SX50XX/88SX60XX/88SX70XX/SoC SATA
device siis # SiliconImage SiI3124/SiI3132/SiI3531 SATA

View File

@ -57,4 +57,3 @@ device da
device pass
device ata
options ATA_STATIC_ID # Static device numbering

View File

@ -93,7 +93,6 @@ device fdc
# ATA controllers
device ahci # AHCI-compatible SATA controllers
device ata # Legacy ATA/SATA controllers
options ATA_STATIC_ID # Static device numbering
device mvs # Marvell 88SX50XX/88SX60XX/88SX70XX/SoC SATA
device siis # SiliconImage SiI3124/SiI3132/SiI3531 SATA