Lines Matching defs:gpp
722 g_part_ctl_add(struct gctl_req *req, struct g_part_parms *gpp)
733 gp = gpp->gpp_geom;
739 end = gpp->gpp_start + gpp->gpp_size - 1;
741 if (gpp->gpp_start < table->gpt_first ||
742 gpp->gpp_start > table->gpt_last) {
744 (intmax_t)gpp->gpp_start);
747 if (end < gpp->gpp_start || end > table->gpt_last) {
749 (intmax_t)gpp->gpp_size);
752 if (gpp->gpp_index > table->gpt_entries) {
753 gctl_error(req, "%d index '%d'", EINVAL, gpp->gpp_index);
758 index = (gpp->gpp_index > 0) ? gpp->gpp_index : 1;
771 if (gpp->gpp_start >= entry->gpe_start &&
772 gpp->gpp_start <= entry->gpe_end) {
774 (intmax_t)gpp->gpp_start);
781 if (gpp->gpp_start < entry->gpe_start && end > entry->gpe_end) {
783 (intmax_t)gpp->gpp_size);
787 if (gpp->gpp_index > 0 && index != gpp->gpp_index) {
788 gctl_error(req, "%d index '%d'", EEXIST, gpp->gpp_index);
799 entry->gpe_start = gpp->gpp_start;
801 error = G_PART_ADD(table, entry, gpp);
821 if (gpp->gpp_parms & G_PART_PARM_OUTPUT) {
837 g_part_ctl_bootcode(struct gctl_req *req, struct g_part_parms *gpp)
844 gp = gpp->gpp_geom;
854 if (gpp->gpp_codesize > sz) {
859 error = G_PART_BOOTCODE(table, gpp);
864 if (gpp->gpp_parms & G_PART_PARM_OUTPUT) {
879 g_part_ctl_commit(struct gctl_req *req, struct g_part_parms *gpp)
889 gp = gpp->gpp_geom;
967 g_part_ctl_create(struct gctl_req *req, struct g_part_parms *gpp)
977 pp = gpp->gpp_provider;
978 scheme = gpp->gpp_scheme;
993 if ((gpp->gpp_parms & G_PART_PARM_ENTRIES) &&
994 (gpp->gpp_entries < scheme->gps_minent ||
995 gpp->gpp_entries > scheme->gps_maxent)) {
996 gctl_error(req, "%d entries '%d'", EINVAL, gpp->gpp_entries);
1002 gp->softc = kobj_create((kobj_class_t)gpp->gpp_scheme, M_GEOM,
1006 table->gpt_scheme = gpp->gpp_scheme;
1007 table->gpt_entries = (gpp->gpp_parms & G_PART_PARM_ENTRIES) ?
1008 gpp->gpp_entries : scheme->gps_defent;
1054 error = G_PART_CREATE(table, gpp);
1068 gpp->gpp_parms |= G_PART_PARM_GEOM;
1069 gpp->gpp_geom = gp;
1072 if (gpp->gpp_parms & G_PART_PARM_OUTPUT) {
1095 g_part_ctl_delete(struct gctl_req *req, struct g_part_parms *gpp)
1103 gp = gpp->gpp_geom;
1112 if (entry->gpe_index == gpp->gpp_index)
1116 gctl_error(req, "%d index '%d'", ENOENT, gpp->gpp_index);
1135 if (gpp->gpp_parms & G_PART_PARM_OUTPUT) {
1155 g_part_ctl_destroy(struct gctl_req *req, struct g_part_parms *gpp)
1165 gp = gpp->gpp_geom;
1174 if (gpp->gpp_force) {
1185 if (gpp->gpp_force) {
1198 error = G_PART_DESTROY(table, gpp);
1227 if (gpp->gpp_parms & G_PART_PARM_OUTPUT) {
1238 g_part_ctl_modify(struct gctl_req *req, struct g_part_parms *gpp)
1246 gp = gpp->gpp_geom;
1255 if (entry->gpe_index == gpp->gpp_index)
1259 gctl_error(req, "%d index '%d'", ENOENT, gpp->gpp_index);
1263 error = G_PART_MODIFY(table, entry, gpp);
1273 if (gpp->gpp_parms & G_PART_PARM_OUTPUT) {
1285 g_part_ctl_move(struct gctl_req *req, struct g_part_parms *gpp)
1292 g_part_ctl_recover(struct gctl_req *req, struct g_part_parms *gpp)
1299 gp = gpp->gpp_geom;
1318 if (gpp->gpp_parms & G_PART_PARM_OUTPUT) {
1333 g_part_ctl_resize(struct gctl_req *req, struct g_part_parms *gpp)
1344 gp = gpp->gpp_geom;
1353 if (entry->gpe_index == gpp->gpp_index)
1357 gctl_error(req, "%d index '%d'", ENOENT, gpp->gpp_index);
1362 end = entry->gpe_start + gpp->gpp_size - 1;
1363 if (gpp->gpp_size < 1 || end > table->gpt_last) {
1365 (intmax_t)gpp->gpp_size);
1379 (intmax_t)gpp->gpp_size);
1387 if (entry->gpe_end - entry->gpe_start + 1 > gpp->gpp_size) {
1394 error = G_PART_RESIZE(table, entry, gpp);
1411 if (gpp->gpp_parms & G_PART_PARM_OUTPUT) {
1423 g_part_ctl_setunset(struct gctl_req *req, struct g_part_parms *gpp,
1432 gp = gpp->gpp_geom;
1438 if (gpp->gpp_parms & G_PART_PARM_INDEX) {
1442 if (entry->gpe_index == gpp->gpp_index)
1447 gpp->gpp_index);
1453 error = G_PART_SETUNSET(table, entry, gpp->gpp_attrib, set);
1455 gctl_error(req, "%d attrib '%s'", error, gpp->gpp_attrib);
1460 if (gpp->gpp_parms & G_PART_PARM_OUTPUT) {
1462 sbuf_printf(sb, "%s %sset on ", gpp->gpp_attrib,
1477 g_part_ctl_undo(struct gctl_req *req, struct g_part_parms *gpp)
1486 gp = gpp->gpp_geom;
1605 struct g_part_parms gpp;
1701 bzero(&gpp, sizeof(gpp));
1772 &gpp.gpp_attrib);
1776 &gpp.gpp_codeptr, &gpp.gpp_codesize);
1780 &gpp.gpp_entries);
1783 error = g_part_parm_str(req, ap->name, &gpp.gpp_flags);
1787 &gpp.gpp_force);
1790 error = g_part_parm_geom(req, ap->name, &gpp.gpp_geom);
1794 &gpp.gpp_index);
1797 error = g_part_parm_str(req, ap->name, &gpp.gpp_label);
1804 &gpp.gpp_provider);
1808 &gpp.gpp_scheme);
1811 error = g_part_parm_quad(req, ap->name, &gpp.gpp_size);
1815 &gpp.gpp_skip_dsn);
1819 &gpp.gpp_start);
1822 error = g_part_parm_str(req, ap->name, &gpp.gpp_type);
1826 &gpp.gpp_version);
1840 gpp.gpp_parms |= parm;
1842 if ((gpp.gpp_parms & mparms) != mparms) {
1843 parm = mparms - (gpp.gpp_parms & mparms);
1851 if (modifies && (gpp.gpp_parms & G_PART_PARM_GEOM)) {
1852 table = gpp.gpp_geom->softc;
1858 EPERM, gpp.gpp_geom->name);
1862 error = g_access(LIST_FIRST(&gpp.gpp_geom->consumer),
1866 gpp.gpp_geom->name);
1876 error = G_PART_PRECHECK(table, ctlreq, &gpp);
1888 error = g_part_ctl_add(req, &gpp);
1891 error = g_part_ctl_bootcode(req, &gpp);
1894 error = g_part_ctl_commit(req, &gpp);
1897 error = g_part_ctl_create(req, &gpp);
1900 error = g_part_ctl_delete(req, &gpp);
1903 error = g_part_ctl_destroy(req, &gpp);
1906 error = g_part_ctl_modify(req, &gpp);
1909 error = g_part_ctl_move(req, &gpp);
1912 error = g_part_ctl_recover(req, &gpp);
1915 error = g_part_ctl_resize(req, &gpp);
1918 error = g_part_ctl_setunset(req, &gpp, 1);
1921 error = g_part_ctl_undo(req, &gpp);
1924 error = g_part_ctl_setunset(req, &gpp, 0);
1931 (gpp.gpp_parms & G_PART_PARM_FLAGS) &&
1932 strchr(gpp.gpp_flags, 'C') != NULL) ? 1 : 0;
1934 KASSERT(gpp.gpp_parms & G_PART_PARM_GEOM, ("%s",
1936 error = g_part_ctl_commit(req, &gpp);
1942 g_access(LIST_FIRST(&gpp.gpp_geom->consumer), -1, -1, -1);