Changeset View
Changeset View
Standalone View
Standalone View
head/sys/geom/eli/g_eli.c
Show First 20 Lines • Show All 999 Lines • ▼ Show 20 Lines | failed: | ||||
if (cp->provider != NULL) { | if (cp->provider != NULL) { | ||||
if (cp->acr == 1) | if (cp->acr == 1) | ||||
g_access(cp, -1, -dcw, -1); | g_access(cp, -1, -dcw, -1); | ||||
g_detach(cp); | g_detach(cp); | ||||
} | } | ||||
g_destroy_consumer(cp); | g_destroy_consumer(cp); | ||||
g_destroy_geom(gp); | g_destroy_geom(gp); | ||||
g_eli_key_destroy(sc); | g_eli_key_destroy(sc); | ||||
bzero(sc, sizeof(*sc)); | zfree(sc, M_ELI); | ||||
free(sc, M_ELI); | |||||
return (NULL); | return (NULL); | ||||
} | } | ||||
int | int | ||||
g_eli_destroy(struct g_eli_softc *sc, boolean_t force) | g_eli_destroy(struct g_eli_softc *sc, boolean_t force) | ||||
{ | { | ||||
struct g_geom *gp; | struct g_geom *gp; | ||||
struct g_provider *pp; | struct g_provider *pp; | ||||
Show All 26 Lines | g_eli_destroy(struct g_eli_softc *sc, boolean_t force) | ||||
wakeup(sc); | wakeup(sc); | ||||
while (!LIST_EMPTY(&sc->sc_workers)) { | while (!LIST_EMPTY(&sc->sc_workers)) { | ||||
msleep(&sc->sc_workers, &sc->sc_queue_mtx, PRIBIO, | msleep(&sc->sc_workers, &sc->sc_queue_mtx, PRIBIO, | ||||
"geli:destroy", 0); | "geli:destroy", 0); | ||||
} | } | ||||
mtx_destroy(&sc->sc_queue_mtx); | mtx_destroy(&sc->sc_queue_mtx); | ||||
gp->softc = NULL; | gp->softc = NULL; | ||||
g_eli_key_destroy(sc); | g_eli_key_destroy(sc); | ||||
bzero(sc, sizeof(*sc)); | zfree(sc, M_ELI); | ||||
free(sc, M_ELI); | |||||
G_ELI_DEBUG(0, "Device %s destroyed.", gp->name); | G_ELI_DEBUG(0, "Device %s destroyed.", gp->name); | ||||
g_wither_geom_close(gp, ENXIO); | g_wither_geom_close(gp, ENXIO); | ||||
return (0); | return (0); | ||||
} | } | ||||
static int | static int | ||||
▲ Show 20 Lines • Show All 393 Lines • Show Last 20 Lines |