Lines Matching refs:group

110 					     ext4_group_t group) {
111 return (group >> EXT4_DESC_PER_BLOCK_BITS(sb)) <<
116 ext4_group_t group) {
117 group = ext4_meta_bg_first_group(sb, group);
118 return ext4_group_first_block_no(sb, group);
122 ext4_group_t group) {
124 overhead = ext4_bg_num_gdb(sb, group);
125 if (ext4_bg_has_super(sb, group))
141 ext4_group_t group = input->group;
149 if (group != sbi->s_groups_count) {
150 ext4_warning(sb, "Cannot add at group %u (only %u groups)",
151 input->group, sbi->s_groups_count);
155 overhead = ext4_group_overhead_blocks(sb, group);
161 printk(KERN_DEBUG "EXT4-fs: adding %s group %u: %u blocks "
163 ext4_bg_has_super(sb, input->group) ? "normal" :
164 "no-super", input->group, input->blocks_count,
169 ext4_warning(sb, "Last group not full");
182 ext4_warning(sb, "Block bitmap not in group (block %llu)",
185 ext4_warning(sb, "Inode bitmap not in group (block %llu)",
189 ext4_warning(sb, "Inode table not in group (blocks %llu-%llu)",
227 * group each time.
231 in the flex group */
232 __u16 *bg_flags; /* block group flags of groups
294 * and inode tables for a flex group.
297 * group tables from the 1st group of groups contained by @flexgd, which may
298 * be a partial of a flex group.
303 * block group.
316 ext4_group_t group;
324 src_group = group_data[0].group;
330 group = group_data[0].group;
331 if (src_group >= group_data[0].group + flex_gd->count)
334 last_blk = start_blk + group_data[src_group - group].blocks_count;
345 last_blk += group_data[src_group - group].blocks_count;
355 group = ext4_get_group_number(sb, start_blk - 1);
356 group -= group_data[0].group;
357 group_data[group].mdata_blocks++;
358 flex_gd->bg_flags[group] &= uninit_mask;
366 group = ext4_get_group_number(sb, start_blk - 1);
367 group -= group_data[0].group;
368 group_data[group].mdata_blocks++;
369 flex_gd->bg_flags[group] &= uninit_mask;
380 group = ext4_get_group_number(sb, start_blk);
381 next_group_start = ext4_group_first_block_no(sb, group + 1);
382 group -= group_data[0].group;
385 flex_gd->bg_flags[group + 1] &= uninit_mask;
387 group_data[group + 1].mdata_blocks += overhead;
391 group_data[group].mdata_blocks += itb;
392 flex_gd->bg_flags[group] &= uninit_mask;
405 group = group_data[0].group;
407 printk(KERN_DEBUG "EXT4-fs: adding a flex group with "
413 "adding %s group %u: %u blocks (%u free, %u mdata blocks)\n",
414 ext4_bg_has_super(sb, group + i) ? "normal" :
415 "no-super", group + i,
459 * @flex_gd: flex group data
475 ext4_group_t group;
478 group = ext4_get_group_number(sb, EXT4_C2B(sbi, first_cluster));
479 start = EXT4_B2C(sbi, ext4_group_first_block_no(sb, group));
480 group -= flex_gd->groups[0].group;
486 if (flex_gd->bg_flags[group] & EXT4_BG_BLOCK_UNINIT) {
495 bh = sb_getblk(sb, flex_gd->groups[group].block_bitmap);
526 * setup_new_flex_group_blocks handles a flex group as follow:
527 * 1. copy super block and GDT, and initialize group tables if necessary.
530 * 2. allocate group tables in block bitmaps, that is, set bits in block
531 * bitmap for blocks taken by group tables.
544 ext4_group_t group, count;
550 group_data[0].group != sbi->s_groups_count);
560 group = group_data[0].group;
561 for (i = 0; i < flex_gd->count; i++, group++) {
565 gdblocks = ext4_bg_num_gdb(sb, group);
566 start = ext4_group_first_block_no(sb, group);
568 if (meta_bg == 0 && !ext4_bg_has_super(sb, group))
574 block = start + ext4_bg_has_super(sb, group);
575 /* Copy all of the GDT blocks into the backup in this group */
579 ext4_debug("update backup group %#04llx\n", block);
609 /* Zero out all of the reserved backup group descriptor
612 if (ext4_bg_has_super(sb, group)) {
620 /* Initialize group tables of the grop @group */
637 /* Initialize block bitmap of the @group */
648 overhead = ext4_group_overhead_blocks(sb, group);
666 /* Initialize inode bitmap of the @group */
686 /* Mark group tables in block bitmap */
735 * For a non-sparse filesystem it will be every group: 1, 2, 3, 4, ...
778 * It is assumed that they are stored in group order. Returns the number of
812 * Called when we need to bring a reserved group descriptor table block into
816 * block, in group order. Even though we know all the block numbers we need,
825 ext4_group_t group)
829 unsigned long gdb_num = group / EXT4_DESC_PER_BLOCK(sb);
841 "EXT4-fs: ext4_add_new_gdb: adding group block %lu\n",
848 gdbackups = verify_reserved_gdb(sb, group, gdb_bh);
864 ext4_warning(sb, "new group %u GDT block %llu not reserved",
865 group, gdblock);
961 handle_t *handle, ext4_group_t group) {
965 unsigned long gdb_num = group / EXT4_DESC_PER_BLOCK(sb);
968 gdblock = ext4_meta_bg_first_block_no(sb, group) +
969 ext4_bg_has_super(sb, group);
1005 * Called when we are adding a new group which has a backup copy of each of
1006 * the GDT blocks (i.e. sparse group) and there are reserved GDT blocks.
1018 ext4_group_t group)
1065 gdbackups = verify_reserved_gdb(sb, group, primary[res]);
1087 * the new group to its reserved primary GDT block.
1089 blk = group * EXT4_BLOCKS_PER_GROUP(sb);
1117 ext4_group_t group)
1121 es->s_block_group_nr = cpu_to_le16(group);
1133 * superblocks, and the location of the new group metadata in the GDT backups.
1151 ext4_group_t group = 0;
1158 group = 1;
1164 group = ext4_list_backups(sb, &three, &five, &seven);
1167 group = ext4_get_group_number(sb, blk_off) + 1;
1168 last = (ext4_group_t)(group + EXT4_DESC_PER_BLOCK(sb) - 2);
1171 while (group < sbi->s_groups_count) {
1174 int has_super = ext4_bg_has_super(sb, group);
1175 ext4_fsblk_t first_block = ext4_group_first_block_no(sb, group);
1183 backup_block = ((ext4_fsblk_t)group) * bpg + blk_off;
1194 ext4_group_first_block_no(sb, group));
1206 ext4_set_block_group_nr(sb, bh->b_data, group);
1215 group = ext4_list_backups(sb, &three, &five, &seven);
1216 else if (group == last)
1219 group = last;
1236 ext4_warning(sb, "can't update backup for group %u (err %d), "
1237 "forcing fsck on next reboot", group, err);
1245 * ext4_add_new_descs() adds @count group descriptor of groups
1246 * starting at @group
1250 * @group: the group no. of the first group desc to be added
1252 * @count: number of group descriptors to be added
1255 ext4_group_t group, struct inode *resize_inode,
1265 for (i = 0; i < count; i++, group++) {
1266 int reserved_gdb = ext4_bg_has_super(sb, group) ?
1269 gdb_off = group % EXT4_DESC_PER_BLOCK(sb);
1270 gdb_num = group / EXT4_DESC_PER_BLOCK(sb);
1273 * We will only either add reserved group blocks to a backup group
1274 * or remove reserved blocks for the first group in a new group block.
1285 if (!err && reserved_gdb && ext4_bg_num_gdb(sb, group))
1286 err = reserve_backup_gdb(handle, resize_inode, group);
1288 err = add_new_gdb_meta_bg(sb, handle, group);
1290 err = add_new_gdb(handle, resize_inode, group);
1339 * ext4_setup_new_descs() will set up the group descriptor descriptors of a flex bg
1348 ext4_group_t group;
1354 group = group_data->group;
1356 gdb_off = group % EXT4_DESC_PER_BLOCK(sb);
1357 gdb_num = group / EXT4_DESC_PER_BLOCK(sb);
1363 /* Update group descriptor block for new group */
1384 ext4_group_desc_csum_set(sb, group, gdp);
1393 * We can allocate memory for mb_alloc based on the new group
1396 err = ext4_mb_add_groupinfo(sb, group, gdp);
1435 * increasing the group count so that once the group is enabled,
1438 * We always allocate group-by-group, then block-by-block or
1439 * inode-by-inode within a group, so enabling these
1440 * blocks/inodes before the group is live won't actually let us
1474 * NB. These rules can be relaxed when checking the group count
1476 * group after serialising against the group count, and we can
1487 /* Update the reserved block counts only once the new group is
1504 flex_group = ext4_flex_group(sbi, group_data[0].group);
1529 printk(KERN_DEBUG "EXT4-fs: added group %u:"
1534 /* Add a flex group to an fs. Ensure we handle all possible error conditions
1546 ext4_group_t group;
1555 ext4_get_group_no_and_offset(sb, o_blocks_count, &group, &last);
1563 * blocks. If we are adding a group past the last current GDT block,
1565 * are adding a group with superblock/GDT backups we will also
1584 group = flex_gd->groups[0].group;
1585 BUG_ON(group != sbi->s_groups_count);
1586 err = ext4_add_new_descs(handle, sb, group,
1605 int gdb_num = group / EXT4_DESC_PER_BLOCK(sb);
1606 int gdb_num_end = ((group + flex_gd->count - 1) /
1641 ext4_group_t group;
1654 ext4_get_group_no_and_offset(sb, o_blocks_count, &group, &last);
1658 last_group = group | (flex_gd->resize_bg - 1);
1662 flex_gd->count = last_group - group + 1;
1667 group_data[i].group = group + i;
1669 overhead = ext4_group_overhead_blocks(sb, group + i);
1682 /* We need to initialize block bitmap of last group. */
1694 /* Add group descriptor data to an existing or new group descriptor block.
1700 * Otherwise, we may need to add backup GDT blocks for a sparse group.
1703 * in the new group's counts to the superblock. Prior to that we have
1704 * not really "added" the group at all. We re-check that we are still
1705 * adding in the last group in case things have changed since verifying.
1712 int reserved_gdb = ext4_bg_has_super(sb, input->group) ?
1719 gdb_off = input->group % EXT4_DESC_PER_BLOCK(sb);
1757 err = ext4_alloc_flex_bg_array(sb, input->group + 1);
1761 err = ext4_mb_alloc_groupinfo(sb, input->group + 1);
1775 * extend a group without checking assuming that checking has been done.
1785 * one group descriptor via ext4_group_add_blocks().
1809 /* We add the blocks to the bitmap and set the group need init bit */
1823 printk(KERN_DEBUG "EXT4-fs: extended group to %llu "
1834 * existing group. It can be accessed via ioctl, or by "remount,resize=<size>"
1848 ext4_group_t group;
1854 "extending last group from %llu to %llu blocks",
1872 /* Handle the remaining blocks in the last group only. */
1873 ext4_get_group_no_and_offset(sb, o_blocks_count, &group, &last);
1891 ext4_warning(sb, "will only finish group (%llu blocks, %u new)",
2083 n_group--; /* set to last group number */
2111 * Make sure the last group has enough space so that it's
2114 * the inode table blocks in the last block group, but there
2130 /* extend the last group */
2158 /* Add flex groups. Note that a regular group is a
2159 * flex group with 1 group.