• Home
  • Raw
  • Download

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()
924 handle_t *handle, ext4_group_t group) { in add_new_gdb_meta_bg() argument
928 unsigned long gdb_num = group / EXT4_DESC_PER_BLOCK(sb); in add_new_gdb_meta_bg()
931 gdblock = ext4_meta_bg_first_block_no(sb, group) + in add_new_gdb_meta_bg()
932 ext4_bg_has_super(sb, group); in add_new_gdb_meta_bg()
968 * Called when we are adding a new group which has a backup copy of each of
969 * the GDT blocks (i.e. sparse group) and there are reserved GDT blocks.
981 ext4_group_t group) in reserve_backup_gdb() argument
1028 gdbackups = verify_reserved_gdb(sb, group, primary[res]); in reserve_backup_gdb()
1049 * the new group to its reserved primary GDT block. in reserve_backup_gdb()
1051 blk = group * EXT4_BLOCKS_PER_GROUP(sb); in reserve_backup_gdb()
1085 * superblocks, and the location of the new group metadata in the GDT backups.
1103 ext4_group_t group = 0; in update_backups() local
1110 group = 1; in update_backups()
1116 group = ext4_list_backups(sb, &three, &five, &seven); in update_backups()
1119 group = ext4_get_group_number(sb, blk_off) + 1; in update_backups()
1120 last = (ext4_group_t)(group + EXT4_DESC_PER_BLOCK(sb) - 2); in update_backups()
1123 while (group < sbi->s_groups_count) { in update_backups()
1133 backup_block = ((ext4_fsblk_t)group) * bpg + blk_off; in update_backups()
1135 backup_block = (ext4_group_first_block_no(sb, group) + in update_backups()
1136 ext4_bg_has_super(sb, group)); in update_backups()
1145 ext4_group_first_block_no(sb, group)); in update_backups()
1163 group = ext4_list_backups(sb, &three, &five, &seven); in update_backups()
1164 else if (group == last) in update_backups()
1167 group = last; in update_backups()
1184 ext4_warning(sb, "can't update backup for group %u (err %d), " in update_backups()
1185 "forcing fsck on next reboot", group, err); in update_backups()
1193 * ext4_add_new_descs() adds @count group descriptor of groups
1194 * starting at @group
1198 * @group: the group no. of the first group desc to be added
1200 * @count: number of group descriptors to be added
1203 ext4_group_t group, struct inode *resize_inode, in ext4_add_new_descs() argument
1213 for (i = 0; i < count; i++, group++) { in ext4_add_new_descs()
1214 int reserved_gdb = ext4_bg_has_super(sb, group) ? in ext4_add_new_descs()
1217 gdb_off = group % EXT4_DESC_PER_BLOCK(sb); in ext4_add_new_descs()
1218 gdb_num = group / EXT4_DESC_PER_BLOCK(sb); in ext4_add_new_descs()
1221 * We will only either add reserved group blocks to a backup group in ext4_add_new_descs()
1222 * or remove reserved blocks for the first group in a new group block. in ext4_add_new_descs()
1232 if (!err && reserved_gdb && ext4_bg_num_gdb(sb, group)) in ext4_add_new_descs()
1233 err = reserve_backup_gdb(handle, resize_inode, group); in ext4_add_new_descs()
1235 err = add_new_gdb_meta_bg(sb, handle, group); in ext4_add_new_descs()
1237 err = add_new_gdb(handle, resize_inode, group); in ext4_add_new_descs()
1261 ext4_group_t group, in ext4_set_bitmap_checksums() argument
1273 ext4_inode_bitmap_csum_set(sb, group, gdp, bh, in ext4_set_bitmap_checksums()
1280 ext4_block_bitmap_csum_set(sb, group, gdp, bh); in ext4_set_bitmap_checksums()
1287 * ext4_setup_new_descs() will set up the group descriptor descriptors of a flex bg
1296 ext4_group_t group; in ext4_setup_new_descs() local
1302 group = group_data->group; in ext4_setup_new_descs()
1304 gdb_off = group % EXT4_DESC_PER_BLOCK(sb); in ext4_setup_new_descs()
1305 gdb_num = group / EXT4_DESC_PER_BLOCK(sb); in ext4_setup_new_descs()
1311 /* Update group descriptor block for new group */ in ext4_setup_new_descs()
1318 err = ext4_set_bitmap_checksums(sb, group, gdp, group_data); in ext4_setup_new_descs()
1332 ext4_group_desc_csum_set(sb, group, gdp); in ext4_setup_new_descs()
1341 * We can allocate memory for mb_alloc based on the new group in ext4_setup_new_descs()
1344 err = ext4_mb_add_groupinfo(sb, group, gdp); in ext4_setup_new_descs()
1372 * increasing the group count so that once the group is enabled, in ext4_update_super()
1375 * We always allocate group-by-group, then block-by-block or in ext4_update_super()
1376 * inode-by-inode within a group, so enabling these in ext4_update_super()
1377 * blocks/inodes before the group is live won't actually let us in ext4_update_super()
1411 * NB. These rules can be relaxed when checking the group count in ext4_update_super()
1413 * group after serialising against the group count, and we can in ext4_update_super()
1424 /* Update the reserved block counts only once the new group is in ext4_update_super()
1443 flex_group = ext4_flex_group(sbi, group_data[0].group); in ext4_update_super()
1457 printk(KERN_DEBUG "EXT4-fs: added group %u:" in ext4_update_super()
1462 /* Add a flex group to an fs. Ensure we handle all possible error conditions
1474 ext4_group_t group; in ext4_flex_group_add() local
1483 ext4_get_group_no_and_offset(sb, o_blocks_count, &group, &last); in ext4_flex_group_add()
1491 * blocks. If we are adding a group past the last current GDT block, in ext4_flex_group_add()
1493 * are adding a group with superblock/GDT backups we will also in ext4_flex_group_add()
1511 group = flex_gd->groups[0].group; in ext4_flex_group_add()
1512 BUG_ON(group != sbi->s_groups_count); in ext4_flex_group_add()
1513 err = ext4_add_new_descs(handle, sb, group, in ext4_flex_group_add()
1532 int gdb_num = group / EXT4_DESC_PER_BLOCK(sb); in ext4_flex_group_add()
1533 int gdb_num_end = ((group + flex_gd->count - 1) / in ext4_flex_group_add()
1566 ext4_group_t group; in ext4_setup_next_flex_gd() local
1579 ext4_get_group_no_and_offset(sb, o_blocks_count, &group, &last); in ext4_setup_next_flex_gd()
1583 last_group = group | (flexbg_size - 1); in ext4_setup_next_flex_gd()
1587 flex_gd->count = last_group - group + 1; in ext4_setup_next_flex_gd()
1592 group_data[i].group = group + i; in ext4_setup_next_flex_gd()
1594 overhead = ext4_group_overhead_blocks(sb, group + i); in ext4_setup_next_flex_gd()
1607 /* We need to initialize block bitmap of last group. */ in ext4_setup_next_flex_gd()
1619 /* Add group descriptor data to an existing or new group descriptor block.
1625 * Otherwise, we may need to add backup GDT blocks for a sparse group.
1628 * in the new group's counts to the superblock. Prior to that we have
1629 * not really "added" the group at all. We re-check that we are still
1630 * adding in the last group in case things have changed since verifying.
1637 int reserved_gdb = ext4_bg_has_super(sb, input->group) ? in ext4_group_add()
1644 gdb_off = input->group % EXT4_DESC_PER_BLOCK(sb); in ext4_group_add()
1682 err = ext4_alloc_flex_bg_array(sb, input->group + 1); in ext4_group_add()
1686 err = ext4_mb_alloc_groupinfo(sb, input->group + 1); in ext4_group_add()
1700 * extend a group without checking assuming that checking has been done.
1710 * one group descriptor via ext4_group_add_blocks(). in ext4_group_extend_no_check()
1733 /* We add the blocks to the bitmap and set the group need init bit */ in ext4_group_extend_no_check()
1747 printk(KERN_DEBUG "EXT4-fs: extended group to %llu " in ext4_group_extend_no_check()
1758 * existing group. It can be accessed via ioctl, or by "remount,resize=<size>"
1773 ext4_group_t group; in ext4_group_extend() local
1779 "extending last group from %llu to %llu blocks", in ext4_group_extend()
1797 /* Handle the remaining blocks in the last group only. */ in ext4_group_extend()
1798 ext4_get_group_no_and_offset(sb, o_blocks_count, &group, &last); in ext4_group_extend()
1816 ext4_warning(sb, "will only finish group (%llu blocks, %u new)", in ext4_group_extend()
1999 n_group--; /* set to last group number */ in ext4_resize_fs()
2027 * Make sure the last group has enough space so that it's in ext4_resize_fs()
2030 * the inode table blocks in the last block group, but there in ext4_resize_fs()
2046 /* extend the last group */ in ext4_resize_fs()
2074 /* Add flex groups. Note that a regular group is a in ext4_resize_fs()
2075 * flex group with 1 group. in ext4_resize_fs()