Revamp the devstat priority system. All disks now have the same priority.

The same goes for CD drivers and tape drivers.  In systems with mixed IDE
and SCSI, devices in the same priority class will be sorted in attach
order.

Also, the 'CCD' priority is now the 'ARRAY' priority, and a number of
drivers have been modified to use that priority.

This includes the necessary changes to all drivers, except the ATA drivers.
Soren will modify those separately.

This does not include and does not require any change in the devstat
version number, since no known userland applications use the priority
enumerations.

Reviewed by:	msmith, sos, phk, jlemon, mjacob, bde
This commit is contained in:
Kenneth D. Merry 1999-12-08 04:45:23 +00:00
parent dd92370286
commit 86b2c8466d
15 changed files with 28 additions and 32 deletions

View File

@ -305,13 +305,10 @@ typedef enum {
DEVSTAT_PRIORITY_PASS = 0x030,
DEVSTAT_PRIORITY_FD = 0x040,
DEVSTAT_PRIORITY_WFD = 0x050,
DEVSTAT_PRIORITY_SA = 0x060,
DEVSTAT_PRIORITY_OCD = 0x070,
DEVSTAT_PRIORITY_WCD = 0x080,
DEVSTAT_PRIORITY_TAPE = 0x060,
DEVSTAT_PRIORITY_CD = 0x090,
DEVSTAT_PRIORITY_WD = 0x100,
DEVSTAT_PRIORITY_DA = 0x110,
DEVSTAT_PRIORITY_CCD = 0x120,
DEVSTAT_PRIORITY_DISK = 0x110,
DEVSTAT_PRIORITY_ARRAY = 0x120,
DEVSTAT_PRIORITY_MAX = 0xfff
} devstat_priority;
.Ed

View File

@ -961,7 +961,7 @@ daregister(struct cam_periph *periph, void *arg)
periph->unit_number, 0,
DEVSTAT_BS_UNAVAILABLE,
cgd->pd_type | DEVSTAT_TYPE_IF_SCSI,
DEVSTAT_PRIORITY_DA);
DEVSTAT_PRIORITY_DISK);
/*
* Register this media as a disk

View File

@ -1398,7 +1398,7 @@ saregister(struct cam_periph *periph, void *arg)
*/
devstat_add_entry(&softc->device_stats, "sa", periph->unit_number, 0,
DEVSTAT_BS_UNAVAILABLE, cgd->pd_type | DEVSTAT_TYPE_IF_SCSI,
DEVSTAT_PRIORITY_SA);
DEVSTAT_PRIORITY_TAPE);
softc->devs.ctl_dev = make_dev(&sa_cdevsw, SAMINOR(SA_CTLDEV,
periph->unit_number, 0, SA_ATYPE_R), UID_ROOT, GID_OPERATOR,

View File

@ -326,7 +326,8 @@ flaattach (device_t dev)
devstat_add_entry(&softc[unit].stats, "fla", unit, DEV_BSIZE,
DEVSTAT_NO_ORDERED_TAGS,
DEVSTAT_TYPE_DIRECT | DEVSTAT_TYPE_IF_OTHER, 0x190);
DEVSTAT_TYPE_DIRECT | DEVSTAT_TYPE_IF_OTHER,
DEVSTAT_PRIORITY_DISK);
sc->dev = disk_create(unit, &sc->disk, 0, &fla_cdevsw, &fladisk_cdevsw);
sc->dev->si_drv1 = sc;

View File

@ -288,8 +288,8 @@ amrd_attach(device_t dev)
devstat_add_entry(&sc->amrd_stats, "amrd", sc->amrd_unit, AMR_BLKSIZE,
DEVSTAT_NO_ORDERED_TAGS,
DEVSTAT_TYPE_DIRECT | DEVSTAT_TYPE_IF_OTHER,
DEVSTAT_PRIORITY_DA);
DEVSTAT_TYPE_STORARRAY | DEVSTAT_TYPE_IF_OTHER,
DEVSTAT_PRIORITY_ARRAY);
disk_create(sc->amrd_unit, &sc->amrd_disk, 0, &amrd_cdevsw, &amrddisk_cdevsw);
disks_registered++;

View File

@ -543,8 +543,8 @@ ccdinit(ccd, cpaths, p)
*/
devstat_add_entry(&cs->device_stats, "ccd", ccd->ccd_unit,
ccg->ccg_secsize, DEVSTAT_ALL_SUPPORTED,
DEVSTAT_TYPE_ASC0 |DEVSTAT_TYPE_IF_OTHER,
DEVSTAT_PRIORITY_CCD);
DEVSTAT_TYPE_STORARRAY |DEVSTAT_TYPE_IF_OTHER,
DEVSTAT_PRIORITY_ARRAY);
cs->sc_flags |= CCDF_INITED;
cs->sc_cflags = ccd->ccd_flags; /* So we can find out later... */

View File

@ -312,7 +312,8 @@ idattach(device_t dev)
devstat_add_entry(&drv->stats, "id", drv->unit, drv->secsize,
DEVSTAT_NO_ORDERED_TAGS,
DEVSTAT_TYPE_DIRECT | DEVSTAT_TYPE_IF_OTHER, DEVSTAT_PRIORITY_DA);
DEVSTAT_TYPE_STORARRAY| DEVSTAT_TYPE_IF_OTHER,
DEVSTAT_PRIORITY_ARRAY);
return (0);
}

View File

