Lines Matching +full:- +full:gp
1 /*-
2 * SPDX-License-Identifier: BSD-2-Clause
4 * Copyright (c) 2004-2005 Pawel Jakub Dawidek <pjd@FreeBSD.org>
52 struct g_geom *gp);
79 "Fast, but memory-consuming, mode");
122 g_stripe_maxmem -= g_stripe_maxmem % maxphys; in g_stripe_init()
142 for (i = 0; i < sc->sc_ndisks; i++) { in g_stripe_nvalid()
143 if (sc->sc_disks[i] != NULL) in g_stripe_nvalid()
156 KASSERT(cp != NULL, ("Non-valid disk in %s.", __func__)); in g_stripe_remove_disk()
157 sc = (struct g_stripe_softc *)cp->geom->softc; in g_stripe_remove_disk()
160 if (cp->private == NULL) { in g_stripe_remove_disk()
162 cp->provider->name, sc->sc_name); in g_stripe_remove_disk()
163 cp->private = (void *)(uintptr_t)-1; in g_stripe_remove_disk()
166 if (sc->sc_provider != NULL) { in g_stripe_remove_disk()
168 sc->sc_provider->name); in g_stripe_remove_disk()
169 g_wither_provider(sc->sc_provider, ENXIO); in g_stripe_remove_disk()
170 sc->sc_provider = NULL; in g_stripe_remove_disk()
173 if (cp->acr > 0 || cp->acw > 0 || cp->ace > 0) in g_stripe_remove_disk()
175 sc->sc_disks[cp->index] = NULL; in g_stripe_remove_disk()
176 cp->index = 0; in g_stripe_remove_disk()
180 if (LIST_EMPTY(&sc->sc_geom->consumer)) in g_stripe_remove_disk()
188 struct g_geom *gp; in g_stripe_orphan() local
191 gp = cp->geom; in g_stripe_orphan()
192 sc = gp->softc; in g_stripe_orphan()
204 struct g_geom *gp; in g_stripe_access() local
208 gp = pp->geom; in g_stripe_access()
209 sc = gp->softc; in g_stripe_access()
213 if (pp->acr == 0 && pp->acw == 0 && pp->ace == 0) in g_stripe_access()
216 if ((pp->acr + dr) == 0 && (pp->acw + dw) == 0 && (pp->ace + de) == 0) in g_stripe_access()
217 de--; in g_stripe_access()
219 LIST_FOREACH_SAFE(cp1, &gp->consumer, consumer, tmp) { in g_stripe_access()
223 if (cp1->acr == 0 && cp1->acw == 0 && cp1->ace == 0 && in g_stripe_access()
224 cp1->private != NULL) { in g_stripe_access()
231 LIST_FOREACH(cp2, &gp->consumer, consumer) { in g_stripe_access()
234 g_access(cp2, -dr, -dw, -de); in g_stripe_access()
246 stripesize = sc->sc_stripesize; in g_stripe_copy()
247 len = (size_t)(stripesize - (offset & (stripesize - 1))); in g_stripe_copy()
251 dst += len + stripesize * (sc->sc_ndisks - 1); in g_stripe_copy()
255 src += len + stripesize * (sc->sc_ndisks - 1); in g_stripe_copy()
257 length -= len; in g_stripe_copy()
274 pbp = bp->bio_parent; in g_stripe_done()
275 sc = pbp->bio_to->geom->softc; in g_stripe_done()
276 if (bp->bio_cmd == BIO_READ && bp->bio_caller1 != NULL) { in g_stripe_done()
277 g_stripe_copy(sc, bp->bio_data, bp->bio_caller1, bp->bio_offset, in g_stripe_done()
278 bp->bio_length, 1); in g_stripe_done()
279 bp->bio_data = bp->bio_caller1; in g_stripe_done()
280 bp->bio_caller1 = NULL; in g_stripe_done()
282 mtx_lock(&sc->sc_lock); in g_stripe_done()
283 if (pbp->bio_error == 0) in g_stripe_done()
284 pbp->bio_error = bp->bio_error; in g_stripe_done()
285 pbp->bio_completed += bp->bio_completed; in g_stripe_done()
286 pbp->bio_inbed++; in g_stripe_done()
287 if (pbp->bio_children == pbp->bio_inbed) { in g_stripe_done()
288 mtx_unlock(&sc->sc_lock); in g_stripe_done()
289 if (pbp->bio_driver1 != NULL) in g_stripe_done()
290 uma_zfree(g_stripe_zone, pbp->bio_driver1); in g_stripe_done()
291 if (bp->bio_cmd == BIO_SPEEDUP) in g_stripe_done()
292 pbp->bio_completed = pbp->bio_length; in g_stripe_done()
293 g_io_deliver(pbp, pbp->bio_error); in g_stripe_done()
295 mtx_unlock(&sc->sc_lock); in g_stripe_done()
310 sc = bp->bio_to->geom->softc; in g_stripe_start_fast()
312 addr = bp->bio_data; in g_stripe_start_fast()
313 stripesize = sc->sc_stripesize; in g_stripe_start_fast()
325 cbp->bio_done = g_stripe_done; in g_stripe_start_fast()
326 cbp->bio_offset = offset; in g_stripe_start_fast()
327 cbp->bio_data = addr; in g_stripe_start_fast()
328 cbp->bio_caller1 = NULL; in g_stripe_start_fast()
329 cbp->bio_length = length; in g_stripe_start_fast()
330 cbp->bio_caller2 = sc->sc_disks[no]; in g_stripe_start_fast()
332 /* offset -= offset % stripesize; */ in g_stripe_start_fast()
333 offset -= offset & (stripesize - 1); in g_stripe_start_fast()
335 length = bp->bio_length - length; in g_stripe_start_fast()
336 for (no++; length > 0; no++, length -= stripesize, addr += stripesize) { in g_stripe_start_fast()
337 if (no > sc->sc_ndisks - 1) { in g_stripe_start_fast()
341 if (nparts >= sc->sc_ndisks) { in g_stripe_start_fast()
351 * (bp->bio_length % sc->sc_stripesize) != 0. in g_stripe_start_fast()
353 cbp->bio_length += MIN(stripesize, length); in g_stripe_start_fast()
354 if (cbp->bio_caller1 == NULL) { in g_stripe_start_fast()
355 cbp->bio_caller1 = cbp->bio_data; in g_stripe_start_fast()
356 cbp->bio_data = NULL; in g_stripe_start_fast()
377 cbp->bio_done = g_stripe_done; in g_stripe_start_fast()
378 cbp->bio_offset = offset; in g_stripe_start_fast()
379 cbp->bio_data = addr; in g_stripe_start_fast()
380 cbp->bio_caller1 = NULL; in g_stripe_start_fast()
383 * (bp->bio_length % sc->sc_stripesize) != 0. in g_stripe_start_fast()
385 cbp->bio_length = MIN(stripesize, length); in g_stripe_start_fast()
386 cbp->bio_caller2 = sc->sc_disks[no]; in g_stripe_start_fast()
390 bp->bio_driver1 = data; in g_stripe_start_fast()
398 cp = cbp->bio_caller2; in g_stripe_start_fast()
399 cbp->bio_caller2 = NULL; in g_stripe_start_fast()
400 cbp->bio_to = cp->provider; in g_stripe_start_fast()
401 if (cbp->bio_caller1 != NULL) { in g_stripe_start_fast()
402 cbp->bio_data = data; in g_stripe_start_fast()
403 if (bp->bio_cmd == BIO_WRITE) { in g_stripe_start_fast()
404 g_stripe_copy(sc, cbp->bio_caller1, data, in g_stripe_start_fast()
405 cbp->bio_offset, cbp->bio_length, 0); in g_stripe_start_fast()
407 data += cbp->bio_length; in g_stripe_start_fast()
418 if (cbp->bio_caller1 != NULL) { in g_stripe_start_fast()
419 cbp->bio_data = cbp->bio_caller1; in g_stripe_start_fast()
420 cbp->bio_caller1 = NULL; in g_stripe_start_fast()
422 bp->bio_children--; in g_stripe_start_fast()
438 sc = bp->bio_to->geom->softc; in g_stripe_start_economic()
440 stripesize = sc->sc_stripesize; in g_stripe_start_economic()
451 if (bp->bio_length == length) in g_stripe_start_economic()
452 cbp->bio_done = g_std_done; /* Optimized lockless case. */ in g_stripe_start_economic()
454 cbp->bio_done = g_stripe_done; in g_stripe_start_economic()
455 cbp->bio_offset = offset; in g_stripe_start_economic()
456 cbp->bio_length = length; in g_stripe_start_economic()
457 if ((bp->bio_flags & BIO_UNMAPPED) != 0) in g_stripe_start_economic()
460 addr = bp->bio_data; in g_stripe_start_economic()
461 cbp->bio_caller2 = sc->sc_disks[no]; in g_stripe_start_economic()
463 /* offset -= offset % stripesize; */ in g_stripe_start_economic()
464 offset -= offset & (stripesize - 1); in g_stripe_start_economic()
465 if (bp->bio_cmd != BIO_DELETE) in g_stripe_start_economic()
467 length = bp->bio_length - length; in g_stripe_start_economic()
468 for (no++; length > 0; no++, length -= stripesize) { in g_stripe_start_economic()
469 if (no > sc->sc_ndisks - 1) { in g_stripe_start_economic()
483 cbp->bio_done = g_stripe_done; in g_stripe_start_economic()
484 cbp->bio_offset = offset; in g_stripe_start_economic()
487 * (bp->bio_length % sc->sc_stripesize) != 0. in g_stripe_start_economic()
489 cbp->bio_length = MIN(stripesize, length); in g_stripe_start_economic()
490 if ((bp->bio_flags & BIO_UNMAPPED) != 0) { in g_stripe_start_economic()
491 cbp->bio_ma_offset += (uintptr_t)addr; in g_stripe_start_economic()
492 cbp->bio_ma += cbp->bio_ma_offset / PAGE_SIZE; in g_stripe_start_economic()
493 cbp->bio_ma_offset %= PAGE_SIZE; in g_stripe_start_economic()
494 cbp->bio_ma_n = round_page(cbp->bio_ma_offset + in g_stripe_start_economic()
495 cbp->bio_length) / PAGE_SIZE; in g_stripe_start_economic()
497 cbp->bio_data = addr; in g_stripe_start_economic()
499 cbp->bio_caller2 = sc->sc_disks[no]; in g_stripe_start_economic()
501 if (bp->bio_cmd != BIO_DELETE) in g_stripe_start_economic()
511 cp = cbp->bio_caller2; in g_stripe_start_economic()
512 cbp->bio_caller2 = NULL; in g_stripe_start_economic()
513 cbp->bio_to = cp->provider; in g_stripe_start_economic()
521 bp->bio_children--; in g_stripe_start_economic()
536 for (no = 0; no < sc->sc_ndisks; no++) { in g_stripe_pushdown()
544 if (bp->bio_error == 0) in g_stripe_pushdown()
545 bp->bio_error = ENOMEM; in g_stripe_pushdown()
546 g_io_deliver(bp, bp->bio_error); in g_stripe_pushdown()
550 cbp->bio_done = g_stripe_done; in g_stripe_pushdown()
551 cbp->bio_caller2 = sc->sc_disks[no]; in g_stripe_pushdown()
552 cbp->bio_to = sc->sc_disks[no]->provider; in g_stripe_pushdown()
557 cp = cbp->bio_caller2; in g_stripe_pushdown()
558 cbp->bio_caller2 = NULL; in g_stripe_pushdown()
571 sc = bp->bio_to->geom->softc; in g_stripe_start()
578 bp->bio_to->error, bp->bio_to->name)); in g_stripe_start()
582 switch (bp->bio_cmd) { in g_stripe_start()
592 if (!strcmp(bp->bio_attribute, "GEOM::candelete")) { in g_stripe_start()
593 int val = (sc->sc_flags & G_STRIPE_FLAG_CANDELETE) != 0; in g_stripe_start()
603 stripesize = sc->sc_stripesize; in g_stripe_start()
610 /* nstripe = bp->bio_offset / stripesize; */ in g_stripe_start()
611 nstripe = bp->bio_offset >> (off_t)sc->sc_stripebits; in g_stripe_start()
613 no = nstripe % sc->sc_ndisks; in g_stripe_start()
615 /* start = bp->bio_offset % stripesize; */ in g_stripe_start()
616 start = bp->bio_offset & (stripesize - 1); in g_stripe_start()
618 /* offset = (nstripe / sc->sc_ndisks) * stripesize + start; */ in g_stripe_start()
619 offset = ((nstripe / sc->sc_ndisks) << sc->sc_stripebits) + start; in g_stripe_start()
621 length = MIN(bp->bio_length, stripesize - start); in g_stripe_start()
638 if (g_stripe_fast && bp->bio_length <= maxphys && in g_stripe_start()
639 bp->bio_length >= stripesize * sc->sc_ndisks && in g_stripe_start()
640 (bp->bio_flags & BIO_UNMAPPED) == 0 && in g_stripe_start()
641 bp->bio_cmd != BIO_DELETE) { in g_stripe_start()
659 if (bp->bio_error == 0) in g_stripe_start()
660 bp->bio_error = error; in g_stripe_start()
661 g_io_deliver(bp, bp->bio_error); in g_stripe_start()
673 if (g_stripe_nvalid(sc) != sc->sc_ndisks) in g_stripe_check_and_run()
676 sc->sc_provider = g_new_providerf(sc->sc_geom, "stripe/%s", in g_stripe_check_and_run()
677 sc->sc_name); in g_stripe_check_and_run()
678 sc->sc_provider->flags |= G_PF_DIRECT_SEND | G_PF_DIRECT_RECEIVE; in g_stripe_check_and_run()
680 sc->sc_provider->flags |= G_PF_ACCEPT_UNMAPPED; in g_stripe_check_and_run()
684 mediasize = sc->sc_disks[0]->provider->mediasize; in g_stripe_check_and_run()
685 if (sc->sc_type == G_STRIPE_TYPE_AUTOMATIC) in g_stripe_check_and_run()
686 mediasize -= sc->sc_disks[0]->provider->sectorsize; in g_stripe_check_and_run()
687 mediasize -= mediasize % sc->sc_stripesize; in g_stripe_check_and_run()
688 sectorsize = sc->sc_disks[0]->provider->sectorsize; in g_stripe_check_and_run()
689 for (no = 1; no < sc->sc_ndisks; no++) { in g_stripe_check_and_run()
690 dp = sc->sc_disks[no]->provider; in g_stripe_check_and_run()
691 ms = dp->mediasize; in g_stripe_check_and_run()
692 if (sc->sc_type == G_STRIPE_TYPE_AUTOMATIC) in g_stripe_check_and_run()
693 ms -= dp->sectorsize; in g_stripe_check_and_run()
694 ms -= ms % sc->sc_stripesize; in g_stripe_check_and_run()
697 sectorsize = lcm(sectorsize, dp->sectorsize); in g_stripe_check_and_run()
700 if ((dp->flags & G_PF_ACCEPT_UNMAPPED) == 0) { in g_stripe_check_and_run()
702 "because of %s.", dp->name); in g_stripe_check_and_run()
703 sc->sc_provider->flags &= ~G_PF_ACCEPT_UNMAPPED; in g_stripe_check_and_run()
706 sc->sc_provider->sectorsize = sectorsize; in g_stripe_check_and_run()
707 sc->sc_provider->mediasize = mediasize * sc->sc_ndisks; in g_stripe_check_and_run()
708 sc->sc_provider->stripesize = sc->sc_stripesize; in g_stripe_check_and_run()
709 sc->sc_provider->stripeoffset = 0; in g_stripe_check_and_run()
710 g_error_provider(sc->sc_provider, 0); in g_stripe_check_and_run()
712 G_STRIPE_DEBUG(0, "Device %s activated.", sc->sc_provider->name); in g_stripe_check_and_run()
727 pp = cp->provider; in g_stripe_read_metadata()
729 buf = g_read_data(cp, pp->mediasize - pp->sectorsize, pp->sectorsize, in g_stripe_read_metadata()
732 g_access(cp, -1, 0, 0); in g_stripe_read_metadata()
750 struct g_geom *gp; in g_stripe_add_disk() local
755 if (no >= sc->sc_ndisks) in g_stripe_add_disk()
759 if (sc->sc_disks[no] != NULL) in g_stripe_add_disk()
762 gp = sc->sc_geom; in g_stripe_add_disk()
763 fcp = LIST_FIRST(&gp->consumer); in g_stripe_add_disk()
765 cp = g_new_consumer(gp); in g_stripe_add_disk()
766 cp->flags |= G_CF_DIRECT_SEND | G_CF_DIRECT_RECEIVE; in g_stripe_add_disk()
767 cp->private = NULL; in g_stripe_add_disk()
768 cp->index = no; in g_stripe_add_disk()
775 if (fcp != NULL && (fcp->acr > 0 || fcp->acw > 0 || fcp->ace > 0)) { in g_stripe_add_disk()
776 error = g_access(cp, fcp->acr, fcp->acw, fcp->ace); in g_stripe_add_disk()
783 if (sc->sc_type == G_STRIPE_TYPE_AUTOMATIC) { in g_stripe_add_disk()
792 strcmp(md.md_name, sc->sc_name) != 0 || in g_stripe_add_disk()
793 md.md_id != sc->sc_id) { in g_stripe_add_disk()
794 G_STRIPE_DEBUG(0, "Metadata on %s changed.", pp->name); in g_stripe_add_disk()
799 sc->sc_disks[no] = cp; in g_stripe_add_disk()
808 sc->sc_flags |= G_STRIPE_FLAG_CANDELETE; in g_stripe_add_disk()
809 G_STRIPE_DEBUG(1, "Provider %s candelete %i.", pp->name, in g_stripe_add_disk()
811 g_access(cp, -1, 0, 0); in g_stripe_add_disk()
814 G_STRIPE_DEBUG(0, "Disk %s attached to %s.", pp->name, sc->sc_name); in g_stripe_add_disk()
819 if (fcp != NULL && (fcp->acr > 0 || fcp->acw > 0 || fcp->ace > 0)) in g_stripe_add_disk()
820 g_access(cp, -fcp->acr, -fcp->acw, -fcp->ace); in g_stripe_add_disk()
831 struct g_geom *gp; in g_stripe_create() local
835 G_STRIPE_DEBUG(1, "Creating device %s (id=%u).", md->md_name, in g_stripe_create()
836 md->md_id); in g_stripe_create()
839 if (md->md_all < 2) { in g_stripe_create()
840 G_STRIPE_DEBUG(0, "Too few disks defined for %s.", md->md_name); in g_stripe_create()
845 if (md->md_stripesize < sectorsize) { in g_stripe_create()
846 G_STRIPE_DEBUG(0, "Invalid stripe size for %s.", md->md_name); in g_stripe_create()
851 if (!powerof2(md->md_stripesize)) { in g_stripe_create()
852 G_STRIPE_DEBUG(0, "Invalid stripe size for %s.", md->md_name); in g_stripe_create()
857 LIST_FOREACH(gp, &mp->geom, geom) { in g_stripe_create()
858 sc = gp->softc; in g_stripe_create()
859 if (sc != NULL && strcmp(sc->sc_name, md->md_name) == 0) { in g_stripe_create()
861 sc->sc_name); in g_stripe_create()
865 gp = g_new_geom(mp, md->md_name); in g_stripe_create()
867 gp->start = g_stripe_start; in g_stripe_create()
868 gp->spoiled = g_stripe_orphan; in g_stripe_create()
869 gp->orphan = g_stripe_orphan; in g_stripe_create()
870 gp->access = g_stripe_access; in g_stripe_create()
871 gp->dumpconf = g_stripe_dumpconf; in g_stripe_create()
873 sc->sc_id = md->md_id; in g_stripe_create()
874 sc->sc_stripesize = md->md_stripesize; in g_stripe_create()
875 sc->sc_stripebits = bitcount32(sc->sc_stripesize - 1); in g_stripe_create()
876 sc->sc_ndisks = md->md_all; in g_stripe_create()
877 sc->sc_disks = malloc(sizeof(struct g_consumer *) * sc->sc_ndisks, in g_stripe_create()
879 for (no = 0; no < sc->sc_ndisks; no++) in g_stripe_create()
880 sc->sc_disks[no] = NULL; in g_stripe_create()
881 sc->sc_type = type; in g_stripe_create()
882 mtx_init(&sc->sc_lock, "gstripe lock", NULL, MTX_DEF); in g_stripe_create()
884 gp->softc = sc; in g_stripe_create()
885 sc->sc_geom = gp; in g_stripe_create()
886 sc->sc_provider = NULL; in g_stripe_create()
888 G_STRIPE_DEBUG(0, "Device %s created (id=%u).", sc->sc_name, sc->sc_id); in g_stripe_create()
890 return (gp); in g_stripe_create()
898 struct g_geom *gp; in g_stripe_destroy() local
905 pp = sc->sc_provider; in g_stripe_destroy()
906 if (pp != NULL && (pp->acr != 0 || pp->acw != 0 || pp->ace != 0)) { in g_stripe_destroy()
909 "can't be definitely removed.", pp->name); in g_stripe_destroy()
912 "Device %s is still open (r%dw%de%d).", pp->name, in g_stripe_destroy()
913 pp->acr, pp->acw, pp->ace); in g_stripe_destroy()
918 gp = sc->sc_geom; in g_stripe_destroy()
919 LIST_FOREACH_SAFE(cp, &gp->consumer, consumer, cp1) { in g_stripe_destroy()
924 if (!LIST_EMPTY(&gp->consumer)) in g_stripe_destroy()
927 gp->softc = NULL; in g_stripe_destroy()
928 KASSERT(sc->sc_provider == NULL, ("Provider still exists? (device=%s)", in g_stripe_destroy()
929 gp->name)); in g_stripe_destroy()
930 free(sc->sc_disks, M_STRIPE); in g_stripe_destroy()
931 mtx_destroy(&sc->sc_lock); in g_stripe_destroy()
933 G_STRIPE_DEBUG(0, "Device %s destroyed.", gp->name); in g_stripe_destroy()
934 g_wither_geom(gp, ENXIO); in g_stripe_destroy()
940 struct g_class *mp __unused, struct g_geom *gp) in g_stripe_destroy_geom() argument
944 sc = gp->softc; in g_stripe_destroy_geom()
954 struct g_geom *gp; in g_stripe_taste() local
957 g_trace(G_T_TOPOLOGY, "%s(%s, %s)", __func__, mp->name, pp->name); in g_stripe_taste()
961 if (pp->acw > 0) in g_stripe_taste()
964 G_STRIPE_DEBUG(3, "Tasting %s.", pp->name); in g_stripe_taste()
966 gp = g_new_geom(mp, "stripe:taste"); in g_stripe_taste()
967 gp->start = g_stripe_start; in g_stripe_taste()
968 gp->access = g_stripe_access; in g_stripe_taste()
969 gp->orphan = g_stripe_orphan; in g_stripe_taste()
970 cp = g_new_consumer(gp); in g_stripe_taste()
971 cp->flags |= G_CF_DIRECT_SEND | G_CF_DIRECT_RECEIVE; in g_stripe_taste()
978 g_destroy_geom(gp); in g_stripe_taste()
981 gp = NULL; in g_stripe_taste()
987 pp->name); in g_stripe_taste()
998 md.md_provsize = pp->mediasize; in g_stripe_taste()
1001 !g_compare_names(md.md_provider, pp->name)) in g_stripe_taste()
1003 if (md.md_provsize != pp->mediasize) in g_stripe_taste()
1010 LIST_FOREACH(gp, &mp->geom, geom) { in g_stripe_taste()
1011 sc = gp->softc; in g_stripe_taste()
1014 if (sc->sc_type != G_STRIPE_TYPE_AUTOMATIC) in g_stripe_taste()
1016 if (strcmp(md.md_name, sc->sc_name) != 0) in g_stripe_taste()
1018 if (md.md_id != sc->sc_id) in g_stripe_taste()
1022 if (gp != NULL) { in g_stripe_taste()
1023 G_STRIPE_DEBUG(1, "Adding disk %s to %s.", pp->name, gp->name); in g_stripe_taste()
1027 "Cannot add disk %s to %s (error=%d).", pp->name, in g_stripe_taste()
1028 gp->name, error); in g_stripe_taste()
1032 gp = g_stripe_create(mp, &md, G_STRIPE_TYPE_AUTOMATIC); in g_stripe_taste()
1033 if (gp == NULL) { in g_stripe_taste()
1038 sc = gp->softc; in g_stripe_taste()
1039 G_STRIPE_DEBUG(1, "Adding disk %s to %s.", pp->name, gp->name); in g_stripe_taste()
1043 "Cannot add disk %s to %s (error=%d).", pp->name, in g_stripe_taste()
1044 gp->name, error); in g_stripe_taste()
1050 return (gp); in g_stripe_taste()
1060 struct g_geom *gp; in g_stripe_ctl_create() local
1088 md.md_all = *nargs - 1; in g_stripe_ctl_create()
1107 gp = g_stripe_create(mp, &md, G_STRIPE_TYPE_MANUAL); in g_stripe_ctl_create()
1108 if (gp == NULL) { in g_stripe_ctl_create()
1113 sc = gp->softc; in g_stripe_ctl_create()
1115 sbuf_printf(sb, "Can't attach disk(s) to %s:", gp->name); in g_stripe_ctl_create()
1125 if (g_stripe_add_disk(sc, pp, no - 1) != 0) { in g_stripe_ctl_create()
1127 no, pp->name, gp->name); in g_stripe_ctl_create()
1128 sbuf_printf(sb, " %s", pp->name); in g_stripe_ctl_create()
1135 g_stripe_destroy(gp->softc, 1); in g_stripe_ctl_create()
1145 struct g_geom *gp; in g_stripe_find_device() local
1147 LIST_FOREACH(gp, &mp->geom, geom) { in g_stripe_find_device()
1148 sc = gp->softc; in g_stripe_find_device()
1151 if (strcmp(sc->sc_name, name) == 0) in g_stripe_find_device()
1198 sc->sc_name, error); in g_stripe_ctl_destroy()
1234 g_stripe_dumpconf(struct sbuf *sb, const char *indent, struct g_geom *gp, in g_stripe_dumpconf() argument
1239 sc = gp->softc; in g_stripe_dumpconf()
1246 (u_int)cp->index); in g_stripe_dumpconf()
1248 sbuf_printf(sb, "%s<ID>%u</ID>\n", indent, (u_int)sc->sc_id); in g_stripe_dumpconf()
1250 (uintmax_t)sc->sc_stripesize); in g_stripe_dumpconf()
1252 switch (sc->sc_type) { in g_stripe_dumpconf()
1265 indent, sc->sc_ndisks, g_stripe_nvalid(sc)); in g_stripe_dumpconf()
1267 if (sc->sc_provider != NULL && sc->sc_provider->error == 0) in g_stripe_dumpconf()