Lines Matching refs:bgroup
240 struct ext2_bgroup *bg = &fs->bgroup; in ext2_fetch_block_group()
370 rc = ext2_fetch_bg_itable(&fs->bgroup, block_index); in get_itable_entry()
388 struct ext2_disk_inode *dino = &BGROUP_INODE_TABLE(&fs->bgroup)[itable_offset]; in ext2_fetch_inode()
792 struct ext2_bgroup *bg = &fs->bgroup; in ext2_commit_bg()
828 struct ext2_disk_inode *dino = &BGROUP_INODE_TABLE(&fs->bgroup)[itable_offset]; in ext2_commit_inode()
833 return ext2_write_block(fs, fs->bgroup.inode_table); in ext2_commit_inode()
863 memset(&BGROUP_INODE_TABLE(&fs->bgroup)[itable_offset], 0, sizeof(struct ext2_disk_inode)); in ext2_clear_inode()
864 ret = ext2_write_block(fs, fs->bgroup.inode_table); in ext2_clear_inode()
879 LOG_DBG("Free blocks: %d", fs->bgroup.bg_free_blocks_count); in ext2_alloc_block()
880 while ((rc >= 0) && (fs->bgroup.bg_free_blocks_count == 0)) { in ext2_alloc_block()
892 rc = ext2_fetch_bg_bbitmap(&fs->bgroup); in ext2_alloc_block()
897 bitmap_slot = ext2_bitmap_find_free(BGROUP_BLOCK_BITMAP(&fs->bgroup), fs->block_size); in ext2_alloc_block()
908 rc = ext2_bitmap_set(BGROUP_BLOCK_BITMAP(&fs->bgroup), bitmap_slot, fs->block_size); in ext2_alloc_block()
913 fs->bgroup.bg_free_blocks_count -= 1; in ext2_alloc_block()
916 set = ext2_bitmap_count_set(BGROUP_BLOCK_BITMAP(&fs->bgroup), fs->sblock.s_blocks_count); in ext2_alloc_block()
933 rc = ext2_write_block(fs, fs->bgroup.block_bitmap); in ext2_alloc_block()
949 uint8_t *bytes = (uint8_t *)&BGROUP_INODE_TABLE(&fs->bgroup)[itable_offset]; in check_zero_inode()
967 while (fs->bgroup.bg_free_inodes_count == 0 && rc >= 0) { in ext2_alloc_inode()
980 LOG_DBG("Free inodes (bg): %d", fs->bgroup.bg_free_inodes_count); in ext2_alloc_inode()
983 rc = ext2_fetch_bg_ibitmap(&fs->bgroup); in ext2_alloc_inode()
988 r = ext2_bitmap_find_free(BGROUP_INODE_BITMAP(&fs->bgroup), fs->block_size); in ext2_alloc_inode()
1005 rc = ext2_bitmap_set(BGROUP_INODE_BITMAP(&fs->bgroup), r, fs->block_size); in ext2_alloc_inode()
1010 fs->bgroup.bg_free_inodes_count -= 1; in ext2_alloc_inode()
1013 set = ext2_bitmap_count_set(BGROUP_INODE_BITMAP(&fs->bgroup), fs->sblock.s_inodes_count); in ext2_alloc_inode()
1030 rc = ext2_write_block(fs, fs->bgroup.inode_bitmap); in ext2_alloc_inode()
1036 LOG_DBG("Free inodes (bg): %d", fs->bgroup.bg_free_inodes_count); in ext2_alloc_inode()
1059 rc = ext2_fetch_bg_bbitmap(&fs->bgroup); in ext2_free_block()
1064 rc = ext2_bitmap_unset(BGROUP_BLOCK_BITMAP(&fs->bgroup), off, fs->block_size); in ext2_free_block()
1069 fs->bgroup.bg_free_blocks_count += 1; in ext2_free_block()
1072 set = ext2_bitmap_count_set(BGROUP_BLOCK_BITMAP(&fs->bgroup), fs->sblock.s_blocks_count); in ext2_free_block()
1089 rc = ext2_write_block(fs, fs->bgroup.block_bitmap); in ext2_free_block()
1111 rc = ext2_fetch_bg_ibitmap(&fs->bgroup); in ext2_free_inode()
1116 rc = ext2_bitmap_unset(BGROUP_INODE_BITMAP(&fs->bgroup), bitmap_off, fs->block_size); in ext2_free_inode()
1126 fs->bgroup.bg_free_inodes_count += 1; in ext2_free_inode()
1130 fs->bgroup.bg_used_dirs_count -= 1; in ext2_free_inode()
1133 set = ext2_bitmap_count_set(BGROUP_INODE_BITMAP(&fs->bgroup), fs->sblock.s_inodes_count); in ext2_free_inode()
1152 rc = ext2_write_block(fs, fs->bgroup.inode_bitmap); in ext2_free_inode()