Lines Matching refs:bg

86 static void fill_bgroup(struct ext2_bgroup *bg, struct ext2_disk_bgroup *disk_bg)  in fill_bgroup()  argument
88 bg->bg_block_bitmap = sys_le32_to_cpu(disk_bg->bg_block_bitmap); in fill_bgroup()
89 bg->bg_inode_bitmap = sys_le32_to_cpu(disk_bg->bg_inode_bitmap); in fill_bgroup()
90 bg->bg_inode_table = sys_le32_to_cpu(disk_bg->bg_inode_table); in fill_bgroup()
91 bg->bg_free_blocks_count = sys_le16_to_cpu(disk_bg->bg_free_blocks_count); in fill_bgroup()
92 bg->bg_free_inodes_count = sys_le16_to_cpu(disk_bg->bg_free_inodes_count); in fill_bgroup()
93 bg->bg_used_dirs_count = sys_le16_to_cpu(disk_bg->bg_used_dirs_count); in fill_bgroup()
96 static void fill_disk_bgroup(struct ext2_disk_bgroup *disk_bg, struct ext2_bgroup *bg) in fill_disk_bgroup() argument
98 disk_bg->bg_block_bitmap = sys_cpu_to_le32(bg->bg_block_bitmap); in fill_disk_bgroup()
99 disk_bg->bg_inode_bitmap = sys_cpu_to_le32(bg->bg_inode_bitmap); in fill_disk_bgroup()
100 disk_bg->bg_inode_table = sys_cpu_to_le32(bg->bg_inode_table); in fill_disk_bgroup()
101 disk_bg->bg_free_blocks_count = sys_cpu_to_le16(bg->bg_free_blocks_count); in fill_disk_bgroup()
102 disk_bg->bg_free_inodes_count = sys_cpu_to_le16(bg->bg_free_inodes_count); in fill_disk_bgroup()
103 disk_bg->bg_used_dirs_count = sys_cpu_to_le16(bg->bg_used_dirs_count); in fill_disk_bgroup()
240 struct ext2_bgroup *bg = &fs->bgroup; in ext2_fetch_block_group() local
243 if (group == bg->num) { in ext2_fetch_block_group()
250 LOG_DBG("cur_group:%d fetch_group:%d", bg->num, group); in ext2_fetch_block_group()
269 fill_bgroup(bg, disk_bg); in ext2_fetch_block_group()
275 ext2_drop_block(bg->inode_table); in ext2_fetch_block_group()
276 ext2_drop_block(bg->inode_bitmap); in ext2_fetch_block_group()
277 ext2_drop_block(bg->block_bitmap); in ext2_fetch_block_group()
278 bg->inode_table = bg->inode_bitmap = bg->block_bitmap = NULL; in ext2_fetch_block_group()
280 bg->fs = fs; in ext2_fetch_block_group()
281 bg->num = group; in ext2_fetch_block_group()
284 group, bg->bg_inode_table, in ext2_fetch_block_group()
285 bg->bg_free_blocks_count, in ext2_fetch_block_group()
286 bg->bg_free_inodes_count, in ext2_fetch_block_group()
287 bg->bg_used_dirs_count, in ext2_fetch_block_group()
288 bg->bg_block_bitmap, in ext2_fetch_block_group()
289 bg->bg_inode_bitmap); in ext2_fetch_block_group()
293 int ext2_fetch_bg_itable(struct ext2_bgroup *bg, uint32_t block) in ext2_fetch_bg_itable() argument
295 if (bg->inode_table && bg->inode_table_block == block) { in ext2_fetch_bg_itable()
299 struct ext2_data *fs = bg->fs; in ext2_fetch_bg_itable()
300 uint32_t global_block = bg->bg_inode_table + block; in ext2_fetch_bg_itable()
302 ext2_drop_block(bg->inode_table); in ext2_fetch_bg_itable()
303 bg->inode_table = ext2_get_block(fs, global_block); in ext2_fetch_bg_itable()
304 if (bg->inode_table == NULL) { in ext2_fetch_bg_itable()
308 bg->inode_table_block = block; in ext2_fetch_bg_itable()
312 int ext2_fetch_bg_ibitmap(struct ext2_bgroup *bg) in ext2_fetch_bg_ibitmap() argument
314 if (bg->inode_bitmap) { in ext2_fetch_bg_ibitmap()
318 struct ext2_data *fs = bg->fs; in ext2_fetch_bg_ibitmap()
319 uint32_t global_block = bg->bg_inode_bitmap; in ext2_fetch_bg_ibitmap()
321 bg->inode_bitmap = ext2_get_block(fs, global_block); in ext2_fetch_bg_ibitmap()
322 if (bg->inode_bitmap == NULL) { in ext2_fetch_bg_ibitmap()
328 int ext2_fetch_bg_bbitmap(struct ext2_bgroup *bg) in ext2_fetch_bg_bbitmap() argument
330 if (bg->block_bitmap) { in ext2_fetch_bg_bbitmap()
334 struct ext2_data *fs = bg->fs; in ext2_fetch_bg_bbitmap()
335 uint32_t global_block = bg->bg_block_bitmap; in ext2_fetch_bg_bbitmap()
337 bg->block_bitmap = ext2_get_block(fs, global_block); in ext2_fetch_bg_bbitmap()
338 if (bg->block_bitmap == NULL) { in ext2_fetch_bg_bbitmap()
792 struct ext2_bgroup *bg = &fs->bgroup; in ext2_commit_bg() local
795 uint32_t block = bg->num / groups_per_block; in ext2_commit_bg()
796 uint32_t offset = bg->num % groups_per_block; in ext2_commit_bg()
807 fill_disk_bgroup(disk_bg, bg); in ext2_commit_bg()