Changeset 1412b7ee in mainline for uspace/lib/ext4/libext4_extent.c
- Timestamp:
- 2014-02-01T21:46:42Z (10 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 3eb0c85
- Parents:
- 680708d (diff), 0dd022ec (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. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/ext4/libext4_extent.c
r680708d r1412b7ee 371 371 uint32_t *fblock) 372 372 { 373 int rc; 373 374 /* Compute bound defined by i-node size */ 374 375 uint64_t inode_size = … … 400 401 uint64_t child = ext4_extent_index_get_leaf(index); 401 402 402 if (block != NULL) 403 block_put(block); 404 405 int rc = block_get(&block, inode_ref->fs->device, child, 403 if (block != NULL) { 404 rc = block_put(block); 405 if (rc != EOK) 406 return rc; 407 } 408 409 rc = block_get(&block, inode_ref->fs->device, child, 406 410 BLOCK_FLAGS_NONE); 407 411 if (rc != EOK) … … 429 433 /* Cleanup */ 430 434 if (block != NULL) 431 block_put(block);432 433 return EOK;435 rc = block_put(block); 436 437 return rc; 434 438 } 435 439 … … 505 509 506 510 cleanup: 511 ; 512 513 int rc2 = EOK; 514 507 515 /* 508 516 * Put loaded blocks … … 510 518 */ 511 519 for (uint16_t i = 1; i < tmp_path->depth; ++i) { 512 if (tmp_path[i].block) 513 block_put(tmp_path[i].block); 520 if (tmp_path[i].block) { 521 rc2 = block_put(tmp_path[i].block); 522 if (rc == EOK && rc2 != EOK) 523 rc = rc2; 524 } 514 525 } 515 526 … … 594 605 return rc; 595 606 596 ext4_balloc_free_block(inode_ref, fblock); 597 598 return EOK; 607 return ext4_balloc_free_block(inode_ref, fblock); 599 608 } 600 609 … … 721 730 722 731 cleanup: 732 ; 733 734 int rc2 = EOK; 735 723 736 /* 724 737 * Put loaded blocks … … 726 739 */ 727 740 for (uint16_t i = 1; i <= path->depth; ++i) { 728 if (path[i].block) 729 block_put(path[i].block); 741 if (path[i].block) { 742 rc2 = block_put(path[i].block); 743 if (rc == EOK && rc2 != EOK) 744 rc = rc2; 745 } 730 746 } 731 747 … … 778 794 779 795 /* Put back not modified old block */ 780 block_put(path_ptr->block); 796 rc = block_put(path_ptr->block); 797 if (rc != EOK) { 798 ext4_balloc_free_block(inode_ref, fblock); 799 return rc; 800 } 781 801 782 802 /* Initialize newly allocated block and remember it */ … … 1061 1081 1062 1082 finish: 1083 ; 1084 1085 int rc2 = EOK; 1086 1063 1087 /* Set return values */ 1064 1088 *iblock = new_block_idx; … … 1070 1094 */ 1071 1095 for (uint16_t i = 1; i <= path->depth; ++i) { 1072 if (path[i].block) 1073 block_put(path[i].block); 1096 if (path[i].block) { 1097 rc2 = block_put(path[i].block); 1098 if (rc == EOK && rc2 != EOK) 1099 rc = rc2; 1100 } 1074 1101 } 1075 1102
Note:
See TracChangeset
for help on using the changeset viewer.