diff options
author | pjd <pjd@FreeBSD.org> | 2005-07-27 09:03:51 +0000 |
---|---|---|
committer | pjd <pjd@FreeBSD.org> | 2005-07-27 09:03:51 +0000 |
commit | eb467446d554f35934e398955fb9792fd5df2f34 (patch) | |
tree | 42c037634c3a0c921f38fbb8d034debe3c88a609 /sys | |
parent | 6393df51ccd1a016925d2808ebf5d4b3bde64aaf (diff) | |
download | FreeBSD-src-eb467446d554f35934e398955fb9792fd5df2f34.zip FreeBSD-src-eb467446d554f35934e398955fb9792fd5df2f34.tar.gz |
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.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/geom/raid3/g_raid3.c | 26 | ||||
-rw-r--r-- | sys/geom/raid3/g_raid3.h | 2 |
2 files changed, 28 insertions, 0 deletions
diff --git a/sys/geom/raid3/g_raid3.c b/sys/geom/raid3/g_raid3.c index c15fb66..e60bf9b 100644 --- a/sys/geom/raid3/g_raid3.c +++ b/sys/geom/raid3/g_raid3.c @@ -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. */ diff --git a/sys/geom/raid3/g_raid3.h b/sys/geom/raid3/g_raid3.h index 0f4ac18..b666c8a 100644 --- a/sys/geom/raid3/g_raid3.h +++ b/sys/geom/raid3/g_raid3.h @@ -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 |