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