Changeset 9f4650c in mainline
- Timestamp:
- 2013-07-26T18:31:47Z (11 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- c3cbbb2
- Parents:
- 9256d093 (diff), 1a1a735 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - Location:
- uspace
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/hdisk/func_gpt.c
r9256d093 r9f4650c 194 194 195 195 char *name; 196 printf("Name the partition: "); 196 197 rc = get_input_line(in, &name); 197 198 if (rc != EOK) { … … 200 201 } 201 202 203 printf("name: %s, len: %d\n", name, str_size(name)); 202 204 gpt_set_part_name(p, name, str_size(name)); 203 205 -
uspace/app/hdisk/hdisk.c
r9256d093 r9f4650c 199 199 case 'q': 200 200 putchar('\n'); 201 free_label(); 201 202 goto end; 202 203 case 'r': -
uspace/lib/gpt/libgpt.c
r9256d093 r9f4650c 127 127 rc = block_init(EXCHANGE_ATOMIC, dev_handle, 512); 128 128 if (rc != EOK) 129 return rc;129 goto fail; 130 130 131 131 rc = block_get_bsize(dev_handle, &b_size); 132 132 if (rc != EOK) 133 return rc;133 goto fini_fail; 134 134 135 135 if (label->gpt == NULL) { 136 136 label->gpt = gpt_alloc_header(b_size); 137 if (label->gpt == NULL) 138 return ENOMEM; 137 if (label->gpt == NULL) { 138 rc = ENOMEM; 139 goto fini_fail; 140 } 139 141 } 140 142 … … 144 146 rc = block_get_nblocks(dev_handle, &n_blocks); 145 147 if (rc != EOK) 146 goto f ail;148 goto free_fail; 147 149 148 150 rc = load_and_check_header(dev_handle, n_blocks - 1, b_size, label->gpt->header); 149 151 if (rc == EBADCHECKSUM || rc == EINVAL) 150 goto f ail;152 goto free_fail; 151 153 } 152 154 … … 155 157 return EOK; 156 158 157 fail: 158 block_fini(dev_handle); 159 free_fail: 159 160 gpt_free_gpt(label->gpt); 160 161 label->gpt = NULL; 162 fini_fail: 163 block_fini(dev_handle); 164 fail: 161 165 return rc; 162 166 } … … 240 244 * - we don't need more bytes 241 245 * - the size of GPT partition entry can be different to 128 bytes */ 246 /* comm_size is ignored */ 242 247 rc = block_init(EXCHANGE_SERIALIZE, label->device, sizeof(gpt_entry_t)); 243 248 if (rc != EOK) … … 247 252 rc = block_get_bsize(label->device, &block_size); 248 253 if (rc != EOK) 249 goto f ail;254 goto fini_fail; 250 255 251 256 //size_t bufpos = 0; … … 266 271 267 272 if (rc != EOK) 268 goto f ail;273 goto fini_fail; 269 274 } 270 275 … … 274 279 * on all of the partition entry array. 275 280 */ 276 uint32_t crc = compute_crc32((uint8_t *) label->parts->part_array, label->parts->fill * sizeof(gpt_entry_t)); 281 uint32_t crc = compute_crc32((uint8_t *) label->parts->part_array, 282 label->parts->fill * sizeof(gpt_entry_t)); 277 283 278 284 if(uint32_t_le2host(label->gpt->header->pe_array_crc32) != crc) 279 285 { 280 286 rc = EBADCHECKSUM; 281 goto fail; 282 } 283 287 goto fini_fail; 288 } 289 290 block_fini(label->device); 284 291 return EOK; 292 293 fini_fail: 294 block_fini(label->device); 285 295 286 296 fail: -
uspace/lib/gpt/libgpt.h
r9256d093 r9f4650c 71 71 */ 72 72 typedef struct { 73 uint8_t efi_signature[8];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 disk_guid[16];82 uint8_t disk_guid[16]; 83 83 uint64_t entry_lba; 84 84 uint32_t fillries; -
uspace/lib/mbr/libmbr.c
r9256d093 r9f4650c 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); 592 593 mbr_free_partition(p); 593 594 }
Note:
See TracChangeset
for help on using the changeset viewer.