Changeset 22747e8 in mainline
- Timestamp:
- 2015-08-03T20:23:37Z (9 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 83dd743
- Parents:
- 6439741
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/label/src/mbr.c
r6439741 r22747e8 237 237 rc = mbr_pte_to_log_part(label, ebr_b0, ethis); 238 238 if (rc != EOK) { 239 rc = EIO;239 rc = EIO; 240 240 goto error; 241 241 } … … 627 627 mbr_pte_t pte; 628 628 label_part_t *prev; 629 label_part_t *next; 630 uint64_t ep_b0; 629 631 int rc; 630 632 … … 659 661 return EIO; 660 662 } 663 664 /* Delete EBR */ 665 rc = mbr_ebr_delete(part->label, part); 666 if (rc != EOK) 667 return EIO; 661 668 } else { 669 next = mbr_log_part_next(part); 662 670 list_remove(&part->llog); 663 } 664 665 /* Delete EBR */ 666 mbr_ebr_delete(part->label, part); 671 672 if (next != NULL) { 673 /* 674 * Relocate next partitions EBR to the beginning 675 * of extended partition. This also overwrites 676 * the EBR of the former first partition. 677 */ 678 679 /* First block of extended partition */ 680 ep_b0 = part->label->ext_part->block0; 681 682 next->hdr_blocks = next->block0 - ep_b0; 683 684 rc = mbr_ebr_create(part->label, next); 685 if (rc != EOK) { 686 list_prepend(&part->llog, &part->label->log_parts); 687 return EIO; 688 } 689 } else { 690 /* Delete EBR */ 691 rc = mbr_ebr_delete(part->label, part); 692 if (rc != EOK) 693 return EIO; 694 } 695 } 667 696 668 697 /* Update indices */ … … 768 797 return EOK; 769 798 } 770 #include <stdio.h> 799 771 800 static void mbr_log_part_to_ptes(label_part_t *part, mbr_pte_t *pthis, 772 801 mbr_pte_t *pnext) … … 781 810 assert(link_used(&part->llog)); 782 811 assert(part->block0 >= ep_b0); 783 printf("part->hdr_blocks = %" PRIu64 "\n", part->hdr_blocks);784 printf("part->block0 = %" PRIu64 "\n", part->block0);785 printf("ep_b0 = %" PRIu64 "\n", ep_b0);786 812 assert(part->hdr_blocks <= part->block0 - ep_b0); 787 813 … … 796 822 /* 'Next' EBR entry */ 797 823 if (pnext != NULL) { 798 next = mbr_ part_next(part);824 next = mbr_log_part_next(part); 799 825 800 826 memset(pnext, 0, sizeof(mbr_pte_t));
Note:
See TracChangeset
for help on using the changeset viewer.