Changeset 6088193 in mainline for uspace/lib/ext4/libext4_filesystem.c
- Timestamp:
- 2011-11-10T19:59:51Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 27ca3a3
- Parents:
- b3d7277
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/ext4/libext4_filesystem.c
rb3d7277 r6088193 82 82 fs->inode_blocks_per_level[0] = 1; 83 83 for (i = 1; i < 4; i++) { 84 fs->inode_blocks_per_level[i] 84 fs->inode_blocks_per_level[i] = fs->inode_blocks_per_level[i-1] * 85 85 block_ids_per_block; 86 86 fs->inode_block_limits[i] = fs->inode_block_limits[i-1] + … … 321 321 offset_in_block = block_offset_in_level / fs->inode_blocks_per_level[level-1]; 322 322 323 if (current_block == 0) { 324 *fblock = 0; 325 return EOK; 326 } 327 323 328 /* Navigate through other levels, until we find the block number 324 329 * or find null reference meaning we are dealing with sparse file … … 415 420 if (rc != EOK) { 416 421 // TODO error 417 } 418 EXT4FS_DBG("AAA: new addr \%u, level = \%u", new_block_addr, level); 422 EXT4FS_DBG("error in allocation"); 423 } 424 // EXT4FS_DBG("AAA: new addr \%u, level = \%u", new_block_addr, level); 419 425 420 426 ext4_inode_set_indirect_block(inode_ref->inode, level - 1, new_block_addr); … … 435 441 EXT4FS_DBG("block put error"); 436 442 } 443 444 // EXT4FS_DBG("allocated indirect block for level \%u, during setting iblock \%u", level, (uint32_t)iblock); 437 445 438 446 current_block = new_block_addr; … … 462 470 if (rc != EOK) { 463 471 // TODO error 472 473 EXT4FS_DBG("BBB: error block loading"); 474 464 475 } 465 476 memset(new_block->data, 0, block_size); … … 524 535 525 536 ext4_inode_set_direct_block(inode, iblock, 0); 526 return ext4_bitmap_free_block(fs, fblock);537 return ext4_bitmap_free_block(fs, inode_ref, fblock); 527 538 } 528 539 … … 588 599 } 589 600 590 return ext4_bitmap_free_block(fs, fblock);601 return ext4_bitmap_free_block(fs, inode_ref, fblock); 591 602 592 603 }
Note:
See TracChangeset
for help on using the changeset viewer.