@ -273,8 +273,8 @@ mlxd_attach(device_t dev)
devstat_add_entry(&sc->mlxd_stats, "mlxd", sc->mlxd_unit, MLX_BLKSIZE,
DEVSTAT_NO_ORDERED_TAGS,
DEVSTAT_TYPE_DIRECT | DEVSTAT_TYPE_IF_OTHER,
DEVSTAT_PRIORITY_DA);
DEVSTAT_TYPE_STORARRAY | DEVSTAT_TYPE_IF_OTHER,
DEVSTAT_PRIORITY_ARRAY);
dsk = disk_create(sc->mlxd_unit, &sc->mlxd_disk, 0, &mlxd_cdevsw, &mlxddisk_cdevsw);
disks_registered++;

View File

@ -543,8 +543,8 @@ ccdinit(ccd, cpaths, p)
*/
devstat_add_entry(&cs->device_stats, "ccd", ccd->ccd_unit,
ccg->ccg_secsize, DEVSTAT_ALL_SUPPORTED,
DEVSTAT_TYPE_ASC0 |DEVSTAT_TYPE_IF_OTHER,
DEVSTAT_PRIORITY_CCD);
DEVSTAT_TYPE_STORARRAY |DEVSTAT_TYPE_IF_OTHER,
DEVSTAT_PRIORITY_ARRAY);
cs->sc_flags |= CCDF_INITED;
cs->sc_cflags = ccd->ccd_flags; /* So we can find out later... */

View File

@ -251,14 +251,14 @@ acdattach(struct atapi *ata, int unit, struct atapi_params *ap, int debug)
devstat_add_entry(cdp->device_stats, string, tmpcdp->lun, DEV_BSIZE,
DEVSTAT_NO_ORDERED_TAGS,
DEVSTAT_TYPE_CDROM | DEVSTAT_TYPE_IF_IDE,
DEVSTAT_PRIORITY_WCD);
DEVSTAT_PRIORITY_CD);
}
else {
acdnlun++;
devstat_add_entry(cdp->device_stats, "wcd", cdp->lun, DEV_BSIZE,
DEVSTAT_NO_ORDERED_TAGS,
DEVSTAT_TYPE_CDROM | DEVSTAT_TYPE_IF_IDE,
DEVSTAT_PRIORITY_WCD);
DEVSTAT_PRIORITY_CD);
}
return 1;
}

View File

@ -522,7 +522,7 @@ wdattach(struct isa_device *dvp)
DEVSTAT_NO_ORDERED_TAGS,
DEVSTAT_TYPE_DIRECT |
DEVSTAT_TYPE_IF_IDE,
DEVSTAT_PRIORITY_WD);
DEVSTAT_PRIORITY_DISK);
} else {
free(du, M_TEMP);

View File

@ -251,14 +251,14 @@ acdattach(struct atapi *ata, int unit, struct atapi_params *ap, int debug)
devstat_add_entry(cdp->device_stats, string, tmpcdp->lun, DEV_BSIZE,
DEVSTAT_NO_ORDERED_TAGS,
DEVSTAT_TYPE_CDROM | DEVSTAT_TYPE_IF_IDE,
DEVSTAT_PRIORITY_WCD);
DEVSTAT_PRIORITY_CD);
}
else {
acdnlun++;
devstat_add_entry(cdp->device_stats, "wcd", cdp->lun, DEV_BSIZE,
DEVSTAT_NO_ORDERED_TAGS,
DEVSTAT_TYPE_CDROM | DEVSTAT_TYPE_IF_IDE,
DEVSTAT_PRIORITY_WCD);
DEVSTAT_PRIORITY_CD);
}
return 1;
}

View File

@ -610,7 +610,7 @@ wdattach(struct isa_device *dvp)
DEVSTAT_NO_ORDERED_TAGS,
DEVSTAT_TYPE_DIRECT |
DEVSTAT_TYPE_IF_IDE,
DEVSTAT_PRIORITY_WD);
DEVSTAT_PRIORITY_DISK);
} else {
free(du, M_TEMP);

View File

@ -251,14 +251,14 @@ acdattach(struct atapi *ata, int unit, struct atapi_params *ap, int debug)
devstat_add_entry(cdp->device_stats, string, tmpcdp->lun, DEV_BSIZE,
DEVSTAT_NO_ORDERED_TAGS,
DEVSTAT_TYPE_CDROM | DEVSTAT_TYPE_IF_IDE,
DEVSTAT_PRIORITY_WCD);
DEVSTAT_PRIORITY_CD);
}
else {
acdnlun++;
devstat_add_entry(cdp->device_stats, "wcd", cdp->lun, DEV_BSIZE,
DEVSTAT_NO_ORDERED_TAGS,
DEVSTAT_TYPE_CDROM | DEVSTAT_TYPE_IF_IDE,
DEVSTAT_PRIORITY_WCD);
DEVSTAT_PRIORITY_CD);
}
return 1;
}

View File

@ -79,13 +79,10 @@ typedef enum {
DEVSTAT_PRIORITY_PASS = 0x030,
DEVSTAT_PRIORITY_FD = 0x040,
DEVSTAT_PRIORITY_WFD = 0x050,
DEVSTAT_PRIORITY_SA = 0x060,
DEVSTAT_PRIORITY_OCD = 0x070,
DEVSTAT_PRIORITY_WCD = 0x080,
DEVSTAT_PRIORITY_TAPE = 0x060,
DEVSTAT_PRIORITY_CD = 0x090,
DEVSTAT_PRIORITY_WD = 0x100,
DEVSTAT_PRIORITY_DA = 0x110,
DEVSTAT_PRIORITY_CCD = 0x120,
DEVSTAT_PRIORITY_DISK = 0x110,
DEVSTAT_PRIORITY_ARRAY = 0x120,
DEVSTAT_PRIORITY_MAX = 0xfff
} devstat_priority;