Lines Matching refs:super
110 fs->super->s_state |= EXT2_ERROR_FS; in resize_fs()
135 *new_size = ext2fs_blocks_count(rfs->new_fs->super); in resize_fs()
146 ext2fs_free_blocks_count(rfs->old_fs->super), in resize_fs()
147 ext2fs_free_blocks_count(rfs->new_fs->super), in resize_fs()
193 rfs->new_fs->super->s_state &= ~EXT2_ERROR_FS; in resize_fs()
232 if (!(EXT2_HAS_RO_COMPAT_FEATURE(fs->super, in fix_uninit_block_bitmaps()
283 (blk < ext2fs_blocks_count(fs->super))) { in free_gdp_blocks()
290 (blk < ext2fs_blocks_count(fs->super))) { in free_gdp_blocks()
297 (blk >= ext2fs_blocks_count(fs->super))) in free_gdp_blocks()
302 if (blk >= ext2fs_blocks_count(fs->super)) in free_gdp_blocks()
328 ext2fs_blocks_count_set(fs->super, new_size); in adjust_fs_info()
331 fs->group_desc_count = ext2fs_div64_ceil(ext2fs_blocks_count(fs->super) - in adjust_fs_info()
332 fs->super->s_first_data_block, in adjust_fs_info()
333 EXT2_BLOCKS_PER_GROUP(fs->super)); in adjust_fs_info()
337 EXT2_DESC_PER_BLOCK(fs->super)); in adjust_fs_info()
349 fs->super->s_reserved_gdt_blocks; in adjust_fs_info()
356 rem = (ext2fs_blocks_count(fs->super) - fs->super->s_first_data_block) % in adjust_fs_info()
357 fs->super->s_blocks_per_group; in adjust_fs_info()
361 ext2fs_blocks_count_set(fs->super, in adjust_fs_info()
362 ext2fs_blocks_count(fs->super) - rem); in adjust_fs_info()
368 new_inodes =(unsigned long long) fs->super->s_inodes_per_group * fs->group_desc_count; in adjust_fs_info()
374 fs->super->s_inodes_count = fs->super->s_inodes_per_group * in adjust_fs_info()
380 blk = ext2fs_blocks_count(old_fs->super); in adjust_fs_info()
381 if (blk > ext2fs_blocks_count(fs->super)) in adjust_fs_info()
382 ext2fs_free_blocks_count_set(fs->super, in adjust_fs_info()
383 ext2fs_free_blocks_count(fs->super) - in adjust_fs_info()
384 (blk - ext2fs_blocks_count(fs->super))); in adjust_fs_info()
386 ext2fs_free_blocks_count_set(fs->super, in adjust_fs_info()
387 ext2fs_free_blocks_count(fs->super) + in adjust_fs_info()
388 (ext2fs_blocks_count(fs->super) - blk)); in adjust_fs_info()
393 percent = (ext2fs_r_blocks_count(old_fs->super) * 100.0) / in adjust_fs_info()
394 ext2fs_blocks_count(old_fs->super); in adjust_fs_info()
395 ext2fs_r_blocks_count_set(fs->super, in adjust_fs_info()
396 (percent * ext2fs_blocks_count(fs->super) / in adjust_fs_info()
402 retval = ext2fs_resize_inode_bitmap2(fs->super->s_inodes_count, in adjust_fs_info()
403 fs->super->s_inodes_count, in adjust_fs_info()
407 real_end = (((blk64_t) EXT2_BLOCKS_PER_GROUP(fs->super) * in adjust_fs_info()
409 fs->super->s_first_data_block; in adjust_fs_info()
418 if (reserve_blocks && new_size > ext2fs_blocks_count(old_fs->super)) { in adjust_fs_info()
447 if ((fs->super->s_feature_compat & in adjust_fs_info()
452 new = ((int) fs->super->s_reserved_gdt_blocks) + in adjust_fs_info()
458 fs->super->s_reserved_gdt_blocks = new; in adjust_fs_info()
480 old_numblocks = (ext2fs_blocks_count(old_fs->super) - in adjust_fs_info()
481 old_fs->super->s_first_data_block) % in adjust_fs_info()
482 old_fs->super->s_blocks_per_group; in adjust_fs_info()
484 old_numblocks = old_fs->super->s_blocks_per_group; in adjust_fs_info()
486 numblocks = (ext2fs_blocks_count(fs->super) - in adjust_fs_info()
487 fs->super->s_first_data_block) % in adjust_fs_info()
488 fs->super->s_blocks_per_group; in adjust_fs_info()
490 numblocks = fs->super->s_blocks_per_group; in adjust_fs_info()
492 numblocks = fs->super->s_blocks_per_group; in adjust_fs_info()
512 csum_flag = EXT2_HAS_RO_COMPAT_FEATURE(fs->super, in adjust_fs_info()
516 if (fs->super->s_feature_incompat & EXT2_FEATURE_INCOMPAT_META_BG) in adjust_fs_info()
517 old_desc_blocks = fs->super->s_first_meta_bg; in adjust_fs_info()
520 fs->super->s_reserved_gdt_blocks; in adjust_fs_info()
543 fs->super->s_inodes_per_group); in adjust_fs_info()
555 meta_bg_size = EXT2_DESC_PER_BLOCK(fs->super); in adjust_fs_info()
557 if (!(fs->super->s_feature_incompat & in adjust_fs_info()
559 (meta_bg < fs->super->s_first_meta_bg)) { in adjust_fs_info()
579 ext2fs_free_blocks_count_set(fs->super, in adjust_fs_info()
580 ext2fs_free_blocks_count(fs->super) - adjblocks); in adjust_fs_info()
581 fs->super->s_free_inodes_count += in adjust_fs_info()
582 fs->super->s_inodes_per_group; in adjust_fs_info()
585 fs->super->s_inodes_per_group); in adjust_fs_info()
592 group_block += fs->super->s_blocks_per_group; in adjust_fs_info()
641 if ((rfs->old_fs->super->s_inodes_count - in adjust_superblock()
642 rfs->old_fs->super->s_free_inodes_count) > in adjust_superblock()
643 rfs->new_fs->super->s_inodes_count) { in adjust_superblock()
673 EXT2_HAS_RO_COMPAT_FEATURE(fs->super, in adjust_superblock()
716 group_block += fs->super->s_blocks_per_group; in adjust_superblock()
809 if (fs->super->s_feature_incompat & EXT4_FEATURE_INCOMPAT_FLEX_BG) { in mark_fs_metablock()
830 if (EXT2_HAS_RO_COMPAT_FEATURE(fs->super, in mark_fs_metablock()
866 if (ext2fs_blocks_count(old_fs->super) > ext2fs_blocks_count(fs->super)) in blocks_to_move()
891 new_size = ext2fs_blocks_count(fs->super); in blocks_to_move()
892 if (new_size < ext2fs_blocks_count(old_fs->super)) { in blocks_to_move()
925 for (blk = ext2fs_blocks_count(fs->super); in blocks_to_move()
926 blk < ext2fs_blocks_count(old_fs->super); blk++) { in blocks_to_move()
928 if (EXT2_HAS_RO_COMPAT_FEATURE(fs->super, in blocks_to_move()
946 if (fs->super->s_feature_incompat & EXT2_FEATURE_INCOMPAT_META_BG) { in blocks_to_move()
947 old_blocks = old_fs->super->s_first_meta_bg; in blocks_to_move()
948 new_blocks = fs->super->s_first_meta_bg; in blocks_to_move()
950 old_blocks = old_fs->desc_blocks + old_fs->super->s_reserved_gdt_blocks; in blocks_to_move()
951 new_blocks = fs->desc_blocks + fs->super->s_reserved_gdt_blocks; in blocks_to_move()
962 group_blk = old_fs->super->s_first_data_block; in blocks_to_move()
971 group_blk += fs->super->s_blocks_per_group; in blocks_to_move()
979 group_blk += fs->super->s_blocks_per_group; in blocks_to_move()
988 meta_bg_size = EXT2_DESC_PER_BLOCK(fs->super); in blocks_to_move()
989 flex_bg = fs->super->s_feature_incompat & in blocks_to_move()
998 if (!(fs->super->s_feature_incompat & in blocks_to_move()
1000 (meta_bg < fs->super->s_first_meta_bg)) { in blocks_to_move()
1050 group_blk += rfs->new_fs->super->s_blocks_per_group; in blocks_to_move()
1149 rfs->new_blk = rfs->new_fs->super->s_first_data_block; in init_block_alloc()
1152 if (ext2fs_blocks_count(rfs->new_fs->super) > in init_block_alloc()
1153 ext2fs_blocks_count(rfs->old_fs->super)) in init_block_alloc()
1154 rfs->new_blk = ext2fs_blocks_count(rfs->old_fs->super); in init_block_alloc()
1163 if (rfs->new_blk >= ext2fs_blocks_count(fs->super)) { in get_new_block()
1173 rfs->new_blk = fs->super->s_first_data_block; in get_new_block()
1180 (rfs->new_blk < ext2fs_blocks_count(rfs->old_fs->super)) && in get_new_block()
1230 new_blk = fs->super->s_first_data_block; in block_mover()
1248 for (blk = B2C(old_fs->super->s_first_data_block); in block_mover()
1249 blk < ext2fs_blocks_count(old_fs->super); in block_mover()
1462 orig_size = ext2fs_blocks_count(rfs->old_fs->super); in inode_scan_and_fix()
1463 if (orig_size < ext2fs_blocks_count(rfs->new_fs->super)) in inode_scan_and_fix()
1464 ext2fs_blocks_count_set(rfs->old_fs->super, in inode_scan_and_fix()
1465 ext2fs_blocks_count(rfs->new_fs->super)); in inode_scan_and_fix()
1476 rfs->new_fs->super->s_inodes_per_group); in inode_scan_and_fix()
1488 new_inode = EXT2_FIRST_INODE(rfs->new_fs->super); in inode_scan_and_fix()
1489 inode_size = EXT2_INODE_SIZE(rfs->new_fs->super); in inode_scan_and_fix()
1574 ext2fs_blocks_count_set(rfs->old_fs->super, orig_size); in inode_scan_and_fix()
1787 n = n >> EXT2_BLOCK_SIZE_BITS(fs->super); in move_itables()
1850 if (!(fs->super->s_feature_compat & in fix_resize_inode()
1914 if (fs->super->s_feature_incompat & EXT2_FEATURE_INCOMPAT_META_BG) in ext2fs_calculate_summary_stats()
1915 old_desc_blocks = fs->super->s_first_meta_bg; in ext2fs_calculate_summary_stats()
1918 fs->super->s_reserved_gdt_blocks; in ext2fs_calculate_summary_stats()
1919 for (blk = B2C(fs->super->s_first_data_block); in ext2fs_calculate_summary_stats()
1920 blk < ext2fs_blocks_count(fs->super); in ext2fs_calculate_summary_stats()
1938 if ((count == fs->super->s_clusters_per_group) || in ext2fs_calculate_summary_stats()
1939 EQ_CLSTR(blk, ext2fs_blocks_count(fs->super)-1)) { in ext2fs_calculate_summary_stats()
1951 if (fs->super->s_feature_incompat & in ext2fs_calculate_summary_stats()
1953 old_desc_blocks = fs->super->s_first_meta_bg; in ext2fs_calculate_summary_stats()
1956 fs->super->s_reserved_gdt_blocks; in ext2fs_calculate_summary_stats()
1960 ext2fs_free_blocks_count_set(fs->super, total_blocks_free); in ext2fs_calculate_summary_stats()
1971 for (ino = 1; ino <= fs->super->s_inodes_count && ino > 0; ino++) { in ext2fs_calculate_summary_stats()
1978 if ((count == fs->super->s_inodes_per_group) || in ext2fs_calculate_summary_stats()
1979 (ino == fs->super->s_inodes_count)) { in ext2fs_calculate_summary_stats()
1990 fs->super->s_free_inodes_count = total_inodes_free; in ext2fs_calculate_summary_stats()
2004 if (!(fs->super->s_feature_compat & EXT3_FEATURE_COMPAT_HAS_JOURNAL)) in fix_sb_journal_backup()
2008 if (fs->super->s_journal_dev && !fs->super->s_journal_inum) in fix_sb_journal_backup()
2011 retval = ext2fs_read_inode(fs, fs->super->s_journal_inum, &inode); in fix_sb_journal_backup()
2014 memcpy(fs->super->s_jnl_blocks, inode.i_block, EXT2_N_BLOCKS*4); in fix_sb_journal_backup()
2015 fs->super->s_jnl_blocks[15] = inode.i_size_high; in fix_sb_journal_backup()
2016 fs->super->s_jnl_blocks[16] = inode.i_size; in fix_sb_journal_backup()
2017 fs->super->s_jnl_backup_type = EXT3_JNL_BACKUP_BLOCKS; in fix_sb_journal_backup()
2055 int flexbg_size = 1 << fs->super->s_log_groups_per_flex; in calculate_minimum_resize_size()
2061 inode_count = fs->super->s_inodes_count - in calculate_minimum_resize_size()
2062 fs->super->s_free_inodes_count; in calculate_minimum_resize_size()
2064 fs->super->s_inodes_per_group) * in calculate_minimum_resize_size()
2065 EXT2_BLOCKS_PER_GROUP(fs->super); in calculate_minimum_resize_size()
2067 EXT2_BLOCKS_PER_GROUP(fs->super)); in calculate_minimum_resize_size()
2077 if (fs->super->s_feature_incompat & EXT2_FEATURE_INCOMPAT_META_BG) in calculate_minimum_resize_size()
2078 old_desc_blocks = fs->super->s_first_meta_bg; in calculate_minimum_resize_size()
2081 fs->super->s_reserved_gdt_blocks; in calculate_minimum_resize_size()
2084 data_needed = ext2fs_blocks_count(fs->super) - in calculate_minimum_resize_size()
2085 ext2fs_free_blocks_count(fs->super); in calculate_minimum_resize_size()
2099 if (fs->super->s_feature_incompat & EXT4_FEATURE_INCOMPAT_FLEX_BG) { in calculate_minimum_resize_size()
2109 data_blocks = groups * EXT2_BLOCKS_PER_GROUP(fs->super); in calculate_minimum_resize_size()
2120 last_start += EXT2_BLOCKS_PER_GROUP(fs->super) - in calculate_minimum_resize_size()
2141 EXT2_BLOCKS_PER_GROUP(fs->super)); in calculate_minimum_resize_size()
2143 data_blocks += extra_grps * EXT2_BLOCKS_PER_GROUP(fs->super); in calculate_minimum_resize_size()
2147 last_start += EXT2_BLOCKS_PER_GROUP(fs->super) - overhead; in calculate_minimum_resize_size()
2158 last_start += EXT2_BLOCKS_PER_GROUP(fs->super) in calculate_minimum_resize_size()
2166 if (fs->super->s_feature_incompat in calculate_minimum_resize_size()
2222 overhead += fs->super->s_first_data_block; in calculate_minimum_resize_size()
2233 blks_needed = (groups-1) * EXT2_BLOCKS_PER_GROUP(fs->super); in calculate_minimum_resize_size()
2254 if (blks_needed >= ext2fs_blocks_count(fs->super)) in calculate_minimum_resize_size()
2255 return ext2fs_blocks_count(fs->super); in calculate_minimum_resize_size()
2261 if (fs->super->s_feature_incompat & EXT3_FEATURE_INCOMPAT_EXTENTS) { in calculate_minimum_resize_size()
2262 blk64_t safe_margin = (ext2fs_blocks_count(fs->super) - in calculate_minimum_resize_size()