Lines Matching refs:gpp

668 g_part_ctl_add(struct gctl_req *req, struct g_part_parms *gpp)
679 gp = gpp->gpp_geom;
685 end = gpp->gpp_start + gpp->gpp_size - 1;
687 if (gpp->gpp_start < table->gpt_first ||
688 gpp->gpp_start > table->gpt_last) {
690 (intmax_t)gpp->gpp_start);
693 if (end < gpp->gpp_start || end > table->gpt_last) {
695 (intmax_t)gpp->gpp_size);
698 if (gpp->gpp_index > table->gpt_entries) {
699 gctl_error(req, "%d index '%d'", EINVAL, gpp->gpp_index);
704 index = (gpp->gpp_index > 0) ? gpp->gpp_index : 1;
717 if (gpp->gpp_start >= entry->gpe_start &&
718 gpp->gpp_start <= entry->gpe_end) {
720 (intmax_t)gpp->gpp_start);
727 if (gpp->gpp_start < entry->gpe_start && end > entry->gpe_end) {
729 (intmax_t)gpp->gpp_size);
733 if (gpp->gpp_index > 0 && index != gpp->gpp_index) {
734 gctl_error(req, "%d index '%d'", EEXIST, gpp->gpp_index);
745 entry->gpe_start = gpp->gpp_start;
747 error = G_PART_ADD(table, entry, gpp);
767 if (gpp->gpp_parms & G_PART_PARM_OUTPUT) {
783 g_part_ctl_bootcode(struct gctl_req *req, struct g_part_parms *gpp)
790 gp = gpp->gpp_geom;
800 if (gpp->gpp_codesize > sz) {
805 error = G_PART_BOOTCODE(table, gpp);
810 if (gpp->gpp_parms & G_PART_PARM_OUTPUT) {
825 g_part_ctl_commit(struct gctl_req *req, struct g_part_parms *gpp)
835 gp = gpp->gpp_geom;
908 g_part_ctl_create(struct gctl_req *req, struct g_part_parms *gpp)
918 pp = gpp->gpp_provider;
919 scheme = gpp->gpp_scheme;
934 if ((gpp->gpp_parms & G_PART_PARM_ENTRIES) &&
935 (gpp->gpp_entries < scheme->gps_minent ||
936 gpp->gpp_entries > scheme->gps_maxent)) {
937 gctl_error(req, "%d entries '%d'", EINVAL, gpp->gpp_entries);
943 gp->softc = kobj_create((kobj_class_t)gpp->gpp_scheme, M_GEOM,
947 table->gpt_scheme = gpp->gpp_scheme;
948 table->gpt_entries = (gpp->gpp_parms & G_PART_PARM_ENTRIES) ?
949 gpp->gpp_entries : scheme->gps_minent;
995 error = G_PART_CREATE(table, gpp);
1009 gpp->gpp_parms |= G_PART_PARM_GEOM;
1010 gpp->gpp_geom = gp;
1013 if (gpp->gpp_parms & G_PART_PARM_OUTPUT) {
1036 g_part_ctl_delete(struct gctl_req *req, struct g_part_parms *gpp)
1044 gp = gpp->gpp_geom;
1053 if (entry->gpe_index == gpp->gpp_index)
1057 gctl_error(req, "%d index '%d'", ENOENT, gpp->gpp_index);
1076 if (gpp->gpp_parms & G_PART_PARM_OUTPUT) {
1096 g_part_ctl_destroy(struct gctl_req *req, struct g_part_parms *gpp)
1106 gp = gpp->gpp_geom;
1115 if (gpp->gpp_force) {
1126 if (gpp->gpp_force) {
1139 error = G_PART_DESTROY(table, gpp);
1168 if (gpp->gpp_parms & G_PART_PARM_OUTPUT) {
1179 g_part_ctl_modify(struct gctl_req *req, struct g_part_parms *gpp)
1187 gp = gpp->gpp_geom;
1196 if (entry->gpe_index == gpp->gpp_index)
1200 gctl_error(req, "%d index '%d'", ENOENT, gpp->gpp_index);
1204 error = G_PART_MODIFY(table, entry, gpp);
1214 if (gpp->gpp_parms & G_PART_PARM_OUTPUT) {
1226 g_part_ctl_move(struct gctl_req *req, struct g_part_parms *gpp)
1233 g_part_ctl_recover(struct gctl_req *req, struct g_part_parms *gpp)
1240 gp = gpp->gpp_geom;
1259 if (gpp->gpp_parms & G_PART_PARM_OUTPUT) {
1274 g_part_ctl_resize(struct gctl_req *req, struct g_part_parms *gpp)
1285 gp = gpp->gpp_geom;
1294 if (entry->gpe_index == gpp->gpp_index)
1298 gctl_error(req, "%d index '%d'", ENOENT, gpp->gpp_index);
1303 end = entry->gpe_start + gpp->gpp_size - 1;
1304 if (gpp->gpp_size < 1 || end > table->gpt_last) {
1306 (intmax_t)gpp->gpp_size);
1320 (intmax_t)gpp->gpp_size);
1328 if (entry->gpe_end - entry->gpe_start + 1 > gpp->gpp_size) {
1335 error = G_PART_RESIZE(table, entry, gpp);
1352 if (gpp->gpp_parms & G_PART_PARM_OUTPUT) {
1364 g_part_ctl_setunset(struct gctl_req *req, struct g_part_parms *gpp,
1373 gp = gpp->gpp_geom;
1379 if (gpp->gpp_parms & G_PART_PARM_INDEX) {
1383 if (entry->gpe_index == gpp->gpp_index)
1388 gpp->gpp_index);
1394 error = G_PART_SETUNSET(table, entry, gpp->gpp_attrib, set);
1396 gctl_error(req, "%d attrib '%s'", error, gpp->gpp_attrib);
1401 if (gpp->gpp_parms & G_PART_PARM_OUTPUT) {
1403 sbuf_printf(sb, "%s %sset on ", gpp->gpp_attrib,
1418 g_part_ctl_undo(struct gctl_req *req, struct g_part_parms *gpp)
1427 gp = gpp->gpp_geom;
1541 struct g_part_parms gpp;
1636 bzero(&gpp, sizeof(gpp));
1705 &gpp.gpp_attrib);
1709 &gpp.gpp_codeptr, &gpp.gpp_codesize);
1713 &gpp.gpp_entries);
1716 error = g_part_parm_str(req, ap->name, &gpp.gpp_flags);
1720 &gpp.gpp_force);
1723 error = g_part_parm_geom(req, ap->name, &gpp.gpp_geom);
1727 &gpp.gpp_index);
1730 error = g_part_parm_str(req, ap->name, &gpp.gpp_label);
1737 &gpp.gpp_provider);
1741 &gpp.gpp_scheme);
1744 error = g_part_parm_quad(req, ap->name, &gpp.gpp_size);
1748 &gpp.gpp_start);
1751 error = g_part_parm_str(req, ap->name, &gpp.gpp_type);
1755 &gpp.gpp_version);
1769 gpp.gpp_parms |= parm;
1771 if ((gpp.gpp_parms & mparms) != mparms) {
1772 parm = mparms - (gpp.gpp_parms & mparms);
1780 if (modifies && (gpp.gpp_parms & G_PART_PARM_GEOM)) {
1781 table = gpp.gpp_geom->softc;
1786 EPERM, gpp.gpp_geom->name);
1790 error = g_access(LIST_FIRST(&gpp.gpp_geom->consumer),
1794 gpp.gpp_geom->name);
1804 error = G_PART_PRECHECK(table, ctlreq, &gpp);
1816 error = g_part_ctl_add(req, &gpp);
1819 error = g_part_ctl_bootcode(req, &gpp);
1822 error = g_part_ctl_commit(req, &gpp);
1825 error = g_part_ctl_create(req, &gpp);
1828 error = g_part_ctl_delete(req, &gpp);
1831 error = g_part_ctl_destroy(req, &gpp);
1834 error = g_part_ctl_modify(req, &gpp);
1837 error = g_part_ctl_move(req, &gpp);
1840 error = g_part_ctl_recover(req, &gpp);
1843 error = g_part_ctl_resize(req, &gpp);
1846 error = g_part_ctl_setunset(req, &gpp, 1);
1849 error = g_part_ctl_undo(req, &gpp);
1852 error = g_part_ctl_setunset(req, &gpp, 0);
1859 (gpp.gpp_parms & G_PART_PARM_FLAGS) &&
1860 strchr(gpp.gpp_flags, 'C') != NULL) ? 1 : 0;
1862 KASSERT(gpp.gpp_parms & G_PART_PARM_GEOM, ("%s",
1864 error = g_part_ctl_commit(req, &gpp);
1870 g_access(LIST_FIRST(&gpp.gpp_geom->consumer), -1, -1, -1);