Changeset 49c94a3 in mainline
- Timestamp:
- 2012-06-18T09:49:18Z (12 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 9a487cc
- Parents:
- 1d4024cf
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/ext4/libext4_extent.c
r1d4024cf r49c94a3 539 539 uint32_t fblock = ext4_extent_index_get_leaf(index); 540 540 541 rc = block_get(&block, inode_ref->fs->device, fblock, BLOCK_FLAGS_NO READ);541 rc = block_get(&block, inode_ref->fs->device, fblock, BLOCK_FLAGS_NONE); 542 542 if (rc != EOK) { 543 543 EXT4FS_DBG("ERROR get_block"); … … 581 581 rc = block_put(block); 582 582 if (rc != EOK) { 583 EXT4FS_DBG("ERROR put_block");583 EXT4FS_DBG("ERROR block_put returned \%d", rc); 584 584 return rc; 585 585 } … … 616 616 617 617 // First extent maybe released partially 618 uint32_t first_ fblock;619 first_fblock = ext4_extent_get_start(path_ptr->extent) + iblock_from;620 first_fblock -= ext4_extent_get_first_block(path_ptr->extent); 618 uint32_t first_iblock = ext4_extent_get_first_block(path_ptr->extent); 619 uint32_t first_fblock = ext4_extent_get_start(path_ptr->extent) + iblock_from - first_iblock; 620 621 621 622 622 uint16_t block_count = ext4_extent_get_block_count(path_ptr->extent); 623 623 624 uint16_t delete_count = block_count - first_fblock +625 ext4_extent_get_start(path_ptr->extent) ;624 uint16_t delete_count = block_count - ( 625 ext4_extent_get_start(path_ptr->extent) - first_fblock); 626 626 627 627 // Release all blocks … … 643 643 if (block_count == 0) { 644 644 entries--; 645 ext4_extent_header_set_entries_count(path_ptr->header, entries);646 645 } 647 646 … … 657 656 658 657 entries--; 659 ext4_extent_header_set_entries_count(path_ptr->header, entries);660 661 658 tmp_ext++; 662 659 } 663 660 664 // If leaf node is empty, the whole tree must be checked and the node will be released 661 ext4_extent_header_set_entries_count(path_ptr->header, entries); 662 path_ptr->block->dirty = true; 663 664 // If leaf node is empty, parent entry must be modified 665 665 bool remove_parent_record = false; 666 666 … … 684 684 EXT4_EXTENT_FIRST_INDEX(path_ptr->header) + entries; 685 685 686 // Correct entr ybecause of changes in the previous iteration686 // Correct entries count because of changes in the previous iteration 687 687 if (remove_parent_record) { 688 688 entries--; … … 700 700 701 701 ext4_extent_header_set_entries_count(path_ptr->header, entries); 702 703 702 path_ptr->block->dirty = true; 704 703
Note:
See TracChangeset
for help on using the changeset viewer.