Home | History | Annotate | Download | only in resize

Lines Matching refs:fs

43 static void fix_uninit_block_bitmaps(ext2_filsys fs);
50 static errcode_t fix_resize_inode(ext2_filsys fs);
51 static errcode_t ext2fs_calculate_summary_stats(ext2_filsys fs);
52 static errcode_t fix_sb_journal_backup(ext2_filsys fs);
57 #define FS_BLOCK_BM(fs, i) ((fs)->group_desc[(i)].bg_block_bitmap)
58 #define FS_INODE_BM(fs, i) ((fs)->group_desc[(i)].bg_inode_bitmap)
59 #define FS_INODE_TB(fs, i) ((fs)->group_desc[(i)].bg_inode_table)
61 #define IS_BLOCK_BM(fs, i, blk) ((blk) == FS_BLOCK_BM((fs),(i)))
62 #define IS_INODE_BM(fs, i, blk) ((blk) == FS_INODE_BM((fs),(i)))
64 #define IS_INODE_TB(fs, i, blk) (((blk) >= FS_INODE_TB((fs), (i))) && \
65 ((blk) < (FS_INODE_TB((fs), (i)) + \
66 (fs)->inode_blocks_per_group)))
68 #define META_OVERHEAD(fs) (2 + (fs)->inode_blocks_per_group)
69 #define SUPER_OVERHEAD(fs) (1 + (fs)->desc_blocks +\
70 (fs)->super->s_reserved_gdt_blocks)
75 errcode_t resize_fs(ext2_filsys fs, blk_t *new_size, int flags,
83 retval = ext2fs_read_bitmaps(fs);
87 fs->super->s_state |= EXT2_ERROR_FS;
88 ext2fs_mark_super_dirty(fs);
89 ext2fs_flush(fs);
99 fix_uninit_block_bitmaps(fs);
100 fs->priv_data = rfs;
101 rfs->old_fs = fs;
105 retval = ext2fs_dup_handle(fs, &rfs->new_fs);
191 static void fix_uninit_block_bitmaps(ext2_filsys fs)
197 if (!(EXT2_HAS_RO_COMPAT_FEATURE(fs->super,
201 for (g=0; g < fs->group_desc_count; g++) {
202 if (!(fs->group_desc[g].bg_flags & EXT2_BG_BLOCK_UNINIT))
205 blk = (g * fs->super->s_blocks_per_group) +
206 fs->super->s_first_data_block;
208 ext2fs_super_and_bgd_loc(fs, g, &super_blk,
211 if (fs->super->s_feature_incompat & EXT2_FEATURE_INCOMPAT_META_BG)
212 old_desc_blocks = fs->super->s_first_meta_bg;
214 old_desc_blocks = fs->desc_blocks +
215 fs->super->s_reserved_gdt_blocks;
217 for (i=0; i < fs->super->s_blocks_per_group; i++, blk++) {
218 if (blk >= fs->super->s_blocks_count)
225 (blk == fs->group_desc[g].bg_block_bitmap) ||
226 (blk == fs->group_desc[g].bg_inode_bitmap) ||
227 (blk >= fs->group_desc[g].bg_inode_table &&
228 (blk < fs->group_desc[g].bg_inode_table
229 + fs->inode_blocks_per_group)))
230 ext2fs_fast_mark_block_bitmap(fs->block_map, blk);
232 ext2fs_fast_unmark_block_bitmap(fs->block_map, blk);
253 static void free_gdp_blocks(ext2_filsys fs,
261 (gdp->bg_block_bitmap < fs->super->s_blocks_count)) {
262 ext2fs_block_alloc_stats(fs, gdp->bg_block_bitmap, -1);
268 (gdp->bg_inode_bitmap < fs->super->s_blocks_count)) {
269 ext2fs_block_alloc_stats(fs, gdp->bg_inode_bitmap, -1);
275 (gdp->bg_inode_table >= fs->super->s_blocks_count))
279 j < fs->inode_blocks_per_group; j++, blk++) {
280 if (blk >= fs->super->s_blocks_count)
282 ext2fs_block_alloc_stats(fs, blk, -1);
294 errcode_t adjust_fs_info(ext2_filsys fs, ext2_filsys old_fs,
309 fs->super->s_blocks_count = new_size;
312 fs->group_desc_count = ext2fs_div_ceil(fs->super->s_blocks_count -
313 fs->super->s_first_data_block,
314 EXT2_BLOCKS_PER_GROUP(fs->super));
315 if (fs->group_desc_count == 0)
317 fs->desc_blocks = ext2fs_div_ceil(fs->group_desc_count,
318 EXT2_DESC_PER_BLOCK(fs->super));
326 overhead = (int) (2 + fs->inode_blocks_per_group);
328 if (ext2fs_bg_has_super(fs, fs->group_desc_count - 1))
329 overhead += 1 + fs->desc_blocks +
330 fs->super->s_reserved_gdt_blocks;
337 rem = (fs->super->s_blocks_count - fs->super->s_first_data_block) %
338 fs->super->s_blocks_per_group;
339 if ((fs->group_desc_count == 1) && rem && (rem < overhead))
342 fs->super->s_blocks_count -= rem;
348 new_inodes =(unsigned long long) fs->super->s_inodes_per_group * fs->group_desc_count;
354 fs->super->s_inodes_count = fs->super->s_inodes_per_group *
355 fs->group_desc_count;
361 if (blk > fs->super->s_blocks_count)
362 fs->super->s_free_blocks_count -=
363 (blk - fs->super->s_blocks_count);
365 fs->super->s_free_blocks_count +=
366 (fs->super->s_blocks_count - blk);
373 fs->super->s_r_blocks_count = (unsigned int) (percent *
374 fs->super->s_blocks_count / 100.0);
379 retval = ext2fs_resize_inode_bitmap(fs->super->s_inodes_count,
380 fs->super->s_inodes_count,
381 fs->inode_map);
384 real_end = ((EXT2_BLOCKS_PER_GROUP(fs->super)
385 * fs->group_desc_count)) - 1 +
386 fs->super->s_first_data_block;
387 retval = ext2fs_resize_block_bitmap(fs->super->s_blocks_count-1,
388 real_end, fs->block_map);
395 if (old_fs->desc_blocks != fs->desc_blocks) {
397 fs->blocksize,
398 fs->desc_blocks * fs->blocksize,
399 &fs->group_desc);
402 if (fs->desc_blocks > old_fs->desc_blocks)
403 memset((char *) fs->group_desc +
404 (old_fs->desc_blocks * fs->blocksize), 0,
405 (fs->desc_blocks - old_fs->desc_blocks) *
406 fs->blocksize);
415 if ((fs->super->s_feature_compat &
417 (old_fs->desc_blocks != fs->desc_blocks)) {
420 new = ((int) fs->super->s_reserved_gdt_blocks) +
421 (old_fs->desc_blocks - fs->desc_blocks);
424 if (new > (int) fs->blocksize/4)
425 new = fs->blocksize/4;
426 fs->super->s_reserved_gdt_blocks = new;
433 if (old_fs->group_desc_count > fs->group_desc_count) {
438 for (i = fs->group_desc_count;
440 free_gdp_blocks(fs, reserve_blocks,
455 if (old_fs->group_desc_count == fs->group_desc_count) {
456 numblocks = (fs->super->s_blocks_count -
457 fs->super->s_first_data_block) %
458 fs->super->s_blocks_per_group;
460 numblocks = fs->super->s_blocks_per_group;
462 numblocks = fs->super->s_blocks_per_group;
464 fs->group_desc[i].bg_free_blocks_count += (numblocks-old_numblocks);
465 ext2fs_group_desc_csum_set(fs, i);
472 if (old_fs->group_desc_count >= fs->group_desc_count) {
480 group_block = fs->super->s_first_data_block +
481 old_fs->group_desc_count * fs->super->s_blocks_per_group;
483 csum_flag = EXT2_HAS_RO_COMPAT_FEATURE(fs->super,
486 max_group = fs->group_desc_count - adj;
487 if (fs->super->s_feature_incompat & EXT2_FEATURE_INCOMPAT_META_BG)
488 old_desc_blocks = fs->super->s_first_meta_bg;
490 old_desc_blocks = fs->desc_blocks +
491 fs->super->s_reserved_gdt_blocks;
493 i < fs->group_desc_count; i++) {
494 memset(&fs->group_desc[i], 0,
498 fs->group_desc[i].bg_flags = 0;
500 fs->group_desc[i].bg_flags |= EXT2_BG_INODE_UNINIT |
502 if (i == fs->group_desc_count-1) {
503 numblocks = (fs->super->s_blocks_count -
504 fs->super->s_first_data_block) %
505 fs->super->s_blocks_per_group;
507 numblocks = fs->super->s_blocks_per_group;
509 numblocks = fs->super->s_blocks_per_group;
511 fs->group_desc[i].bg_flags |=
515 has_super = ext2fs_bg_has_super(fs, i);
517 ext2fs_block_alloc_stats(fs, group_block, +1);
520 meta_bg_size = EXT2_DESC_PER_BLOCK(fs->super);
522 if (!(fs->super->s_feature_incompat &
524 (meta_bg < fs->super->s_first_meta_bg)) {
527 ext2fs_block_alloc_stats(fs,
537 ext2fs_block_alloc_stats(fs,
541 adjblocks += 2 + fs->inode_blocks_per_group;
544 fs->super->s_free_blocks_count -= adjblocks;
545 fs->super->s_free_inodes_count +=
546 fs->super->s_inodes_per_group;
547 fs->group_desc[i].bg_free_blocks_count = numblocks;
548 fs->group_desc[i].bg_free_inodes_count =
549 fs->super->s_inodes_per_group;
550 fs->group_desc[i].bg_used_dirs_count = 0;
551 ext2fs_group_desc_csum_set(fs, i);
553 retval = ext2fs_allocate_group_table(fs, i, 0);
556 group_block += fs->super->s_blocks_per_group;
570 ext2_filsys fs;
577 fs = rfs->new_fs;
578 ext2fs_mark_super_dirty(fs);
579 ext2fs_mark_bb_dirty(fs);
580 ext2fs_mark_ib_dirty(fs);
582 retval = ext2fs_allocate_block_bitmap(fs, _("reserved blocks"),
587 retval = adjust_fs_info(fs, rfs->old_fs, rfs->reserve_blocks, new_size);
605 if (rfs->old_fs->group_desc_count > fs->group_desc_count) {
615 if (rfs->old_fs->group_desc_count >= fs->group_desc_count) {
623 retval = ext2fs_get_array(fs->blocksize, fs->inode_blocks_per_group,
628 memset(rfs->itable_buf, 0, fs->blocksize * fs->inode_blocks_per_group);
629 group_block = fs->super->s_first_data_block +
630 rfs->old_fs->group_desc_count * fs->super->s_blocks_per_group;
633 max_group = fs->group_desc_count - adj;
641 i < fs->group_desc_count; i++) {
645 retval = io_channel_write_blk(fs->io,
646 fs->group_desc[i].bg_inode_table,
647 fs->inode_blocks_per_group,
651 io_channel_flush(fs->io);
658 group_block += fs->super->s_blocks_per_group;
660 io_channel_flush(fs->io);
683 static errcode_t mark_table_blocks(ext2_filsys fs,
692 meta_bg_size = EXT2_DESC_PER_BLOCK(fs->super);
693 if (fs->super->s_feature_incompat & EXT2_FEATURE_INCOMPAT_META_BG)
694 old_desc_blocks = fs->super->s_first_meta_bg;
696 old_desc_blocks = fs->desc_blocks +
697 fs->super->s_reserved_gdt_blocks;
698 for (i = 0; i < fs->group_desc_count; i++) {
699 ext2fs_reserve_super_and_bgd(fs, i, bmap);
704 for (j = 0, b = fs->group_desc[i].bg_inode_table;
705 j < (unsigned int) fs->inode_blocks_per_group;
713 fs->group_desc[i].bg_block_bitmap);
719 fs->group_desc[i].bg_inode_bitmap);
733 ext2_filsys fs = rfs->new_fs;
736 ext2fs_block_alloc_stats(fs, blk, +1);
743 if (IS_BLOCK_BM(fs, group, blk)) {
744 FS_BLOCK_BM(fs, group) = 0;
746 } else if (IS_INODE_BM(fs, group, blk)) {
747 FS_INODE_BM(fs, group) = 0;
749 } else if (IS_INODE_TB(fs, group, blk)) {
750 FS_INODE_TB(fs, group) = 0;
752 } else if (EXT2_HAS_RO_COMPAT_FEATURE(fs->super,
754 (fs->group_desc[group].bg_flags & EXT2_BG_BLOCK_UNINIT)) {
781 ext2_filsys fs, old_fs;
785 fs = rfs->new_fs;
787 if (old_fs->super->s_blocks_count > fs->super->s_blocks_count)
788 fs = rfs->old_fs;
790 retval = ext2fs_allocate_block_bitmap(fs, _("blocks to be moved"),
795 retval = ext2fs_allocate_block_bitmap(fs, _("meta-data blocks"),
804 fs = rfs->new_fs;
810 for (blk = fs->super->s_blocks_count;
812 g = ext2fs_group_of_blk(fs, blk);
813 if (EXT2_HAS_RO_COMPAT_FEATURE(fs->super,
820 blk = ((g+1) * fs->super->s_blocks_per_group) +
821 fs->super->s_first_data_block - 1;
832 if (fs->super->s_feature_incompat & EXT2_FEATURE_INCOMPAT_META_BG) {
834 new_blocks = fs->super->s_first_meta_bg;
837 new_blocks = fs->desc_blocks + fs->super->s_reserved_gdt_blocks;
845 max_groups = fs->group_desc_count;
856 if (!ext2fs_bg_has_super(fs, i)) {
857 group_blk += fs->super->s_blocks_per_group;
862 ext2fs_block_alloc_stats(fs, blk, -1);
865 group_blk += fs->super->s_blocks_per_group;
874 meta_bg_size = EXT2_DESC_PER_BLOCK(fs->super);
876 has_super = ext2fs_bg_has_super(fs, i);
881 if (!(fs->super->s_feature_incompat &
883 (meta_bg < fs->super->s_first_meta_bg)) {
900 if (fs->group_desc[i].bg_inode_table &&
901 fs->group_desc[i].bg_inode_bitmap &&
902 fs->group_desc[i].bg_block_bitmap)
909 if (fs->group_desc[i].bg_block_bitmap)
911 fs->group_desc[i].bg_block_bitmap);
912 if (fs->group_desc[i].bg_inode_bitmap)
914 fs->group_desc[i].bg_inode_bitmap);
915 if (fs->group_desc[i].bg_inode_table)
916 for (blk = fs->group_desc[i].bg_inode_table, j=0;
917 j < fs->inode_blocks_per_group ; j++, blk++)
933 * the fs->block_map because it doesn't handle
941 save_incompat_flag = fs->super->s_feature_incompat;
942 fs->super->s_feature_incompat &= ~EXT4_FEATURE_INCOMPAT_FLEX_BG;
943 retval = ext2fs_allocate_group_table(fs, i,
945 fs->super->s_feature_incompat = save_incompat_flag;
954 (blk = FS_BLOCK_BM(fs, i))) {
955 ext2fs_block_alloc_stats(fs, blk, +1);
962 (blk = FS_INODE_BM(fs, i))) {
963 ext2fs_block_alloc_stats(fs, blk, +1);
977 if (FS_INODE_TB(fs, i) == FS_INODE_TB(old_fs, i))
980 rfs->needed_blocks += fs->inode_blocks_per_group;
987 for (blk = fs->group_desc[i].bg_inode_table, j=0;
988 j < fs->inode_blocks_per_group ; j++, blk++) {
989 ext2fs_block_alloc_stats(fs, blk, +1);
1001 j < fs->inode_blocks_per_group ; j++, blk++)
1047 ext2_filsys fs = rfs->new_fs;
1050 if (rfs->new_blk >= fs->super->s_blocks_count) {
1060 rfs->new_blk = fs->super->s_first_data_block;
1063 if (ext2fs_test_block_bitmap(fs->block_map, rfs->new_blk) ||
1077 static errcode_t resize2fs_get_alloc_block(ext2_filsys fs, blk64_t goal,
1080 ext2_resize_t rfs = (ext2_resize_t) fs->priv_data;
1101 ext2_filsys fs = rfs->new_fs;
1109 fs->get_alloc_block = resize2fs_get_alloc_block;
1116 new_blk = fs->super->s_first_data_block;
1118 retval = ext2fs_get_array(fs->blocksize,
1119 fs->inode_blocks_per_group,
1151 ext2fs_block_alloc_stats(fs, new_blk, +1);
1189 if (c > fs->inode_blocks_per_group)
1190 c = fs->inode_blocks_per_group;
1191 retval = io_channel_read_blk(fs->io, old_blk, c,
1194 retval = io_channel_write_blk(fs->io, new_blk, c,
1202 io_channel_flush(fs->io);
1210 io_channel_flush(fs->io);
1241 static int process_block(ext2_filsys fs, blk_t *block_nr,
1268 retval = ext2fs_add_dir_block(fs->dblist, pb->ino,
1281 static errcode_t progress_callback(ext2_filsys fs,
1296 io_channel_flush(fs->io);
1298 group+1, fs->group_desc_count);
1585 ext2_filsys fs = rfs->new_fs;
1591 max_groups = fs->group_desc_count;
1595 size = fs->blocksize * fs->inode_blocks_per_group;
1608 fs->group_desc[i].bg_inode_table)
1625 new_blk = fs->group_desc[i].bg_inode_table;
1637 retval = io_channel_read_blk(fs->io, old_blk,
1638 fs->inode_blocks_per_group,
1652 n = n >> EXT2_BLOCK_SIZE_BITS(fs->super);
1657 num = fs->inode_blocks_per_group;
1661 retval = io_channel_write_blk(fs->io, new_blk,
1664 io_channel_write_blk(fs->io, old_blk,
1669 retval = io_channel_write_blk(fs->io,
1670 old_blk + fs->inode_blocks_per_group,
1672 (fs->inode_blocks_per_group - diff) *
1673 fs->blocksize));
1679 j < fs->inode_blocks_per_group ; j++, blk++)
1680 ext2fs_block_alloc_stats(fs, blk, -1);
1694 mark_table_blocks(fs, fs->block_map);
1695 ext2fs_flush(fs);
1709 static errcode_t fix_resize_inode(ext2_filsys fs)
1716 if (!(fs->super->s_feature_compat &
1720 retval = ext2fs_get_mem(fs->blocksize, &block_buf);
1723 retval = ext2fs_read_inode(fs, EXT2_RESIZE_INO, &inode);
1726 if (fs->super->s_reserved_gdt_blocks == 0) {
1727 fs->super->s_feature_compat &=
1729 ext2fs_mark_super_dirty(fs);
1732 ext2fs_block_alloc_stats(fs, blk, -1);
1736 retval = ext2fs_write_inode(fs, EXT2_RESIZE_INO, &inode);
1740 ext2fs_iblk_set(fs, &inode, 1);
1742 retval = ext2fs_write_inode(fs, EXT2_RESIZE_INO, &inode);
1756 memset(block_buf, 0, fs->blocksize);
1758 retval = io_channel_write_blk(fs->io, inode.i_block[EXT2_DIND_BLOCK],
1762 retval = ext2fs_create_resize_inode(fs);
1775 static errcode_t ext2fs_calculate_summary_stats(ext2_filsys fs)
1790 uninit = fs->group_desc[group].bg_flags & EXT2_BG_BLOCK_UNINIT;
1791 ext2fs_super_and_bgd_loc(fs, group, &super_blk, &old_desc_blk,
1793 if (fs->super->s_feature_incompat & EXT2_FEATURE_INCOMPAT_META_BG)
1794 old_desc_blocks = fs->super->s_first_meta_bg;
1796 old_desc_blocks = fs->desc_blocks +
1797 fs->super->s_reserved_gdt_blocks;
1798 for (blk = fs->super->s_first_data_block;
1799 blk < fs->super->s_blocks_count; blk++) {
1806 (blk == fs->group_desc[group].bg_block_bitmap) ||
1807 (blk == fs->group_desc[group].bg_inode_bitmap) ||
1808 ((blk >= fs->group_desc[group].bg_inode_table &&
1809 (blk < fs->group_desc[group].bg_inode_table
1810 + fs->inode_blocks_per_group))))) ||
1811 (!ext2fs_fast_test_block_bitmap(fs->block_map, blk))) {
1816 if ((count == fs->super->s_blocks_per_group) ||
1817 (blk == fs->super->s_blocks_count-1)) {
1818 fs->group_desc[group].bg_free_blocks_count =
1820 ext2fs_group_desc_csum_set(fs, group);
1822 if (group >= fs->group_desc_count)
1826 uninit = (fs->group_desc[group].bg_flags &
1828 ext2fs_super_and_bgd_loc(fs, group, &super_blk,
1831 if (fs->super->s_feature_incompat &
1833 old_desc_blocks = fs->super->s_first_meta_bg;
1835 old_desc_blocks = fs->desc_blocks +
1836 fs->super->s_reserved_gdt_blocks;
1839 fs->super->s_free_blocks_count = total_free;
1850 uninit = fs->group_desc[group].bg_flags & EXT2_BG_INODE_UNINIT;
1851 for (ino = 1; ino <= fs->super->s_inodes_count && ino > 0; ino++) {
1853 !ext2fs_fast_test_inode_bitmap(fs->inode_map, ino)) {
1858 if ((count == fs->super->s_inodes_per_group) ||
1859 (ino == fs->super->s_inodes_count)) {
1860 fs->group_desc[group].bg_free_inodes_count =
1862 ext2fs_group_desc_csum_set(fs, group);
1864 if (group >= fs->group_desc_count)
1868 uninit = (fs->group_desc[group].bg_flags &
1872 fs->super->s_free_inodes_count = total_free;
1873 ext2fs_mark_super_dirty(fs);
1881 static errcode_t fix_sb_journal_backup(ext2_filsys fs)
1886 if (!(fs->super->s_feature_compat & EXT3_FEATURE_COMPAT_HAS_JOURNAL))
1890 if (fs->super->s_journal_dev && !fs->super->s_journal_inum)
1893 retval = ext2fs_read_inode(fs, fs->super->s_journal_inum, &inode);
1896 memcpy(fs->super->s_jnl_blocks, inode.i_block, EXT2_N_BLOCKS*4);
1897 fs->super->s_jnl_blocks[16] = inode.i_size;
1898 fs->super->s_jnl_backup_type = EXT3_JNL_BACKUP_BLOCKS;
1899 ext2fs_mark_super_dirty(fs);
1904 * calcluate the minimum number of blocks the given fs can be resized to
1906 blk_t calculate_minimum_resize_size(ext2_filsys fs)
1912 int flexbg_size = 1 << fs->super->s_log_groups_per_flex;
1918 inode_count = fs->super->s_inodes_count -
1919 fs->super->s_free_inodes_count;
1921 fs->super->s_inodes_per_group) *
1922 EXT2_BLOCKS_PER_GROUP(fs->super);
1924 EXT2_BLOCKS_PER_GROUP(fs->super));
1930 for (grp = 0; grp < fs->group_desc_count; grp++) {
1931 if (ext2fs_bg_has_super(fs, grp))
1936 data_needed = fs->super->s_blocks_count -
1937 fs->super->s_free_blocks_count;
1938 data_needed -= SUPER_OVERHEAD(fs) * num_of_superblocks;
1939 data_needed -= META_OVERHEAD(fs) * fs->group_desc_count;
1941 if (fs->super->s_feature_incompat & EXT4_FEATURE_INCOMPAT_FLEX_BG) {
1948 data_needed += META_OVERHEAD(fs) * extra_groups;
1956 data_blocks = groups * EXT2_BLOCKS_PER_GROUP(fs->super);
1959 overhead = META_OVERHEAD(fs);
1961 if (ext2fs_bg_has_super(fs, grp))
1962 overhead += SUPER_OVERHEAD(fs);
1970 last_start += EXT2_BLOCKS_PER_GROUP(fs->super) -
1986 EXT2_BLOCKS_PER_GROUP(fs->super));
1988 data_blocks += extra_grps * EXT2_BLOCKS_PER_GROUP(fs->super);
1991 overhead = META_OVERHEAD(fs);
1992 if (ext2fs_bg_has_super(fs, groups-1))
1993 overhead += SUPER_OVERHEAD(fs);
1994 last_start += EXT2_BLOCKS_PER_GROUP(fs->super) - overhead;
1997 overhead = META_OVERHEAD(fs);
1998 if (ext2fs_bg_has_super(fs, grp))
1999 overhead += SUPER_OVERHEAD(fs);
2006 last_start += EXT2_BLOCKS_PER_GROUP(fs->super)
2014 if (fs->super->s_feature_incompat
2024 data_needed += META_OVERHEAD(fs) * extra_groups;
2030 overhead = META_OVERHEAD(fs);
2041 * even worth making/resizing the fs. basically you need to
2052 if (ext2fs_bg_has_super(fs, groups-1))
2053 overhead += SUPER_OVERHEAD(fs);
2060 blks_needed = (groups-1) * EXT2_BLOCKS_PER_GROUP(fs->super);
2067 if (blks_needed >= fs->super->s_blocks_count)
2068 return fs->super->s_blocks_count;
2074 if (fs->super->s_feature_incompat & EXT3_FEATURE_INCOMPAT_EXTENTS)
2075 blks_needed += (fs->super->s_blocks_count - blks_needed)/500;