Lines Matching refs:md

717 g_stripe_read_metadata(struct g_consumer *cp, struct g_stripe_metadata *md)
738 stripe_metadata_decode(buf, md);
785 struct g_stripe_metadata md;
788 error = g_stripe_read_metadata(cp, &md);
792 if (strcmp(md.md_magic, G_STRIPE_MAGIC) != 0 ||
793 strcmp(md.md_name, sc->sc_name) != 0 ||
794 md.md_id != sc->sc_id) {
814 g_stripe_create(struct g_class *mp, const struct g_stripe_metadata *md,
822 G_STRIPE_DEBUG(1, "Creating device %s (id=%u).", md->md_name,
823 md->md_id);
826 if (md->md_all < 2) {
827 G_STRIPE_DEBUG(0, "Too few disks defined for %s.", md->md_name);
832 if (md->md_stripesize < sectorsize) {
833 G_STRIPE_DEBUG(0, "Invalid stripe size for %s.", md->md_name);
838 if (!powerof2(md->md_stripesize)) {
839 G_STRIPE_DEBUG(0, "Invalid stripe size for %s.", md->md_name);
846 if (sc != NULL && strcmp(sc->sc_name, md->md_name) == 0) {
852 gp = g_new_geomf(mp, "%s", md->md_name);
860 sc->sc_id = md->md_id;
861 sc->sc_stripesize = md->md_stripesize;
863 sc->sc_ndisks = md->md_all;
938 struct g_stripe_metadata md;
959 error = g_stripe_read_metadata(cp, &md);
967 if (strcmp(md.md_magic, G_STRIPE_MAGIC) != 0)
969 if (md.md_version > G_STRIPE_VERSION) {
978 if (md.md_version < 2)
979 bzero(md.md_provider, sizeof(md.md_provider));
981 if (md.md_version < 3)
982 md.md_provsize = pp->mediasize;
984 if (md.md_provider[0] != '\0' &&
985 !g_compare_names(md.md_provider, pp->name))
987 if (md.md_provsize != pp->mediasize)
1000 if (strcmp(md.md_name, sc->sc_name) != 0)
1002 if (md.md_id != sc->sc_id)
1008 error = g_stripe_add_disk(sc, pp, md.md_no);
1016 gp = g_stripe_create(mp, &md, G_STRIPE_TYPE_AUTOMATIC);
1019 md.md_name);
1024 error = g_stripe_add_disk(sc, pp, md.md_no);
1041 struct g_stripe_metadata md;
1062 strlcpy(md.md_magic, G_STRIPE_MAGIC, sizeof(md.md_magic));
1063 md.md_version = G_STRIPE_VERSION;
1069 strlcpy(md.md_name, name, sizeof(md.md_name));
1070 md.md_id = arc4random();
1071 md.md_no = 0;
1072 md.md_all = *nargs - 1;
1078 md.md_stripesize = *stripesize;
1079 bzero(md.md_provider, sizeof(md.md_provider));
1081 md.md_provsize = 0;
1101 gp = g_stripe_create(mp, &md, G_STRIPE_TYPE_MANUAL);
1103 gctl_error(req, "Can't configure %s.", md.md_name);
1130 if (md.md_all != attached) {