Changes in uspace/app/hdisk/func_gpt.c [c3cbbb2:dc76f4a] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/hdisk/func_gpt.c
rc3cbbb2 rdc76f4a 42 42 #include "input.h" 43 43 44 static int set_gpt_partition(tinput_t *, gpt_part_t * );44 static int set_gpt_partition(tinput_t *, gpt_part_t *, unsigned int); 45 45 46 46 int construct_gpt_label(label_t *this) … … 68 68 } 69 69 70 return set_gpt_partition(in, p );70 return set_gpt_partition(in, p, this->alignment); 71 71 } 72 72 … … 80 80 81 81 rc = gpt_remove_partition(this->data.gpt, idx); 82 if (rc != EOK) {82 if (rc == ENOMEM) { 83 83 printf("Warning: running low on memory, not resizing...\n"); 84 84 return rc; 85 } else if (rc == EINVAL) { 86 printf("Invalid index.\n"); 87 return rc; 85 88 } 86 89 … … 102 105 int print_gpt_parts(label_t *this) 103 106 { 104 //int rc;105 107 printf("Current partition scheme (GPT):\n"); 106 printf(" \t\tStart:\tEnd:\tLength:\tType:\tName:\n");108 printf("%15s %10s %10s Type: Name:\n", "Start:", "End:", "Length:"); 107 109 108 110 size_t i = 0; … … 117 119 printf("%15s %10s %10s Type: Name:\n", "Start:", "End:", "Length:"); 118 120 119 //printf("\t%10u %10u %10u %3d\n", iter->start_addr, iter->start_addr + iter->length, 120 // iter->length, gpt_get_part_type(iter), gpt_get_part_name(iter)); 121 121 122 printf("%3u %10llu %10llu %10llu %3d %s\n", i-1, gpt_get_start_lba(iter), gpt_get_end_lba(iter), 122 123 gpt_get_end_lba(iter) - gpt_get_start_lba(iter), gpt_get_part_type(iter), … … 125 126 } 126 127 127 //return rc;128 128 return EOK; 129 129 } … … 173 173 } 174 174 175 static int set_gpt_partition(tinput_t *in, gpt_part_t *p )175 static int set_gpt_partition(tinput_t *in, gpt_part_t *p, unsigned int alignment) 176 176 { 177 177 int rc; … … 181 181 printf("Set starting address (number): "); 182 182 sa = get_input_uint64(in); 183 if (sa % alignment != 0) 184 sa = gpt_get_next_aligned(sa, alignment); 183 185 184 186 printf("Set end addres (number): ");
Note:
See TracChangeset
for help on using the changeset viewer.