Changeset 9aa82e6 in mainline
- Timestamp:
- 2012-07-10T09:46:53Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 292c843
- Parents:
- 5d3d75a5
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/ext4/libext4_balloc.c
r5d3d75a5 r9aa82e6 279 279 */ 280 280 static uint32_t ext4_balloc_get_first_data_block_in_group( 281 ext4_superblock_t *sb, ext4_block_group_ t *bg, uint32_t bgid)281 ext4_superblock_t *sb, ext4_block_group_ref_t *bg_ref) 282 282 { 283 283 uint32_t block_group_count = ext4_superblock_get_block_group_count(sb); 284 284 uint32_t inode_table_first_block = ext4_block_group_get_inode_table_first_block( 285 bg , sb);285 bg_ref->block_group, sb); 286 286 uint16_t inode_table_item_size = ext4_superblock_get_inode_size(sb); 287 287 uint32_t inodes_per_group = ext4_superblock_get_inodes_per_group(sb); … … 289 289 uint32_t inode_table_bytes; 290 290 291 if (bg id< block_group_count - 1) {291 if (bg_ref->index < block_group_count - 1) { 292 292 inode_table_bytes = inodes_per_group * inode_table_item_size; 293 293 } else { … … 428 428 /* Compute indexes */ 429 429 uint32_t first_in_group = 430 ext4_balloc_get_first_data_block_in_group(sb, 431 bg_ref->block_group, block_group); 430 ext4_balloc_get_first_data_block_in_group(sb, bg_ref); 432 431 433 432 uint32_t first_in_group_index = ext4_balloc_blockaddr2_index_in_group( … … 439 438 440 439 /* Load block with bitmap */ 441 bitmap_block_addr = ext4_block_group_get_block_bitmap(bg_ref->block_group, 442 sb); 443 444 rc = block_get(&bitmap_block, inode_ref->fs->device, bitmap_block_addr, 0); 440 bitmap_block_addr = ext4_block_group_get_block_bitmap( 441 bg_ref->block_group, sb); 442 443 rc = block_get(&bitmap_block, inode_ref->fs->device, 444 bitmap_block_addr, BLOCK_FLAGS_NONE); 445 445 if (rc != EOK) { 446 446 ext4_filesystem_put_block_group_ref(bg_ref); … … 554 554 /* Compute indexes */ 555 555 first_in_group = ext4_balloc_get_first_data_block_in_group( 556 sb, bg_ref ->block_group, bgid);556 sb, bg_ref); 557 557 index_in_group = ext4_balloc_blockaddr2_index_in_group(sb, 558 558 first_in_group);
Note:
See TracChangeset
for help on using the changeset viewer.