Changes in / [9f4650c:9256d093] in mainline
- Location:
- uspace
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/hdisk/func_gpt.c
r9f4650c r9256d093 194 194 195 195 char *name; 196 printf("Name the partition: ");197 196 rc = get_input_line(in, &name); 198 197 if (rc != EOK) { … … 201 200 } 202 201 203 printf("name: %s, len: %d\n", name, str_size(name));204 202 gpt_set_part_name(p, name, str_size(name)); 205 203 -
uspace/app/hdisk/hdisk.c
r9f4650c r9256d093 199 199 case 'q': 200 200 putchar('\n'); 201 free_label();202 201 goto end; 203 202 case 'r': -
uspace/lib/gpt/libgpt.c
r9f4650c r9256d093 127 127 rc = block_init(EXCHANGE_ATOMIC, dev_handle, 512); 128 128 if (rc != EOK) 129 goto fail;129 return rc; 130 130 131 131 rc = block_get_bsize(dev_handle, &b_size); 132 132 if (rc != EOK) 133 goto fini_fail;133 return rc; 134 134 135 135 if (label->gpt == NULL) { 136 136 label->gpt = gpt_alloc_header(b_size); 137 if (label->gpt == NULL) { 138 rc = ENOMEM; 139 goto fini_fail; 140 } 137 if (label->gpt == NULL) 138 return ENOMEM; 141 139 } 142 140 … … 146 144 rc = block_get_nblocks(dev_handle, &n_blocks); 147 145 if (rc != EOK) 148 goto f ree_fail;146 goto fail; 149 147 150 148 rc = load_and_check_header(dev_handle, n_blocks - 1, b_size, label->gpt->header); 151 149 if (rc == EBADCHECKSUM || rc == EINVAL) 152 goto f ree_fail;150 goto fail; 153 151 } 154 152 … … 157 155 return EOK; 158 156 159 free_fail: 157 fail: 158 block_fini(dev_handle); 160 159 gpt_free_gpt(label->gpt); 161 160 label->gpt = NULL; 162 fini_fail:163 block_fini(dev_handle);164 fail:165 161 return rc; 166 162 } … … 244 240 * - we don't need more bytes 245 241 * - the size of GPT partition entry can be different to 128 bytes */ 246 /* comm_size is ignored */247 242 rc = block_init(EXCHANGE_SERIALIZE, label->device, sizeof(gpt_entry_t)); 248 243 if (rc != EOK) … … 252 247 rc = block_get_bsize(label->device, &block_size); 253 248 if (rc != EOK) 254 goto f ini_fail;249 goto fail; 255 250 256 251 //size_t bufpos = 0; … … 271 266 272 267 if (rc != EOK) 273 goto f ini_fail;268 goto fail; 274 269 } 275 270 … … 279 274 * on all of the partition entry array. 280 275 */ 281 uint32_t crc = compute_crc32((uint8_t *) label->parts->part_array, 282 label->parts->fill * sizeof(gpt_entry_t)); 276 uint32_t crc = compute_crc32((uint8_t *) label->parts->part_array, label->parts->fill * sizeof(gpt_entry_t)); 283 277 284 278 if(uint32_t_le2host(label->gpt->header->pe_array_crc32) != crc) 285 279 { 286 280 rc = EBADCHECKSUM; 287 goto fini_fail; 288 } 289 290 block_fini(label->device); 281 goto fail; 282 } 283 291 284 return EOK; 292 293 fini_fail:294 block_fini(label->device);295 285 296 286 fail: -
uspace/lib/gpt/libgpt.h
r9f4650c r9256d093 71 71 */ 72 72 typedef struct { 73 uint8_t 73 uint8_t efi_signature[8]; 74 74 uint32_t revision; 75 75 uint32_t header_size; … … 80 80 uint64_t first_usable_lba; 81 81 uint64_t last_usable_lba; 82 uint8_t 82 uint8_t disk_guid[16]; 83 83 uint64_t entry_lba; 84 84 uint32_t fillries; -
uspace/lib/mbr/libmbr.c
r9f4650c r9256d093 590 590 list_foreach_safe(parts->list, cur_link, next) { 591 591 mbr_part_t *p = list_get_instance(cur_link, mbr_part_t, link); 592 list_remove(cur_link);593 592 mbr_free_partition(p); 594 593 }
Note:
See TracChangeset
for help on using the changeset viewer.