Use root_mount KPI for RAID3 to delay root file system mount.

Actually, one cannot setup root file system on RAID3 device, but when
other file system exist in /etc/fstab which are placed on RAID3 device,
boot process will be interrupted when these devices are missing.

MFC after:	3 days
X-MFC-note:	MFC only to RELENG_6, as RELENG_5 doesn't have root_mount KPI.
This commit is contained in:
Pawel Jakub Dawidek 2005-07-27 09:03:51 +00:00
parent 1fcc990954
commit 4ed854e8d4
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=148440
2 changed files with 28 additions and 0 deletions

View File

@ -1688,6 +1688,13 @@ static int
g_raid3_try_destroy(struct g_raid3_softc *sc)
{
if (sc->sc_rootmount != NULL) {
G_RAID3_DEBUG(1, "root_mount_rel[%u] %p", __LINE__,
sc->sc_rootmount);
root_mount_rel(sc->sc_rootmount);
sc->sc_rootmount = NULL;
}
g_topology_lock();
if (!g_raid3_can_destroy(sc)) {
g_topology_unlock();
@ -2149,6 +2156,10 @@ g_raid3_update_device(struct g_raid3_softc *sc, boolean_t force)
* Timeout expired, so destroy device.
*/
sc->sc_flags |= G_RAID3_DEVICE_FLAG_DESTROY;
G_RAID3_DEBUG(1, "root_mount_rel[%u] %p",
__LINE__, sc->sc_rootmount);
root_mount_rel(sc->sc_rootmount);
sc->sc_rootmount = NULL;
}
return;
}
@ -2291,6 +2302,12 @@ g_raid3_update_device(struct g_raid3_softc *sc, boolean_t force)
}
if (sc->sc_provider == NULL)
g_raid3_launch_provider(sc);
if (sc->sc_rootmount != NULL) {
G_RAID3_DEBUG(1, "root_mount_rel[%u] %p", __LINE__,
sc->sc_rootmount);
root_mount_rel(sc->sc_rootmount);
sc->sc_rootmount = NULL;
}
break;
case G_RAID3_DEVICE_STATE_COMPLETE:
/*
@ -2318,6 +2335,12 @@ g_raid3_update_device(struct g_raid3_softc *sc, boolean_t force)
}
if (sc->sc_provider == NULL)
g_raid3_launch_provider(sc);
if (sc->sc_rootmount != NULL) {
G_RAID3_DEBUG(1, "root_mount_rel[%u] %p", __LINE__,
sc->sc_rootmount);
root_mount_rel(sc->sc_rootmount);
sc->sc_rootmount = NULL;
}
break;
default:
KASSERT(1 == 0, ("Wrong device state (%s, %s).", sc->sc_name,
@ -2810,6 +2833,9 @@ g_raid3_create(struct g_class *mp, const struct g_raid3_metadata *md)
G_RAID3_DEBUG(0, "Device %s created (id=%u).", sc->sc_name, sc->sc_id);
sc->sc_rootmount = root_mount_hold("GRAID3");
G_RAID3_DEBUG(1, "root_mount_hold %p", sc->sc_rootmount);
/*
* Run timeout.
*/

View File

@ -202,6 +202,8 @@ struct g_raid3_softc {
struct mtx sc_events_mtx;
struct callout sc_callout;
struct root_hold_token *sc_rootmount;
};
#define sc_name sc_geom->name