Changeset 476bf2f6 in mainline for uspace/lib/ext4/libext4_directory_index.c
- Timestamp:
- 2012-02-20T17:27:45Z (12 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- f577058
- Parents:
- 1ebb66f
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/ext4/libext4_directory_index.c
r1ebb66f r476bf2f6 580 580 } 581 581 582 // Compute next block index and allocate data block583 uint64_t parent_size = ext4_inode_get_size(fs->superblock, parent->inode);584 uint32_t new_block_idx = parent_size / block_size;585 586 582 uint32_t fblock; 587 rc = ext4_filesystem_get_inode_data_block_index(fs, parent->inode, new_block_idx, &fblock);583 rc = ext4_directory_append_block(fs, parent, &fblock); 588 584 if (rc != EOK) { 589 return rc; 590 } 591 592 if (fblock == 0) { 593 rc = ext4_balloc_alloc_block(fs, parent, &fblock); 594 if (rc != EOK) { 595 return rc; 596 } 597 598 rc = ext4_filesystem_set_inode_data_block_index(fs, parent, new_block_idx, fblock); 599 if (rc != EOK) { 600 ext4_balloc_free_block(fs, parent, fblock); 601 return rc; 602 } 603 604 parent_size += block_size; 605 ext4_inode_set_size(parent->inode, parent_size); 606 607 parent->dirty = true; 585 // TODO error 608 586 } 609 587
Note:
See TracChangeset
for help on using the changeset viewer.