diff options
author | Alexander Motin <mav@FreeBSD.org> | 2016-09-23 21:29:40 +0000 |
---|---|---|
committer | Alexander Motin <mav@FreeBSD.org> | 2016-09-23 21:29:40 +0000 |
commit | 8b64f3ca6c222808ef42281a2c49ae9eac59ac06 (patch) | |
tree | fc835903f7f9730a9081ebe10de96262e6b9870b /sys/geom | |
parent | aa93b99aa0417e407ab017923b6d102673409eb7 (diff) | |
download | src-8b64f3ca6c222808ef42281a2c49ae9eac59ac06.tar.gz src-8b64f3ca6c222808ef42281a2c49ae9eac59ac06.zip |
Use g_wither_provider() where applicable.
It is just a helper function combining G_PF_WITHER setting with
g_orphan_provider().
Notes
Notes:
svn path=/head/; revision=306279
Diffstat (limited to 'sys/geom')
-rw-r--r-- | sys/geom/bde/g_bde.c | 2 | ||||
-rw-r--r-- | sys/geom/concat/g_concat.c | 3 | ||||
-rw-r--r-- | sys/geom/gate/g_gate.c | 3 | ||||
-rw-r--r-- | sys/geom/journal/g_journal.c | 3 | ||||
-rw-r--r-- | sys/geom/linux_lvm/g_linux_lvm.c | 2 | ||||
-rw-r--r-- | sys/geom/mirror/g_mirror.c | 5 | ||||
-rw-r--r-- | sys/geom/mountver/g_mountver.c | 2 | ||||
-rw-r--r-- | sys/geom/raid3/g_raid3.c | 3 | ||||
-rw-r--r-- | sys/geom/shsec/g_shsec.c | 2 | ||||
-rw-r--r-- | sys/geom/stripe/g_stripe.c | 3 | ||||
-rw-r--r-- | sys/geom/vinum/geom_vinum_rm.c | 3 | ||||
-rw-r--r-- | sys/geom/virstor/g_virstor.c | 6 |
12 files changed, 14 insertions, 23 deletions
diff --git a/sys/geom/bde/g_bde.c b/sys/geom/bde/g_bde.c index 7eda17fee2c3..6ebd8562222c 100644 --- a/sys/geom/bde/g_bde.c +++ b/sys/geom/bde/g_bde.c @@ -85,7 +85,7 @@ g_bde_orphan(struct g_consumer *cp) sc = gp->softc; gp->flags |= G_GEOM_WITHER; LIST_FOREACH(pp, &gp->provider, provider) - g_orphan_provider(pp, ENXIO); + g_wither_provider(pp, ENXIO); bzero(sc, sizeof(struct g_bde_softc)); /* destroy evidence */ return; } diff --git a/sys/geom/concat/g_concat.c b/sys/geom/concat/g_concat.c index 4627ff9fa2ca..ccd4bad3eaf9 100644 --- a/sys/geom/concat/g_concat.c +++ b/sys/geom/concat/g_concat.c @@ -129,10 +129,9 @@ g_concat_remove_disk(struct g_concat_disk *disk) } if (sc->sc_provider != NULL) { - sc->sc_provider->flags |= G_PF_WITHER; G_CONCAT_DEBUG(0, "Device %s deactivated.", sc->sc_provider->name); - g_orphan_provider(sc->sc_provider, ENXIO); + g_wither_provider(sc->sc_provider, ENXIO); sc->sc_provider = NULL; } diff --git a/sys/geom/gate/g_gate.c b/sys/geom/gate/g_gate.c index 8cfe9d4aaac0..767c6837d165 100644 --- a/sys/geom/gate/g_gate.c +++ b/sys/geom/gate/g_gate.c @@ -109,8 +109,7 @@ g_gate_destroy(struct g_gate_softc *sc, boolean_t force) wakeup(sc); mtx_unlock(&sc->sc_queue_mtx); gp = pp->geom; - pp->flags |= G_PF_WITHER; - g_orphan_provider(pp, ENXIO); + g_wither_provider(pp, ENXIO); callout_drain(&sc->sc_callout); bioq_init(&queue); mtx_lock(&sc->sc_queue_mtx); diff --git a/sys/geom/journal/g_journal.c b/sys/geom/journal/g_journal.c index 0678003cbccf..d4d6a6896cb3 100644 --- a/sys/geom/journal/g_journal.c +++ b/sys/geom/journal/g_journal.c @@ -2462,8 +2462,7 @@ g_journal_destroy(struct g_journal_softc *sc) GJ_DEBUG(1, "Marking %s as clean.", sc->sc_name); g_journal_metadata_update(sc); g_topology_lock(); - pp->flags |= G_PF_WITHER; - g_orphan_provider(pp, ENXIO); + g_wither_provider(pp, ENXIO); } else { g_topology_lock(); } diff --git a/sys/geom/linux_lvm/g_linux_lvm.c b/sys/geom/linux_lvm/g_linux_lvm.c index bf2f1e795f3b..f03ba10579b0 100644 --- a/sys/geom/linux_lvm/g_linux_lvm.c +++ b/sys/geom/linux_lvm/g_linux_lvm.c @@ -333,7 +333,7 @@ g_llvm_remove_disk(struct g_llvm_vg *vg, struct g_consumer *cp) if (found) { G_LLVM_DEBUG(0, "Device %s removed.", lv->lv_gprov->name); - g_orphan_provider(lv->lv_gprov, ENXIO); + g_wither_provider(lv->lv_gprov, ENXIO); lv->lv_gprov = NULL; } } diff --git a/sys/geom/mirror/g_mirror.c b/sys/geom/mirror/g_mirror.c index 75433d15b6d0..112d9da52dbb 100644 --- a/sys/geom/mirror/g_mirror.c +++ b/sys/geom/mirror/g_mirror.c @@ -2154,10 +2154,9 @@ g_mirror_destroy_provider(struct g_mirror_softc *sc) mtx_unlock(&sc->sc_queue_mtx); G_MIRROR_DEBUG(0, "Device %s: provider %s destroyed.", sc->sc_name, sc->sc_provider->name); - sc->sc_provider->flags |= G_PF_WITHER; - g_orphan_provider(sc->sc_provider, ENXIO); - g_topology_unlock(); + g_wither_provider(sc->sc_provider, ENXIO); sc->sc_provider = NULL; + g_topology_unlock(); LIST_FOREACH(disk, &sc->sc_disks, d_next) { if (disk->d_state == G_MIRROR_DISK_STATE_SYNCHRONIZING) g_mirror_sync_stop(disk, 1); diff --git a/sys/geom/mountver/g_mountver.c b/sys/geom/mountver/g_mountver.c index 61375efce0e6..278157b355d3 100644 --- a/sys/geom/mountver/g_mountver.c +++ b/sys/geom/mountver/g_mountver.c @@ -327,7 +327,7 @@ g_mountver_destroy(struct g_geom *gp, boolean_t force) G_MOUNTVER_DEBUG(0, "Device %s removed.", gp->name); } if (pp != NULL) - g_orphan_provider(pp, ENXIO); + g_wither_provider(pp, ENXIO); g_mountver_discard_queued(gp); g_free(sc->sc_provider_name); g_free(gp->softc); diff --git a/sys/geom/raid3/g_raid3.c b/sys/geom/raid3/g_raid3.c index 9b3c483d44d9..174a89398ef6 100644 --- a/sys/geom/raid3/g_raid3.c +++ b/sys/geom/raid3/g_raid3.c @@ -2368,8 +2368,7 @@ g_raid3_destroy_provider(struct g_raid3_softc *sc) mtx_unlock(&sc->sc_queue_mtx); G_RAID3_DEBUG(0, "Device %s: provider %s destroyed.", sc->sc_name, sc->sc_provider->name); - sc->sc_provider->flags |= G_PF_WITHER; - g_orphan_provider(sc->sc_provider, ENXIO); + g_wither_provider(sc->sc_provider, ENXIO); g_topology_unlock(); sc->sc_provider = NULL; if (sc->sc_syncdisk != NULL) diff --git a/sys/geom/shsec/g_shsec.c b/sys/geom/shsec/g_shsec.c index bfdc8fdc1672..dddb8713e2fc 100644 --- a/sys/geom/shsec/g_shsec.c +++ b/sys/geom/shsec/g_shsec.c @@ -156,7 +156,7 @@ g_shsec_remove_disk(struct g_consumer *cp) sc->sc_disks[no] = NULL; if (sc->sc_provider != NULL) { - g_orphan_provider(sc->sc_provider, ENXIO); + g_wither_provider(sc->sc_provider, ENXIO); sc->sc_provider = NULL; G_SHSEC_DEBUG(0, "Device %s removed.", sc->sc_name); } diff --git a/sys/geom/stripe/g_stripe.c b/sys/geom/stripe/g_stripe.c index 1e88e6d606f0..a7e81677e269 100644 --- a/sys/geom/stripe/g_stripe.c +++ b/sys/geom/stripe/g_stripe.c @@ -171,10 +171,9 @@ g_stripe_remove_disk(struct g_consumer *cp) } if (sc->sc_provider != NULL) { - sc->sc_provider->flags |= G_PF_WITHER; G_STRIPE_DEBUG(0, "Device %s deactivated.", sc->sc_provider->name); - g_orphan_provider(sc->sc_provider, ENXIO); + g_wither_provider(sc->sc_provider, ENXIO); sc->sc_provider = NULL; } diff --git a/sys/geom/vinum/geom_vinum_rm.c b/sys/geom/vinum/geom_vinum_rm.c index 0d94de9626ca..049bae07ab20 100644 --- a/sys/geom/vinum/geom_vinum_rm.c +++ b/sys/geom/vinum/geom_vinum_rm.c @@ -223,8 +223,7 @@ gv_rm_vol(struct gv_softc *sc, struct gv_volume *v) /* Get rid of the volume's provider. */ if (pp != NULL) { g_topology_lock(); - pp->flags |= G_PF_WITHER; - g_orphan_provider(pp, ENXIO); + g_wither_provider(pp, ENXIO); g_topology_unlock(); } } diff --git a/sys/geom/virstor/g_virstor.c b/sys/geom/virstor/g_virstor.c index 72d042d60592..bedf406a0742 100644 --- a/sys/geom/virstor/g_virstor.c +++ b/sys/geom/virstor/g_virstor.c @@ -900,11 +900,9 @@ remove_component(struct g_virstor_softc *sc, struct g_virstor_component *comp, LOG_MSG(LVL_DEBUG, "Component %s removed from %s", c->provider->name, sc->geom->name); if (sc->provider != NULL) { - /* Whither, GEOM? */ - sc->provider->flags |= G_PF_WITHER; - g_orphan_provider(sc->provider, ENXIO); + LOG_MSG(LVL_INFO, "Removing provider %s", sc->provider->name); + g_wither_provider(sc->provider, ENXIO); sc->provider = NULL; - LOG_MSG(LVL_INFO, "Removing provider %s", sc->geom->name); } if (c->acr > 0 || c->acw > 0 || c->ace > 0) |