Lines Matching refs:group
106 ext4_group_t group) {
107 return (group >> EXT4_DESC_PER_BLOCK_BITS(sb)) <<
112 ext4_group_t group) {
113 group = ext4_meta_bg_first_group(sb, group);
114 return ext4_group_first_block_no(sb, group);
118 ext4_group_t group) {
120 overhead = ext4_bg_num_gdb(sb, group);
121 if (ext4_bg_has_super(sb, group))
137 ext4_group_t group = input->group;
145 if (group != sbi->s_groups_count) {
146 ext4_warning(sb, "Cannot add at group %u (only %u groups)",
147 input->group, sbi->s_groups_count);
151 overhead = ext4_group_overhead_blocks(sb, group);
157 printk(KERN_DEBUG "EXT4-fs: adding %s group %u: %u blocks "
159 ext4_bg_has_super(sb, input->group) ? "normal" :
160 "no-super", input->group, input->blocks_count,
165 ext4_warning(sb, "Last group not full");
178 ext4_warning(sb, "Block bitmap not in group (block %llu)",
181 ext4_warning(sb, "Inode bitmap not in group (block %llu)",
185 ext4_warning(sb, "Inode table not in group (blocks %llu-%llu)",
223 * group each time.
227 in the flex group */
228 __u16 *bg_flags; /* block group flags of groups
293 * and inode tables for a flex group.
296 * group tables from the 1st group of groups contained by @flexgd, which may
297 * be a partial of a flex group.
302 * block group.
315 ext4_group_t group;
323 src_group = group_data[0].group;
329 group = group_data[0].group;
330 if (src_group >= group_data[0].group + flex_gd->count)
333 last_blk = start_blk + group_data[src_group - group].blocks_count;
344 last_blk += group_data[src_group - group].blocks_count;
354 group = ext4_get_group_number(sb, start_blk - 1);
355 group -= group_data[0].group;
356 group_data[group].mdata_blocks++;
357 flex_gd->bg_flags[group] &= uninit_mask;
365 group = ext4_get_group_number(sb, start_blk - 1);
366 group -= group_data[0].group;
367 group_data[group].mdata_blocks++;
368 flex_gd->bg_flags[group] &= uninit_mask;
379 group = ext4_get_group_number(sb, start_blk);
380 next_group_start = ext4_group_first_block_no(sb, group + 1);
381 group -= group_data[0].group;
384 flex_gd->bg_flags[group + 1] &= uninit_mask;
386 group_data[group + 1].mdata_blocks += overhead;
390 group_data[group].mdata_blocks += itb;
391 flex_gd->bg_flags[group] &= uninit_mask;
404 group = group_data[0].group;
406 printk(KERN_DEBUG "EXT4-fs: adding a flex group with "
412 "adding %s group %u: %u blocks (%u free, %u mdata blocks)\n",
413 ext4_bg_has_super(sb, group + i) ? "normal" :
414 "no-super", group + i,
457 * @flex_gd: flex group data
473 ext4_group_t group;
476 group = ext4_get_group_number(sb, EXT4_C2B(sbi, first_cluster));
477 start = EXT4_B2C(sbi, ext4_group_first_block_no(sb, group));
478 group -= flex_gd->groups[0].group;
484 if (flex_gd->bg_flags[group] & EXT4_BG_BLOCK_UNINIT) {
493 bh = sb_getblk(sb, flex_gd->groups[group].block_bitmap);
523 * setup_new_flex_group_blocks handles a flex group as follow:
524 * 1. copy super block and GDT, and initialize group tables if necessary.
527 * 2. allocate group tables in block bitmaps, that is, set bits in block
528 * bitmap for blocks taken by group tables.
541 ext4_group_t group, count;
547 group_data[0].group != sbi->s_groups_count);
557 group = group_data[0].group;
558 for (i = 0; i < flex_gd->count; i++, group++) {
562 gdblocks = ext4_bg_num_gdb(sb, group);
563 start = ext4_group_first_block_no(sb, group);
565 if (meta_bg == 0 && !ext4_bg_has_super(sb, group))
571 block = start + ext4_bg_has_super(sb, group);
572 /* Copy all of the GDT blocks into the backup in this group */
576 ext4_debug("update backup group %#04llx\n", block);
605 /* Zero out all of the reserved backup group descriptor
608 if (ext4_bg_has_super(sb, group)) {
616 /* Initialize group tables of the grop @group */
633 /* Initialize block bitmap of the @group */
644 overhead = ext4_group_overhead_blocks(sb, group);
662 /* Initialize inode bitmap of the @group */
682 /* Mark group tables in block bitmap */
731 * For a non-sparse filesystem it will be every group: 1, 2, 3, 4, ...
763 * It is assumed that they are stored in group order. Returns the number of
797 * Called when we need to bring a reserved group descriptor table block into
801 * block, in group order. Even though we know all the block numbers we need,
810 ext4_group_t group)
814 unsigned long gdb_num = group / EXT4_DESC_PER_BLOCK(sb);
826 "EXT4-fs: ext4_add_new_gdb: adding group block %lu\n",
833 gdbackups = verify_reserved_gdb(sb, group, gdb_bh);
849 ext4_warning(sb, "new group %u GDT block %llu not reserved",
850 group, gdblock);
945 handle_t *handle, ext4_group_t group) {
949 unsigned long gdb_num = group / EXT4_DESC_PER_BLOCK(sb);
952 gdblock = ext4_meta_bg_first_block_no(sb, group) +
953 ext4_bg_has_super(sb, group);
989 * Called when we are adding a new group which has a backup copy of each of
990 * the GDT blocks (i.e. sparse group) and there are reserved GDT blocks.
1002 ext4_group_t group)
1049 gdbackups = verify_reserved_gdb(sb, group, primary[res]);
1070 * the new group to its reserved primary GDT block.
1072 blk = group * EXT4_BLOCKS_PER_GROUP(sb);
1106 * superblocks, and the location of the new group metadata in the GDT backups.
1124 ext4_group_t group = 0;
1131 group = 1;
1137 group = ext4_list_backups(sb, &three, &five, &seven);
1140 group = ext4_get_group_number(sb, blk_off) + 1;
1141 last = (ext4_group_t)(group + EXT4_DESC_PER_BLOCK(sb) - 2);
1144 while (group < sbi->s_groups_count) {
1154 backup_block = ((ext4_fsblk_t)group) * bpg + blk_off;
1156 backup_block = (ext4_group_first_block_no(sb, group) +
1157 ext4_bg_has_super(sb, group));
1166 ext4_group_first_block_no(sb, group));
1184 group = ext4_list_backups(sb, &three, &five, &seven);
1185 else if (group == last)
1188 group = last;
1205 ext4_warning(sb, "can't update backup for group %u (err %d), "
1206 "forcing fsck on next reboot", group, err);
1214 * ext4_add_new_descs() adds @count group descriptor of groups
1215 * starting at @group
1219 * @group: the group no. of the first group desc to be added
1221 * @count: number of group descriptors to be added
1224 ext4_group_t group, struct inode *resize_inode,
1234 for (i = 0; i < count; i++, group++) {
1235 int reserved_gdb = ext4_bg_has_super(sb, group) ?
1238 gdb_off = group % EXT4_DESC_PER_BLOCK(sb);
1239 gdb_num = group / EXT4_DESC_PER_BLOCK(sb);
1242 * We will only either add reserved group blocks to a backup group
1243 * or remove reserved blocks for the first group in a new group block.
1253 if (!err && reserved_gdb && ext4_bg_num_gdb(sb, group))
1254 err = reserve_backup_gdb(handle, resize_inode, group);
1256 err = add_new_gdb_meta_bg(sb, handle, group);
1258 err = add_new_gdb(handle, resize_inode, group);
1282 ext4_group_t group,
1294 ext4_inode_bitmap_csum_set(sb, group, gdp, bh,
1301 ext4_block_bitmap_csum_set(sb, group, gdp, bh);
1308 * ext4_setup_new_descs() will set up the group descriptor descriptors of a flex bg
1317 ext4_group_t group;
1323 group = group_data->group;
1325 gdb_off = group % EXT4_DESC_PER_BLOCK(sb);
1326 gdb_num = group / EXT4_DESC_PER_BLOCK(sb);
1332 /* Update group descriptor block for new group */
1339 err = ext4_set_bitmap_checksums(sb, group, gdp, group_data);
1353 ext4_group_desc_csum_set(sb, group, gdp);
1362 * We can allocate memory for mb_alloc based on the new group
1365 err = ext4_mb_add_groupinfo(sb, group, gdp);
1393 * increasing the group count so that once the group is enabled,
1396 * We always allocate group-by-group, then block-by-block or
1397 * inode-by-inode within a group, so enabling these
1398 * blocks/inodes before the group is live won't actually let us
1432 * NB. These rules can be relaxed when checking the group count
1434 * group after serialising against the group count, and we can
1445 /* Update the reserved block counts only once the new group is
1464 flex_group = ext4_flex_group(sbi, group_data[0].group);
1479 printk(KERN_DEBUG "EXT4-fs: added group %u:"
1484 /* Add a flex group to an fs. Ensure we handle all possible error conditions
1496 ext4_group_t group;
1505 ext4_get_group_no_and_offset(sb, o_blocks_count, &group, &last);
1513 * blocks. If we are adding a group past the last current GDT block,
1515 * are adding a group with superblock/GDT backups we will also
1533 group = flex_gd->groups[0].group;
1534 BUG_ON(group != sbi->s_groups_count);
1535 err = ext4_add_new_descs(handle, sb, group,
1554 int gdb_num = group / EXT4_DESC_PER_BLOCK(sb);
1555 int gdb_num_end = ((group + flex_gd->count - 1) /
1590 ext4_group_t group;
1603 ext4_get_group_no_and_offset(sb, o_blocks_count, &group, &last);
1607 last_group = group | (flex_gd->resize_bg - 1);
1611 flex_gd->count = last_group - group + 1;
1616 group_data[i].group = group + i;
1618 overhead = ext4_group_overhead_blocks(sb, group + i);
1631 /* We need to initialize block bitmap of last group. */
1643 /* Add group descriptor data to an existing or new group descriptor block.
1649 * Otherwise, we may need to add backup GDT blocks for a sparse group.
1652 * in the new group's counts to the superblock. Prior to that we have
1653 * not really "added" the group at all. We re-check that we are still
1654 * adding in the last group in case things have changed since verifying.
1661 int reserved_gdb = ext4_bg_has_super(sb, input->group) ?
1668 gdb_off = input->group % EXT4_DESC_PER_BLOCK(sb);
1706 err = ext4_alloc_flex_bg_array(sb, input->group + 1);
1710 err = ext4_mb_alloc_groupinfo(sb, input->group + 1);
1724 * extend a group without checking assuming that checking has been done.
1734 * one group descriptor via ext4_group_add_blocks().
1757 /* We add the blocks to the bitmap and set the group need init bit */
1771 printk(KERN_DEBUG "EXT4-fs: extended group to %llu "
1782 * existing group. It can be accessed via ioctl, or by "remount,resize=<size>"
1797 ext4_group_t group;
1803 "extending last group from %llu to %llu blocks",
1821 /* Handle the remaining blocks in the last group only. */
1822 ext4_get_group_no_and_offset(sb, o_blocks_count, &group, &last);
1840 ext4_warning(sb, "will only finish group (%llu blocks, %u new)",
2032 n_group--; /* set to last group number */
2060 * Make sure the last group has enough space so that it's
2063 * the inode table blocks in the last block group, but there
2079 /* extend the last group */
2107 /* Add flex groups. Note that a regular group is a
2108 * flex group with 1 group.