Lines Matching full:comp

118 static void dump_component(struct g_virstor_component *comp);
647 clear_metadata(struct g_virstor_component *comp) in clear_metadata() argument
653 comp->gcons->provider->name); in clear_metadata()
655 error = g_access(comp->gcons, 0, 1, 0); in clear_metadata()
658 buf = malloc(comp->gcons->provider->sectorsize, M_GVIRSTOR, in clear_metadata()
660 error = g_write_data(comp->gcons, in clear_metadata()
661 comp->gcons->provider->mediasize - in clear_metadata()
662 comp->gcons->provider->sectorsize, in clear_metadata()
664 comp->gcons->provider->sectorsize); in clear_metadata()
666 g_access(comp->gcons, 0, -1, 0); in clear_metadata()
879 remove_component(struct g_virstor_softc *sc, struct g_virstor_component *comp, in remove_component() argument
884 KASSERT(comp->gcons != NULL, ("Component with no consumer in %s", in remove_component()
886 c = comp->gcons; in remove_component()
888 comp->gcons = NULL; in remove_component()
1377 struct g_virstor_component *comp; in g_virstor_orphan() local
1386 comp = cp->private; in g_virstor_orphan()
1387 KASSERT(comp != NULL, ("%s: No component in private part of consumer", in g_virstor_orphan()
1389 remove_component(sc, comp, FALSE); in g_virstor_orphan()
1464 struct g_virstor_component *comp; in g_virstor_dumpconf() local
1466 comp = cp->private; in g_virstor_dumpconf()
1467 if (comp == NULL) in g_virstor_dumpconf()
1470 indent, comp->index); in g_virstor_dumpconf()
1472 indent, comp->chunk_count); in g_virstor_dumpconf()
1474 indent, comp->chunk_next); in g_virstor_dumpconf()
1476 indent, comp->chunk_reserved); in g_virstor_dumpconf()
1479 comp->chunk_next > 0 ? 100 - in g_virstor_dumpconf()
1480 ((comp->chunk_next + comp->chunk_reserved) * 100) / in g_virstor_dumpconf()
1481 comp->chunk_count : 100); in g_virstor_dumpconf()
1559 struct g_virstor_component *comp; in g_virstor_start() local
1613 comp = &sc->components[me->provider_no]; in g_virstor_start()
1623 cb->bio_to = comp->gcons->provider; in g_virstor_start()
1630 cb->bio_caller1 = comp; in g_virstor_start()
1647 error = allocate_chunk(sc, &comp, &comp_no, in g_virstor_start()
1680 comp->gcons->provider->name, in g_virstor_start()
1724 comp = &sc->components[me->provider_no]; in g_virstor_start()
1734 cb->bio_to = comp->gcons->provider; in g_virstor_start()
1740 cb->bio_caller1 = comp; in g_virstor_start()
1753 comp = cb->bio_caller1; in g_virstor_start()
1757 g_io_request(cb, comp->gcons); in g_virstor_start()
1772 allocate_chunk(struct g_virstor_softc *sc, struct g_virstor_component **comp, in allocate_chunk() argument
1781 *comp = &sc->components[comp_no]; in allocate_chunk()
1782 dump_component(*comp); in allocate_chunk()
1783 if ((*comp)->chunk_next >= (*comp)->chunk_count) { in allocate_chunk()
1790 (*comp)->flags &= ~VIRSTOR_PROVIDER_CURRENT; in allocate_chunk()
1793 *comp = &sc->components[comp_no]; in allocate_chunk()
1798 (*comp)->gcons->provider->name); in allocate_chunk()
1800 if ( (*comp)->chunk_reserved > 0 && in allocate_chunk()
1801 (*comp)->chunk_next < (*comp)->chunk_reserved) in allocate_chunk()
1802 (*comp)->chunk_next = (*comp)->chunk_reserved; in allocate_chunk()
1804 (*comp)->flags |= in allocate_chunk()
1806 dump_component(*comp); in allocate_chunk()
1808 *chunk = (*comp)->chunk_next++; in allocate_chunk()
1811 *chunk = (*comp)->chunk_next++; in allocate_chunk()
1818 dump_component(struct g_virstor_component *comp) in dump_component() argument
1823 printf("Component %d: %s\n", comp->index, comp->gcons->provider->name); in dump_component()
1824 printf(" chunk_count: %u\n", comp->chunk_count); in dump_component()
1825 printf(" chunk_next: %u\n", comp->chunk_next); in dump_component()
1826 printf(" flags: %u\n", comp->flags); in dump_component()