Changeset e5a1ace3 in mainline
- Timestamp:
- 2013-11-28T20:40:38Z (11 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 1f63d9d
- Parents:
- 532f53d
- Location:
- uspace/lib/ext4
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/ext4/libext4_balloc.c
r532f53d re5a1ace3 328 328 *goal = inode_table_first_block + inode_table_blocks; 329 329 330 ext4_filesystem_put_block_group_ref(bg_ref); 331 332 return EOK; 330 return ext4_filesystem_put_block_group_ref(bg_ref); 333 331 } 334 332 … … 469 467 470 468 /* No free block found yet */ 471 block_put(bitmap_block); 472 ext4_filesystem_put_block_group_ref(bg_ref); 469 rc = block_put(bitmap_block); 470 if (rc != EOK) { 471 ext4_filesystem_put_block_group_ref(bg_ref); 472 return rc; 473 } 474 475 rc = ext4_filesystem_put_block_group_ref(bg_ref); 476 if (rc != EOK) 477 return rc; 473 478 474 479 /* Try other block groups */ … … 540 545 } 541 546 542 block_put(bitmap_block); 547 rc = block_put(bitmap_block); 548 if (rc != EOK) { 549 ext4_filesystem_put_block_group_ref(bg_ref); 550 return rc; 551 } 552 543 553 ext4_filesystem_put_block_group_ref(bg_ref); 554 if (rc != EOK) 555 return rc; 544 556 545 557 /* Goto next group */ … … 576 588 bg_ref->dirty = true; 577 589 578 ext4_filesystem_put_block_group_ref(bg_ref);590 rc = ext4_filesystem_put_block_group_ref(bg_ref); 579 591 580 592 *fblock = allocated_block; 581 return EOK;593 return rc; 582 594 } 583 595 -
uspace/lib/ext4/libext4_directory_index.c
r532f53d re5a1ace3 527 527 528 528 /* Don't forget to put old block (prevent memory leak) */ 529 block_put(p->block); 529 rc = block_put(p->block); 530 if (rc != EOK) 531 return rc; 530 532 531 533 p->block = block; … … 553 555 /* Load direct block 0 (index root) */ 554 556 uint32_t root_block_addr; 557 int rc2; 555 558 int rc = ext4_filesystem_get_inode_data_block_index(inode_ref, 0, 556 559 &root_block_addr); … … 620 623 621 624 /* Not found, leave untouched */ 622 block_put(leaf_block); 625 rc2 = block_put(leaf_block); 626 if (rc2 != EOK) 627 goto cleanup; 623 628 624 629 if (rc != ENOENT) … … 628 633 rc = ext4_directory_dx_next_block(inode_ref, hinfo.hash, 629 634 dx_block, &dx_blocks[0]); 630 if (rc < 0)635 if (rc != EOK) 631 636 goto cleanup; 637 632 638 } while (rc == ENOENT); 633 639 … … 640 646 641 647 while (tmp <= dx_block) { 642 block_put(tmp->block); 648 rc2 = block_put(tmp->block); 649 if (rc == EOK && rc2 != EOK) 650 rc = rc2; 643 651 ++tmp; 644 652 } -
uspace/lib/ext4/libext4_extent.c
r532f53d re5a1ace3 794 794 795 795 /* Put back not modified old block */ 796 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 } 797 801 798 802 /* Initialize newly allocated block and remember it */ -
uspace/lib/ext4/libext4_ialloc.c
r532f53d re5a1ace3 215 215 /* Block group has not any free i-node */ 216 216 if (rc == ENOSPC) { 217 block_put(bitmap_block); 218 ext4_filesystem_put_block_group_ref(bg_ref); 217 rc = block_put(bitmap_block); 218 if (rc != EOK) { 219 ext4_filesystem_put_block_group_ref(bg_ref); 220 return rc; 221 } 222 223 rc = ext4_filesystem_put_block_group_ref(bg_ref); 224 if (rc != EOK) 225 return rc; 226 219 227 continue; 220 228 } … … 272 280 273 281 /* Block group not modified, put it and jump to the next block group */ 274 ext4_filesystem_put_block_group_ref(bg_ref); 282 rc = ext4_filesystem_put_block_group_ref(bg_ref); 283 if (rc != EOK) 284 return rc; 285 275 286 ++bgid; 276 287 }
Note:
See TracChangeset
for help on using the changeset viewer.