Lines Matching refs:md

71     struct g_multipath_metadata *md);
73 struct g_multipath_metadata *md);
255 struct g_multipath_metadata md;
291 error = g_multipath_read_metadata(cp, &md);
293 (strcmp(md.md_magic, G_MULTIPATH_MAGIC) != 0) ||
294 (memcmp(md.md_uuid, sc->sc_uuid, sizeof(sc->sc_uuid)) != 0) ||
295 (strcmp(md.md_name, sc->sc_name) != 0) ||
296 (md.md_size != 0 && md.md_size != size) ||
297 (md.md_sectorsize != 0 && md.md_sectorsize != ssize)) {
307 strlcpy(md.md_magic, G_MULTIPATH_MAGIC, sizeof(md.md_magic));
308 memcpy(md.md_uuid, sc->sc_uuid, sizeof (sc->sc_uuid));
309 strlcpy(md.md_name, sc->sc_name, sizeof(md.md_name));
310 md.md_version = G_MULTIPATH_VERSION;
311 md.md_size = size;
312 md.md_sectorsize = ssize;
313 md.md_active_active = sc->sc_active_active;
314 error = g_multipath_write_metadata(cp, &md);
509 g_multipath_create(struct g_class *mp, struct g_multipath_metadata *md)
521 if (strcmp(gp->name, md->md_name) == 0) {
523 md->md_name);
528 gp = g_new_geomf(mp, "%s", md->md_name);
531 memcpy(sc->sc_uuid, md->md_uuid, sizeof (sc->sc_uuid));
532 memcpy(sc->sc_name, md->md_name, sizeof (sc->sc_name));
533 sc->sc_active_active = md->md_active_active;
534 sc->sc_size = md->md_size;
542 pp = g_new_providerf(gp, "multipath/%s", md->md_name);
544 if (md->md_size != 0) {
545 pp->mediasize = md->md_size -
546 ((md->md_uuid[0] != 0) ? md->md_sectorsize : 0);
547 pp->sectorsize = md->md_sectorsize;
743 struct g_multipath_metadata *md)
761 multipath_metadata_decode(buf, md);
768 struct g_multipath_metadata *md)
781 multipath_metadata_encode(md, buf);
793 struct g_multipath_metadata md;
807 error = g_multipath_read_metadata(cp, &md);
815 if (strcmp(md.md_magic, G_MULTIPATH_MAGIC) != 0) {
820 if (md.md_version != G_MULTIPATH_VERSION) {
822 " %d: rejecting\n", pp->name, md.md_version,
826 if (md.md_size != 0 && md.md_size != pp->mediasize)
828 if (md.md_sectorsize != 0 && md.md_sectorsize != pp->sectorsize)
831 printf("MULTIPATH: %s/%s\n", md.md_name, md.md_uuid);
849 if (strncmp(md.md_uuid, sc->sc_uuid, sizeof(md.md_uuid)) == 0)
859 if (strncmp(md.md_name, sc->sc_name, sizeof(md.md_name)) == 0)
882 snprintf(buf, sizeof (buf), "%s-%lu", md.md_name, rand);
886 md.md_uuid, buf);
887 strlcpy(md.md_name, buf, sizeof(md.md_name));
889 strlcpy(md.md_name, sc->sc_name, sizeof(md.md_name));
894 gp = g_multipath_create(mp, &md);
897 md.md_name, md.md_uuid);
1083 struct g_multipath_metadata md;
1109 memset(&md, 0, sizeof(md));
1110 strlcpy(md.md_magic, G_MULTIPATH_MAGIC, sizeof(md.md_magic));
1111 md.md_version = G_MULTIPATH_VERSION;
1112 strlcpy(md.md_name, mpname, sizeof(md.md_name));
1113 md.md_size = 0;
1114 md.md_sectorsize = 0;
1115 md.md_uuid[0] = 0;
1116 md.md_active_active = 0;
1119 md.md_active_active = 1;
1122 md.md_active_active = 2;
1123 gp = g_multipath_create(mp, &md);
1126 md.md_name, md.md_uuid);
1148 struct g_multipath_metadata md;
1177 strlcpy(md.md_magic, G_MULTIPATH_MAGIC, sizeof(md.md_magic));
1178 memcpy(md.md_uuid, sc->sc_uuid, sizeof (sc->sc_uuid));
1179 strlcpy(md.md_name, name, sizeof(md.md_name));
1180 md.md_version = G_MULTIPATH_VERSION;
1181 md.md_size = pp->mediasize;
1182 md.md_sectorsize = pp->sectorsize;
1183 md.md_active_active = sc->sc_active_active;
1184 error = g_multipath_write_metadata(cp, &md);