Changeset View
Changeset View
Standalone View
Standalone View
sys/geom/uzip/g_uzip.c
Show First 20 Lines • Show All 88 Lines • ▼ Show 20 Lines | |||||
static void g_uzip_done(struct bio *bp); | static void g_uzip_done(struct bio *bp); | ||||
static void | static void | ||||
g_uzip_softc_free(struct g_uzip_softc *sc, struct g_geom *gp) | g_uzip_softc_free(struct g_uzip_softc *sc, struct g_geom *gp) | ||||
{ | { | ||||
if (gp != NULL) { | if (gp != NULL) { | ||||
printf("%s: %d requests, %d cached\n", | DPRINTF(("%s: %d requests, %d cached\n", | ||||
gp->name, sc->req_total, sc->req_cached); | gp->name, sc->req_total, sc->req_cached)); | ||||
} | } | ||||
if (sc->offsets != NULL) { | if (sc->offsets != NULL) { | ||||
free(sc->offsets, M_GEOM_UZIP); | free(sc->offsets, M_GEOM_UZIP); | ||||
sc->offsets = NULL; | sc->offsets = NULL; | ||||
} | } | ||||
mtx_destroy(&sc->last_mtx); | mtx_destroy(&sc->last_mtx); | ||||
free(sc->last_buf, M_GEOM_UZIP); | free(sc->last_buf, M_GEOM_UZIP); | ||||
free(sc, M_GEOM_UZIP); | free(sc, M_GEOM_UZIP); | ||||
▲ Show 20 Lines • Show All 407 Lines • ▼ Show 20 Lines | g_uzip_taste(struct g_class *mp, struct g_provider *pp, int flags) | ||||
pp2->stripeoffset = pp->stripeoffset; | pp2->stripeoffset = pp->stripeoffset; | ||||
g_error_provider(pp2, 0); | g_error_provider(pp2, 0); | ||||
g_access(cp, -1, 0, 0); | g_access(cp, -1, 0, 0); | ||||
DPRINTF(("%s: taste ok (%d, %jd), (%d, %d), %x\n", | DPRINTF(("%s: taste ok (%d, %jd), (%d, %d), %x\n", | ||||
gp->name, | gp->name, | ||||
pp2->sectorsize, (intmax_t)pp2->mediasize, | pp2->sectorsize, (intmax_t)pp2->mediasize, | ||||
pp2->stripeoffset, pp2->stripesize, pp2->flags)); | pp2->stripeoffset, pp2->stripesize, pp2->flags)); | ||||
printf("%s: %u x %u blocks\n", gp->name, sc->nblocks, sc->blksz); | DPRINTF(("%s: %u x %u blocks\n", gp->name, sc->nblocks, sc->blksz)); | ||||
return (gp); | return (gp); | ||||
err: | err: | ||||
g_topology_lock(); | g_topology_lock(); | ||||
g_access(cp, -1, 0, 0); | g_access(cp, -1, 0, 0); | ||||
if (buf != NULL) | if (buf != NULL) | ||||
free(buf, M_GEOM); | free(buf, M_GEOM); | ||||
if (gp->softc != NULL) { | if (gp->softc != NULL) { | ||||
Show All 11 Lines | |||||
g_uzip_destroy_geom(struct gctl_req *req, struct g_class *mp, struct g_geom *gp) | g_uzip_destroy_geom(struct gctl_req *req, struct g_class *mp, struct g_geom *gp) | ||||
{ | { | ||||
struct g_provider *pp; | struct g_provider *pp; | ||||
g_trace(G_T_TOPOLOGY, "%s(%s, %s)", __func__, mp->name, gp->name); | g_trace(G_T_TOPOLOGY, "%s(%s, %s)", __func__, mp->name, gp->name); | ||||
g_topology_assert(); | g_topology_assert(); | ||||
if (gp->softc == NULL) { | if (gp->softc == NULL) { | ||||
printf("%s(%s): gp->softc == NULL\n", __func__, gp->name); | DPRINTF(("%s(%s): gp->softc == NULL\n", __func__, gp->name)); | ||||
return (ENXIO); | return (ENXIO); | ||||
} | } | ||||
KASSERT(gp != NULL, ("NULL geom")); | KASSERT(gp != NULL, ("NULL geom")); | ||||
pp = LIST_FIRST(&gp->provider); | pp = LIST_FIRST(&gp->provider); | ||||
KASSERT(pp != NULL, ("NULL provider")); | KASSERT(pp != NULL, ("NULL provider")); | ||||
if (pp->acr > 0 || pp->acw > 0 || pp->ace > 0) | if (pp->acr > 0 || pp->acw > 0 || pp->ace > 0) | ||||
return (EBUSY); | return (EBUSY); | ||||
Show All 22 Lines |