Lines Matching defs:flex_gd

242 	struct ext4_new_flex_group_data *flex_gd;
244 flex_gd = kmalloc(sizeof(*flex_gd), GFP_NOFS);
245 if (flex_gd == NULL)
249 flex_gd->resize_bg = MAX_RESIZE_BG;
251 flex_gd->resize_bg = flexbg_size;
254 last_group = o_group | (flex_gd->resize_bg - 1);
256 flex_gd->resize_bg = 1 << fls(n_group - o_group + 1);
257 else if (n_group - last_group < flex_gd->resize_bg)
258 flex_gd->resize_bg = 1 << max(fls(last_group - o_group + 1),
261 flex_gd->groups = kmalloc_array(flex_gd->resize_bg,
264 if (flex_gd->groups == NULL)
267 flex_gd->bg_flags = kmalloc_array(flex_gd->resize_bg, sizeof(__u16),
269 if (flex_gd->bg_flags == NULL)
272 return flex_gd;
275 kfree(flex_gd->groups);
277 kfree(flex_gd);
282 static void free_flex_gd(struct ext4_new_flex_group_data *flex_gd)
284 kfree(flex_gd->bg_flags);
285 kfree(flex_gd->groups);
286 kfree(flex_gd);
303 struct ext4_new_flex_group_data *flex_gd,
306 struct ext4_new_group_data *group_data = flex_gd->groups;
319 BUG_ON(flex_gd->count == 0 || group_data == NULL);
322 last_group = src_group + flex_gd->count - 1;
328 if (src_group >= group_data[0].group + flex_gd->count)
348 for (; bb_index < flex_gd->count; bb_index++) {
355 flex_gd->bg_flags[group] &= uninit_mask;
359 for (; ib_index < flex_gd->count; ib_index++) {
366 flex_gd->bg_flags[group] &= uninit_mask;
370 for (; it_index < flex_gd->count; it_index++) {
382 flex_gd->bg_flags[group + 1] &= uninit_mask;
389 flex_gd->bg_flags[group] &= uninit_mask;
394 for (i = 0; i < flex_gd->count; i++) {
405 "%u groups, flexbg size is %u:\n", flex_gd->count,
408 for (i = 0; i < flex_gd->count; i++) {
456 * @flex_gd: flex group data
459 struct ext4_new_flex_group_data *flex_gd,
476 group -= flex_gd->groups[0].group;
482 if (flex_gd->bg_flags[group] & EXT4_BG_BLOCK_UNINIT) {
483 BUG_ON(flex_gd->count > 1);
491 bh = sb_getblk(sb, flex_gd->groups[group].block_bitmap);
530 struct ext4_new_flex_group_data *flex_gd)
537 struct ext4_new_group_data *group_data = flex_gd->groups;
538 __u16 *bg_flags = flex_gd->bg_flags;
545 BUG_ON(!flex_gd->count || !group_data ||
557 for (i = 0; i < flex_gd->count; i++, group++) {
687 for (i = 1; i < flex_gd->count; i++) {
694 flex_gd,
707 flex_gd,
1338 struct ext4_new_flex_group_data *flex_gd)
1340 struct ext4_new_group_data *group_data = flex_gd->groups;
1345 __u16 *bg_flags = flex_gd->bg_flags;
1349 for (i = 0; i < flex_gd->count; i++, group_data++, bg_flags++) {
1415 * @flex_gd: new added groups
1418 struct ext4_new_flex_group_data *flex_gd)
1423 struct ext4_new_group_data *group_data = flex_gd->groups;
1428 BUG_ON(flex_gd->count == 0 || group_data == NULL);
1439 for (i = 0; i < flex_gd->count; i++) {
1453 flex_gd->count);
1455 flex_gd->count);
1479 sbi->s_groups_count += flex_gd->count;
1492 EXT4_INODES_PER_GROUP(sb) * flex_gd->count);
1504 atomic_add(EXT4_INODES_PER_GROUP(sb) * flex_gd->count,
1526 "%llu blocks(%llu free %llu reserved)\n", flex_gd->count,
1536 struct ext4_new_flex_group_data *flex_gd)
1547 BUG_ON(!flex_gd->count || !flex_gd->groups || !flex_gd->bg_flags);
1554 err = setup_new_flex_group_blocks(sb, flex_gd);
1566 credit += 1 + DIV_ROUND_UP(flex_gd->count, EXT4_DESC_PER_BLOCK(sb));
1580 group = flex_gd->groups[0].group;
1583 resize_inode, flex_gd->count);
1587 err = ext4_setup_new_descs(handle, sb, flex_gd);
1591 ext4_update_super(sb, flex_gd);
1602 int gdb_num_end = ((group + flex_gd->count - 1) /
1625 struct ext4_new_flex_group_data *flex_gd,
1630 struct ext4_new_group_data *group_data = flex_gd->groups;
1650 last_group = group | (flex_gd->resize_bg - 1);
1654 flex_gd->count = last_group - group + 1;
1656 for (i = 0; i < flex_gd->count; i++) {
1665 flex_gd->bg_flags[i] = EXT4_BG_BLOCK_UNINIT |
1668 flex_gd->bg_flags[i] |= EXT4_BG_INODE_ZEROED;
1670 flex_gd->bg_flags[i] = EXT4_BG_INODE_ZEROED;
1675 flex_gd->bg_flags[i - 1] &= ~EXT4_BG_BLOCK_UNINIT;
1701 struct ext4_new_flex_group_data flex_gd;
1757 flex_gd.count = 1;
1758 flex_gd.groups = input;
1759 flex_gd.bg_flags = &bg_flags;
1760 err = ext4_flex_group_add(sb, inode, &flex_gd);
1997 struct ext4_new_flex_group_data *flex_gd = NULL;
2144 flex_gd = alloc_flex_gd(flexbg_size, o_group, n_group);
2145 if (flex_gd == NULL) {
2153 while (ext4_setup_next_flex_gd(sb, flex_gd, n_blocks_count)) {
2161 if (ext4_alloc_group_tables(sb, flex_gd, flexbg_size) != 0)
2163 err = ext4_flex_group_add(sb, resize_inode, flex_gd);
2171 free_flex_gd(flex_gd);
2172 flex_gd = NULL;
2181 if (flex_gd)
2182 free_flex_gd(flex_gd);