Lines Matching full:group
91 ext4_group_t group) { in ext4_meta_bg_first_group() argument
92 return (group >> EXT4_DESC_PER_BLOCK_BITS(sb)) << in ext4_meta_bg_first_group()
97 ext4_group_t group) { in ext4_meta_bg_first_block_no() argument
98 group = ext4_meta_bg_first_group(sb, group); in ext4_meta_bg_first_block_no()
99 return ext4_group_first_block_no(sb, group); in ext4_meta_bg_first_block_no()
103 ext4_group_t group) { in ext4_group_overhead_blocks() argument
105 overhead = ext4_bg_num_gdb(sb, group); in ext4_group_overhead_blocks()
106 if (ext4_bg_has_super(sb, group)) in ext4_group_overhead_blocks()
122 ext4_group_t group = input->group; in verify_group_input() local
130 if (group != sbi->s_groups_count) { in verify_group_input()
131 ext4_warning(sb, "Cannot add at group %u (only %u groups)", in verify_group_input()
132 input->group, sbi->s_groups_count); in verify_group_input()
136 overhead = ext4_group_overhead_blocks(sb, group); in verify_group_input()
142 printk(KERN_DEBUG "EXT4-fs: adding %s group %u: %u blocks " in verify_group_input()
144 ext4_bg_has_super(sb, input->group) ? "normal" : in verify_group_input()
145 "no-super", input->group, input->blocks_count, in verify_group_input()
150 ext4_warning(sb, "Last group not full"); in verify_group_input()
163 ext4_warning(sb, "Block bitmap not in group (block %llu)", in verify_group_input()
166 ext4_warning(sb, "Inode bitmap not in group (block %llu)", in verify_group_input()
170 ext4_warning(sb, "Inode table not in group (blocks %llu-%llu)", in verify_group_input()
208 * group each time.
212 in the flex group */
213 __u16 *bg_flags; /* block group flags of groups
267 * and inode tables for a flex group.
270 * group tables from the 1st group of groups contained by @flexgd, which may
271 * be a partial of a flex group.
276 * block group.
289 ext4_group_t group; in ext4_alloc_group_tables() local
297 src_group = group_data[0].group; in ext4_alloc_group_tables()
303 group = group_data[0].group; in ext4_alloc_group_tables()
304 if (src_group >= group_data[0].group + flex_gd->count) in ext4_alloc_group_tables()
307 last_blk = start_blk + group_data[src_group - group].blocks_count; in ext4_alloc_group_tables()
318 last_blk += group_data[src_group - group].blocks_count; in ext4_alloc_group_tables()
328 group = ext4_get_group_number(sb, start_blk - 1); in ext4_alloc_group_tables()
329 group -= group_data[0].group; in ext4_alloc_group_tables()
330 group_data[group].mdata_blocks++; in ext4_alloc_group_tables()
331 flex_gd->bg_flags[group] &= uninit_mask; in ext4_alloc_group_tables()
339 group = ext4_get_group_number(sb, start_blk - 1); in ext4_alloc_group_tables()
340 group -= group_data[0].group; in ext4_alloc_group_tables()
341 group_data[group].mdata_blocks++; in ext4_alloc_group_tables()
342 flex_gd->bg_flags[group] &= uninit_mask; in ext4_alloc_group_tables()
353 group = ext4_get_group_number(sb, start_blk); in ext4_alloc_group_tables()
354 next_group_start = ext4_group_first_block_no(sb, group + 1); in ext4_alloc_group_tables()
355 group -= group_data[0].group; in ext4_alloc_group_tables()
358 flex_gd->bg_flags[group + 1] &= uninit_mask; in ext4_alloc_group_tables()
360 group_data[group + 1].mdata_blocks += overhead; in ext4_alloc_group_tables()
364 group_data[group].mdata_blocks += itb; in ext4_alloc_group_tables()
365 flex_gd->bg_flags[group] &= uninit_mask; in ext4_alloc_group_tables()
378 group = group_data[0].group; in ext4_alloc_group_tables()
380 printk(KERN_DEBUG "EXT4-fs: adding a flex group with " in ext4_alloc_group_tables()
386 "adding %s group %u: %u blocks (%d free, %d mdata blocks)\n", in ext4_alloc_group_tables()
387 ext4_bg_has_super(sb, group + i) ? "normal" : in ext4_alloc_group_tables()
388 "no-super", group + i, in ext4_alloc_group_tables()
431 * @flex_gd: flex group data
447 ext4_group_t group; in set_flexbg_block_bitmap() local
450 group = ext4_get_group_number(sb, EXT4_C2B(sbi, first_cluster)); in set_flexbg_block_bitmap()
451 start = EXT4_B2C(sbi, ext4_group_first_block_no(sb, group)); in set_flexbg_block_bitmap()
452 group -= flex_gd->groups[0].group; in set_flexbg_block_bitmap()
458 if (flex_gd->bg_flags[group] & EXT4_BG_BLOCK_UNINIT) { in set_flexbg_block_bitmap()
467 bh = sb_getblk(sb, flex_gd->groups[group].block_bitmap); in set_flexbg_block_bitmap()
497 * setup_new_flex_group_blocks handles a flex group as follow:
498 * 1. copy super block and GDT, and initialize group tables if necessary.
501 * 2. allocate group tables in block bitmaps, that is, set bits in block
502 * bitmap for blocks taken by group tables.
515 ext4_group_t group, count; in setup_new_flex_group_blocks() local
521 group_data[0].group != sbi->s_groups_count); in setup_new_flex_group_blocks()
531 group = group_data[0].group; in setup_new_flex_group_blocks()
532 for (i = 0; i < flex_gd->count; i++, group++) { in setup_new_flex_group_blocks()
536 gdblocks = ext4_bg_num_gdb(sb, group); in setup_new_flex_group_blocks()
537 start = ext4_group_first_block_no(sb, group); in setup_new_flex_group_blocks()
539 if (meta_bg == 0 && !ext4_bg_has_super(sb, group)) in setup_new_flex_group_blocks()
544 first_group = ext4_meta_bg_first_group(sb, group); in setup_new_flex_group_blocks()
545 if (first_group != group + 1 && in setup_new_flex_group_blocks()
546 first_group != group + EXT4_DESC_PER_BLOCK(sb) - 1) in setup_new_flex_group_blocks()
550 block = start + ext4_bg_has_super(sb, group); in setup_new_flex_group_blocks()
551 /* Copy all of the GDT blocks into the backup in this group */ in setup_new_flex_group_blocks()
555 ext4_debug("update backup group %#04llx\n", block); in setup_new_flex_group_blocks()
584 /* Zero out all of the reserved backup group descriptor in setup_new_flex_group_blocks()
587 if (ext4_bg_has_super(sb, group)) { in setup_new_flex_group_blocks()
595 /* Initialize group tables of the grop @group */ in setup_new_flex_group_blocks()
612 /* Initialize block bitmap of the @group */ in setup_new_flex_group_blocks()
623 overhead = ext4_group_overhead_blocks(sb, group); in setup_new_flex_group_blocks()
641 /* Initialize inode bitmap of the @group */ in setup_new_flex_group_blocks()
661 /* Mark group tables in block bitmap */ in setup_new_flex_group_blocks()
710 * For a non-sparse filesystem it will be every group: 1, 2, 3, 4, ...
742 * It is assumed that they are stored in group order. Returns the number of
776 * Called when we need to bring a reserved group descriptor table block into
780 * block, in group order. Even though we know all the block numbers we need,
789 ext4_group_t group) in add_new_gdb() argument
793 unsigned long gdb_num = group / EXT4_DESC_PER_BLOCK(sb); in add_new_gdb()
805 "EXT4-fs: ext4_add_new_gdb: adding group block %lu\n", in add_new_gdb()
812 gdbackups = verify_reserved_gdb(sb, group, gdb_bh); in add_new_gdb()
828 ext4_warning(sb, "new group %u GDT block %llu not reserved", in add_new_gdb()
829 group, gdblock); in add_new_gdb()
921 handle_t *handle, ext4_group_t group) { in add_new_gdb_meta_bg() argument
925 unsigned long gdb_num = group / EXT4_DESC_PER_BLOCK(sb); in add_new_gdb_meta_bg()
928 gdblock = ext4_meta_bg_first_block_no(sb, group) + in add_new_gdb_meta_bg()
929 ext4_bg_has_super(sb, group); in add_new_gdb_meta_bg()
965 * Called when we are adding a new group which has a backup copy of each of
966 * the GDT blocks (i.e. sparse group) and there are reserved GDT blocks.
978 ext4_group_t group) in reserve_backup_gdb() argument
1025 gdbackups = verify_reserved_gdb(sb, group, primary[res]); in reserve_backup_gdb()
1046 * the new group to its reserved primary GDT block. in reserve_backup_gdb()
1048 blk = group * EXT4_BLOCKS_PER_GROUP(sb); in reserve_backup_gdb()
1082 * superblocks, and the location of the new group metadata in the GDT backups.
1100 ext4_group_t group = 0; in update_backups() local
1107 group = 1; in update_backups()
1113 group = ext4_list_backups(sb, &three, &five, &seven); in update_backups()
1116 group = ext4_get_group_number(sb, blk_off) + 1; in update_backups()
1117 last = (ext4_group_t)(group + EXT4_DESC_PER_BLOCK(sb) - 2); in update_backups()
1120 while (group < sbi->s_groups_count) { in update_backups()
1130 backup_block = ((ext4_fsblk_t)group) * bpg + blk_off; in update_backups()
1132 backup_block = (ext4_group_first_block_no(sb, group) + in update_backups()
1133 ext4_bg_has_super(sb, group)); in update_backups()
1142 ext4_group_first_block_no(sb, group)); in update_backups()
1160 group = ext4_list_backups(sb, &three, &five, &seven); in update_backups()
1161 else if (group == last) in update_backups()
1164 group = last; in update_backups()
1181 ext4_warning(sb, "can't update backup for group %u (err %d), " in update_backups()
1182 "forcing fsck on next reboot", group, err); in update_backups()
1190 * ext4_add_new_descs() adds @count group descriptor of groups
1191 * starting at @group
1195 * @group: the group no. of the first group desc to be added
1197 * @count: number of group descriptors to be added
1200 ext4_group_t group, struct inode *resize_inode, in ext4_add_new_descs() argument
1210 for (i = 0; i < count; i++, group++) { in ext4_add_new_descs()
1211 int reserved_gdb = ext4_bg_has_super(sb, group) ? in ext4_add_new_descs()
1214 gdb_off = group % EXT4_DESC_PER_BLOCK(sb); in ext4_add_new_descs()
1215 gdb_num = group / EXT4_DESC_PER_BLOCK(sb); in ext4_add_new_descs()
1218 * We will only either add reserved group blocks to a backup group in ext4_add_new_descs()
1219 * or remove reserved blocks for the first group in a new group block. in ext4_add_new_descs()
1229 if (!err && reserved_gdb && ext4_bg_num_gdb(sb, group)) in ext4_add_new_descs()
1230 err = reserve_backup_gdb(handle, resize_inode, group); in ext4_add_new_descs()
1232 err = add_new_gdb_meta_bg(sb, handle, group); in ext4_add_new_descs()
1234 err = add_new_gdb(handle, resize_inode, group); in ext4_add_new_descs()
1258 ext4_group_t group, in ext4_set_bitmap_checksums() argument
1270 ext4_inode_bitmap_csum_set(sb, group, gdp, bh, in ext4_set_bitmap_checksums()
1277 ext4_block_bitmap_csum_set(sb, group, gdp, bh); in ext4_set_bitmap_checksums()
1284 * ext4_setup_new_descs() will set up the group descriptor descriptors of a flex bg
1293 ext4_group_t group; in ext4_setup_new_descs() local
1299 group = group_data->group; in ext4_setup_new_descs()
1301 gdb_off = group % EXT4_DESC_PER_BLOCK(sb); in ext4_setup_new_descs()
1302 gdb_num = group / EXT4_DESC_PER_BLOCK(sb); in ext4_setup_new_descs()
1308 /* Update group descriptor block for new group */ in ext4_setup_new_descs()
1315 err = ext4_set_bitmap_checksums(sb, group, gdp, group_data); in ext4_setup_new_descs()
1329 ext4_group_desc_csum_set(sb, group, gdp); in ext4_setup_new_descs()
1338 * We can allocate memory for mb_alloc based on the new group in ext4_setup_new_descs()
1341 err = ext4_mb_add_groupinfo(sb, group, gdp); in ext4_setup_new_descs()
1369 * increasing the group count so that once the group is enabled, in ext4_update_super()
1372 * We always allocate group-by-group, then block-by-block or in ext4_update_super()
1373 * inode-by-inode within a group, so enabling these in ext4_update_super()
1374 * blocks/inodes before the group is live won't actually let us in ext4_update_super()
1407 * NB. These rules can be relaxed when checking the group count in ext4_update_super()
1409 * group after serialising against the group count, and we can in ext4_update_super()
1420 /* Update the reserved block counts only once the new group is in ext4_update_super()
1437 flex_group = ext4_flex_group(sbi, group_data[0].group); in ext4_update_super()
1451 printk(KERN_DEBUG "EXT4-fs: added group %u:" in ext4_update_super()
1456 /* Add a flex group to an fs. Ensure we handle all possible error conditions
1468 ext4_group_t group; in ext4_flex_group_add() local
1477 ext4_get_group_no_and_offset(sb, o_blocks_count, &group, &last); in ext4_flex_group_add()
1485 * blocks. If we are adding a group past the last current GDT block, in ext4_flex_group_add()
1487 * are adding a group with superblock/GDT backups we will also in ext4_flex_group_add()
1505 group = flex_gd->groups[0].group; in ext4_flex_group_add()
1506 BUG_ON(group != sbi->s_groups_count); in ext4_flex_group_add()
1507 err = ext4_add_new_descs(handle, sb, group, in ext4_flex_group_add()
1526 int gdb_num = group / EXT4_DESC_PER_BLOCK(sb); in ext4_flex_group_add()
1527 int gdb_num_end = ((group + flex_gd->count - 1) / in ext4_flex_group_add()
1560 ext4_group_t group; in ext4_setup_next_flex_gd() local
1573 ext4_get_group_no_and_offset(sb, o_blocks_count, &group, &last); in ext4_setup_next_flex_gd()
1577 last_group = group | (flexbg_size - 1); in ext4_setup_next_flex_gd()
1581 flex_gd->count = last_group - group + 1; in ext4_setup_next_flex_gd()
1586 group_data[i].group = group + i; in ext4_setup_next_flex_gd()
1588 overhead = ext4_group_overhead_blocks(sb, group + i); in ext4_setup_next_flex_gd()
1601 /* We need to initialize block bitmap of last group. */ in ext4_setup_next_flex_gd()
1613 /* Add group descriptor data to an existing or new group descriptor block.
1619 * Otherwise, we may need to add backup GDT blocks for a sparse group.
1622 * in the new group's counts to the superblock. Prior to that we have
1623 * not really "added" the group at all. We re-check that we are still
1624 * adding in the last group in case things have changed since verifying.
1631 int reserved_gdb = ext4_bg_has_super(sb, input->group) ? in ext4_group_add()
1638 gdb_off = input->group % EXT4_DESC_PER_BLOCK(sb); in ext4_group_add()
1676 err = ext4_alloc_flex_bg_array(sb, input->group + 1); in ext4_group_add()
1680 err = ext4_mb_alloc_groupinfo(sb, input->group + 1); in ext4_group_add()
1694 * extend a group without checking assuming that checking has been done.
1704 * one group descriptor via ext4_group_add_blocks(). in ext4_group_extend_no_check()
1724 /* We add the blocks to the bitmap and set the group need init bit */ in ext4_group_extend_no_check()
1738 printk(KERN_DEBUG "EXT4-fs: extended group to %llu " in ext4_group_extend_no_check()
1749 * existing group. It can be accessed via ioctl, or by "remount,resize=<size>"
1764 ext4_group_t group; in ext4_group_extend() local
1770 "extending last group from %llu to %llu blocks", in ext4_group_extend()
1788 /* Handle the remaining blocks in the last group only. */ in ext4_group_extend()
1789 ext4_get_group_no_and_offset(sb, o_blocks_count, &group, &last); in ext4_group_extend()
1807 ext4_warning(sb, "will only finish group (%llu blocks, %u new)", in ext4_group_extend()
1987 n_group--; /* set to last group number */ in ext4_resize_fs()
2015 * Make sure the last group has enough space so that it's in ext4_resize_fs()
2018 * the inode table blocks in the last block group, but there in ext4_resize_fs()
2034 /* extend the last group */ in ext4_resize_fs()
2062 /* Add flex groups. Note that a regular group is a in ext4_resize_fs()
2063 * flex group with 1 group. in ext4_resize_fs()