Lines Matching defs:edit

84  * We have some partitions in our "wanted" list that we may not edit,
183 * 1 -> re-edit
245 * 1 -> re-edit
257 struct single_part_fs_edit *edit = arg;
260 start = getpartoff(edit->pset->parts, edit->info.start);
261 if (edit->info.size != 0) {
262 if (start < (edit->info.start+edit->info.size)) {
264 end = edit->info.start + edit->info.size;
266 edit->info.size = edit->pset->parts->pscheme->
267 max_free_space_at(edit->pset->parts,
268 edit->info.start);
270 edit->info.size = end - start;
272 edit->info.size = 0;
275 edit->info.start = start;
282 struct single_part_fs_edit *edit = arg;
287 if (!edit->pset->parts->pscheme->get_part_info(edit->pset->parts,
288 edit->id, &pinfo))
289 pinfo = edit->info;
291 size = getpartsize(edit->pset->parts, pinfo.start,
292 edit->info.start, edit->info.size);
295 if (size > edit->pset->parts->disk_size)
296 size = edit->pset->parts->disk_size - edit->info.start;
297 edit->info.size = size;
304 struct single_part_fs_edit *edit = arg;
305 size_t val = 1 << (edit->offset+m->cursel);
307 if (edit->mode == 1) {
308 edit->info.fs_opt1 = val;
309 edit->wanted->fs_opt1 = val;
310 } else if (edit->mode == 2) {
311 edit->info.fs_opt2 = val;
312 edit->wanted->fs_opt2 = val;
321 struct single_part_fs_edit *edit = arg;
327 edit->offset = ilog2(min_val);
347 struct single_part_fs_edit *edit = arg;
349 edit->mode = 1; /* edit fs_opt1 */
357 struct single_part_fs_edit *edit = arg;
360 edit->mode = 2; /* edit fs_opt2 */
361 bsize = edit->info.fs_opt1;
363 sec_size = edit->wanted->parts->bytes_per_sector;
364 if (edit->wanted->size >= (daddr_t)(128L*(GIG/sec_size)))
366 else if (edit->wanted->size >= (daddr_t)(1000L*(MEG/sec_size)))
368 else if (edit->wanted->size >= (daddr_t)(20L*(MEG/sec_size)))
380 struct single_part_fs_edit *edit = arg;
383 snprintf(answer, sizeof answer, "%u", edit->info.fs_opt3);
386 edit->info.fs_opt3 = atol(answer);
387 edit->wanted->fs_opt3 = edit->info.fs_opt3;
395 struct single_part_fs_edit *edit = arg;
397 edit->wanted->instflags ^= PUIINST_NEWFS;
404 struct single_part_fs_edit *edit = arg;
406 edit->info.flags ^= PTI_INSTALL_TARGET;
413 struct single_part_fs_edit *edit = arg;
415 edit->wanted->instflags ^= PUIINST_MOUNT;
422 struct single_part_fs_edit *edit = arg;
425 strlcpy(buf, edit->wanted->mount, sizeof buf);
443 edit->wanted->mount[0] = 0;
444 edit->wanted->instflags &= ~PUIINST_MOUNT;
449 edit->wanted->mount[0] = '/';
450 strlcpy(&edit->wanted->mount[1], first,
451 sizeof(edit->wanted->mount)-1);
453 strlcpy(edit->wanted->mount, first, sizeof edit->wanted->mount);
455 edit->wanted->instflags |= PUIINST_MOUNT;
463 struct single_part_fs_edit *edit = arg;
465 edit->info = edit->old_info;
466 *edit->wanted = edit->old_usage;
473 struct single_part_fs_edit *edit = arg;
475 edit->rv = -1;
482 struct single_part_fs_edit *edit = arg;
484 edit->rv = -2;
550 struct single_part_fs_edit *edit = arg;
551 uint t = edit->info.fs_type;
555 if (edit->info.fs_sub_type == 3)
557 else if (edit->info.fs_sub_type == 2)
562 } else if (t == FS_EX2FS && edit->info.fs_sub_type == 1) {
593 struct single_part_fs_edit *edit = arg;
598 edit->info.fs_type = FS_BSDFFS;
599 edit->info.fs_sub_type = 3-menu->cursel;
602 edit->info.fs_type = FS_EX2FS;
603 edit->info.fs_sub_type = 1;
616 edit->info.fs_type = i;
617 edit->info.fs_sub_type = 0;
623 edit->info.fs_type = FS_EFI_SP;
624 edit->info.fs_sub_type = 0;
633 pt = edit->info.nat_type ? edit->info.nat_type->generic_ptype : PT_root;
634 edit->info.nat_type = edit->pset->parts->pscheme->
635 get_fs_part_type(pt, edit->info.fs_type, edit->info.fs_sub_type);
636 if (edit->info.nat_type == NULL)
637 edit->info.nat_type = edit->pset->parts->pscheme->
639 edit->wanted->type = edit->info.nat_type->generic_ptype;
640 edit->wanted->fs_type = edit->info.fs_type;
641 edit->wanted->fs_version = edit->info.fs_sub_type;
707 struct single_part_fs_edit *edit = arg;
711 if (edit->info.fs_type == FS_BSDFFS) {
712 if (edit->info.fs_sub_type == 3)
714 else if (edit->info.fs_sub_type == 2)
720 if (edit->info.fs_type == edit_fs_common_types[i]) {
730 struct single_part_fs_edit *edit = arg;
734 pt = edit->info.nat_type ? edit->info.nat_type->generic_ptype : PT_root;
736 edit->info.fs_type = FS_BSDFFS;
737 edit->info.fs_sub_type = 3-menu->cursel;
738 edit->info.nat_type = edit->pset->parts->pscheme->
739 get_fs_part_type(pt, FS_BSDFFS, edit->info.fs_sub_type);
740 if (edit->info.nat_type == NULL)
741 edit->info.nat_type = edit->pset->parts->
743 edit->wanted->type = edit->info.nat_type->generic_ptype;
744 edit->wanted->fs_type = edit->info.fs_type;
745 edit->wanted->fs_version = edit->info.fs_sub_type;
754 edit->info.fs_type = edit_fs_common_types[ndx];
755 edit->info.fs_sub_type = 0;
756 edit->info.nat_type = edit->pset->parts->pscheme->
757 get_fs_part_type(pt, edit->info.fs_type, 0);
758 if (edit->info.nat_type == NULL)
759 edit->info.nat_type = edit->pset->parts->
761 edit->wanted->type = edit->info.nat_type->generic_ptype;
762 edit->wanted->fs_type = edit->info.fs_type;
763 edit->wanted->fs_version = edit->info.fs_sub_type;
773 struct single_part_fs_edit *edit = arg;
781 if (edit->info.fs_type == FS_EX2FS && edit->info.fs_sub_type == 1) {
786 if (edit->info.fs_type == edit_fs_common_types[i])
861 struct single_part_fs_edit edit;
902 memset(&edit, 0, sizeof edit);
903 edit.pset = pset;
904 edit.index = menu->cursel;
905 edit.wanted = &pset->infos[edit.index];
914 if (edit.wanted->fs_type == FS_BSDFFS ||
915 edit.wanted->fs_type == FS_BSDLFS)
938 if (edit.wanted->fs_type == FS_BSDFFS ||
939 edit.wanted->fs_type == FS_BSDLFS) {
943 edit.first_custom_attr = popt - mopts;
961 edit.id = NO_PART;
964 edit.info.start = space.start;
965 edit.info.size = space.size;
966 edit.info.fs_type = FS_BSDFFS;
967 edit.info.fs_sub_type = 2;
968 edit.info.nat_type = pset->parts->pscheme->
969 get_fs_part_type(PT_root, edit.info.fs_type,
970 edit.info.fs_sub_type);
971 edit.wanted->instflags = PUIINST_NEWFS;
974 edit.id = pset->infos[edit.index].cur_part_id;
975 if (!pset->parts->pscheme->get_part_info(pset->parts, edit.id,
976 &edit.info)) {
982 edit.old_usage = *edit.wanted;
983 edit.old_info = edit.info;
990 process_menu(fspart_menu, &edit);
994 if (edit.rv == 0) { /* OK, set new data */
995 edit.info.last_mounted = edit.wanted->mount;
997 edit.wanted->parts = pset->parts;
998 if (!can_newfs_fstype(edit.info.fs_type))
999 edit.wanted->instflags &= ~PUIINST_NEWFS;
1000 edit.wanted->cur_part_id = pset->parts->pscheme->
1001 add_partition(pset->parts, &edit.info, &err);
1002 if (edit.wanted->cur_part_id == NO_PART)
1006 pset->parts, edit.wanted->cur_part_id,
1007 &edit.info);
1008 edit.wanted->cur_start = edit.info.start;
1009 edit.wanted->size = edit.info.size;
1010 edit.wanted->type =
1011 edit.info.nat_type->generic_ptype;
1012 edit.wanted->fs_type = edit.info.fs_type;
1013 edit.wanted->fs_version = edit.info.fs_sub_type;
1014 edit.wanted->cur_flags = edit.info.flags;
1020 edit.id, &edit.info, &err))
1023 pset->cur_free_space += edit.old_info.size -
1024 edit.info.size;
1032 } else if (edit.rv == -1) { /* cancel edit */
1034 memmove(pset->infos+edit.index,
1035 pset->infos+edit.index+1,
1036 sizeof(*pset->infos)*(pset->num-edit.index));
1037 memmove(menu->opts+edit.index,
1038 menu->opts+edit.index+1,
1039 sizeof(*menu->opts)*(menu->numopts-edit.index));
1045 pset->infos[edit.index] = edit.old_usage;
1046 } else if (!is_new_part && edit.rv == -2) { /* delete partition */
1048 edit.id, &err)) {
1053 pset->infos[edit.index].parts);
1054 pset->cur_free_space += edit.info.size;
1055 memmove(pset->infos+edit.index,
1056 pset->infos+edit.index+1,
1057 sizeof(*pset->infos)*(pset->num-edit.index));
1058 memmove(menu->opts+edit.index,
1059 menu->opts+edit.index+1,
1060 sizeof(*menu->opts)*(menu->numopts-edit.index));
1082 struct single_part_fs_edit *edit = arg;
1084 uint t = edit->info.fs_type;
1102 edit->info.nat_type &&
1103 edit->info.nat_type->generic_ptype != PT_root)
1109 edit->wanted->instflags &= ~PUIINST_NEWFS;
1113 attr_no = (size_t)i - edit->first_custom_attr;
1114 if (!edit->pset->parts->pscheme->
1116 edit->pset->parts, edit->id, attr_no))
1123 if ((edit->pset->infos[edit->index].flags & PUIFLG_IS_OUTER)
1141 struct single_part_fs_edit *edit = arg;
1172 i < edit->pset->parts->pscheme->custom_attribute_count;
1175 edit->pset->parts->pscheme->custom_attributes[i]
1185 && (opt != 3 || edit->info.fs_type == FS_UNUSED)
1197 if (edit->info.fs_type == FS_BSDFFS) {
1198 if (edit->info.fs_sub_type == 3)
1200 else if (edit->info.fs_sub_type == 2)
1205 c = getfslabelname(edit->info.fs_type,
1206 edit->info.fs_sub_type);
1212 ptn_start, edit->info.start / sizemult, multname);
1216 ptn_size, edit->info.size / sizemult, multname);
1220 ptn_end, (edit->info.start + edit->info.size)
1227 msg_string((edit->info.flags & PTI_INSTALL_TARGET)
1233 msg_string(edit->wanted->instflags & PUIINST_NEWFS
1239 msg_string(edit->wanted->instflags & PUIINST_MOUNT
1245 edit->wanted->fs_opt1);
1250 edit->wanted->fs_opt2);
1254 if (edit->wanted->fs_opt3 == 0)
1261 snprintf(buf, sizeof buf, "%u", edit->wanted->fs_opt3);
1272 if (edit->wanted->mountflags & PUIMNT_ASYNC)
1274 if (edit->wanted->mountflags & PUIMNT_NOATIME)
1276 if (edit->wanted->mountflags & PUIMNT_NODEV)
1278 if (edit->wanted->mountflags & PUIMNT_NODEVMTIME)
1280 if (edit->wanted->mountflags & PUIMNT_NOEXEC)
1282 if (edit->wanted->mountflags & PUIMNT_NOSUID)
1284 if (edit->wanted->mountflags & PUIMNT_LOG)
1286 if (edit->wanted->mountflags & PUIMNT_NOAUTO)
1292 edit->wanted->mount);
1296 attr_no = opt - edit->first_custom_attr;
1297 edit->pset->parts->pscheme->format_custom_attribute(
1298 edit->pset->parts, edit->id, attr_no, &edit->info,
1300 attrname = msg_string(edit->pset->parts->pscheme->
1308 struct single_part_fs_edit *edit = arg;
1309 size_t attr_no = m->cursel - edit->first_custom_attr;
1312 switch (edit->pset->parts->pscheme->custom_attributes[attr_no].type) {
1314 edit->pset->parts->pscheme->custom_attribute_toggle(
1315 edit->pset->parts, edit->id, attr_no);
1319 edit->pset->parts->pscheme->format_custom_attribute(
1320 edit->pset->parts, edit->id, attr_no, &edit->info,
1323 edit->pset->parts->pscheme->custom_attributes[attr_no].
1325 edit->pset->parts->pscheme->custom_attribute_set_str(
1326 edit->pset->parts, edit->id, attr_no, line);
1739 /* now update edit menu to fit */
1814 /* now update edit menu to fit */
1831 * Ask the user if they want to edit the partition or give up.
1918 /* first give the user the option to edit the label... */