• Home
  • Raw
  • Download

Lines Matching refs:old_fs

115 	rfs->old_fs = fs;  in resize_fs()
180 (unsigned long long) ext2fs_free_blocks_count(rfs->old_fs->super), in resize_fs()
245 ext2fs_free(rfs->old_fs); in resize_fs()
246 rfs->old_fs = NULL; in resize_fs()
269 static void adjust_reserved_gdt_blocks(ext2_filsys old_fs, ext2_filsys fs) in adjust_reserved_gdt_blocks() argument
272 (old_fs->desc_blocks != fs->desc_blocks)) { in adjust_reserved_gdt_blocks()
276 (old_fs->desc_blocks - fs->desc_blocks); in adjust_reserved_gdt_blocks()
310 if (EXT2_DESC_SIZE(rfs->old_fs->super) == in resize_group_descriptors()
316 rfs->old_fs->group_desc_count, in resize_group_descriptors()
319 rfs->old_fs->blocksize, &new_group_desc); in resize_group_descriptors()
325 if (EXT2_DESC_SIZE(rfs->old_fs->super) <= in resize_group_descriptors()
327 copy_size = EXT2_DESC_SIZE(rfs->old_fs->super); in resize_group_descriptors()
330 for (i = 0; i < rfs->old_fs->group_desc_count; i++) { in resize_group_descriptors()
333 o = (char *)o + EXT2_DESC_SIZE(rfs->old_fs->super); in resize_group_descriptors()
339 for (i = 0; i < rfs->old_fs->group_desc_count; i++) in resize_group_descriptors()
342 adjust_reserved_gdt_blocks(rfs->old_fs, rfs->new_fs); in resize_group_descriptors()
360 retval = ext2fs_allocate_block_bitmap(rfs->old_fs, "oldfs", &old_map); in move_bg_metadata()
368 if (ext2fs_has_feature_meta_bg(rfs->old_fs->super)) { in move_bg_metadata()
369 old_desc_blocks = rfs->old_fs->super->s_first_meta_bg; in move_bg_metadata()
372 old_desc_blocks = rfs->old_fs->desc_blocks + in move_bg_metadata()
373 rfs->old_fs->super->s_reserved_gdt_blocks; in move_bg_metadata()
379 for (i = 0; i < rfs->old_fs->group_desc_count; i++) { in move_bg_metadata()
380 retval = ext2fs_super_and_bgd_loc2(rfs->old_fs, i, &b, &c, &d, in move_bg_metadata()
406 for (b = EXT2FS_B2C(rfs->old_fs, in move_bg_metadata()
407 rfs->old_fs->super->s_first_data_block); in move_bg_metadata()
435 for (i = 0; i < rfs->old_fs->group_desc_count; i++) { in move_bg_metadata()
514 ext2_filsys fs = rfs->old_fs; in zero_high_bits_in_inodes()
631 ext2_filsys old_fs, in free_gdp_blocks() argument
639 dgrp_t count = old_fs->group_desc_count - fs->group_desc_count; in free_gdp_blocks()
653 blk = ext2fs_block_bitmap_loc(old_fs, i); in free_gdp_blocks()
661 blk = ext2fs_inode_bitmap_loc(old_fs, i); in free_gdp_blocks()
669 blk = ext2fs_inode_table_loc(old_fs, i); in free_gdp_blocks()
690 errcode_t adjust_fs_info(ext2_filsys fs, ext2_filsys old_fs, in adjust_fs_info() argument
770 blk = ext2fs_blocks_count(old_fs->super); in adjust_fs_info()
783 percent = (ext2fs_r_blocks_count(old_fs->super) * 100.0) / in adjust_fs_info()
784 ext2fs_blocks_count(old_fs->super); in adjust_fs_info()
807 if (reserve_blocks && new_size > ext2fs_blocks_count(old_fs->super)) { in adjust_fs_info()
816 if (EXT2_DESC_SIZE(old_fs->super) == EXT2_DESC_SIZE(fs->super) && in adjust_fs_info()
817 old_fs->desc_blocks != fs->desc_blocks) { in adjust_fs_info()
818 retval = ext2fs_resize_mem(old_fs->desc_blocks * in adjust_fs_info()
824 if (fs->desc_blocks > old_fs->desc_blocks) in adjust_fs_info()
826 (old_fs->desc_blocks * fs->blocksize), 0, in adjust_fs_info()
827 (fs->desc_blocks - old_fs->desc_blocks) * in adjust_fs_info()
839 if (EXT2_DESC_SIZE(old_fs->super) == EXT2_DESC_SIZE(fs->super)) in adjust_fs_info()
840 adjust_reserved_gdt_blocks(old_fs, fs); in adjust_fs_info()
854 dgrp_t old_last_bg = old_fs->group_desc_count - 1; in adjust_fs_info()
857 if (old_fs->group_desc_count == 1) in adjust_fs_info()
859 if ((old_fs->group_desc_count < 3 && in adjust_fs_info()
869 old_fs->super->s_backup_bgs[1] == old_last_bg) in adjust_fs_info()
878 if (old_fs->group_desc_count > fs->group_desc_count) { in adjust_fs_info()
883 retval = free_gdp_blocks(fs, reserve_blocks, old_fs, in adjust_fs_info()
891 old_numblocks = (ext2fs_blocks_count(old_fs->super) - in adjust_fs_info()
892 old_fs->super->s_first_data_block) % in adjust_fs_info()
893 old_fs->super->s_blocks_per_group; in adjust_fs_info()
895 old_numblocks = old_fs->super->s_blocks_per_group; in adjust_fs_info()
896 if (old_fs->group_desc_count == fs->group_desc_count) { in adjust_fs_info()
904 i = old_fs->group_desc_count - 1; in adjust_fs_info()
913 if (old_fs->group_desc_count >= fs->group_desc_count) { in adjust_fs_info()
922 old_fs->group_desc_count); in adjust_fs_info()
939 for (i = 0; i < old_fs->group_desc_count; i++) in adjust_fs_info()
942 for (i = old_fs->group_desc_count; in adjust_fs_info()
1044 retval = adjust_fs_info(fs, rfs->old_fs, rfs->reserve_blocks, new_size); in adjust_superblock()
1051 if ((rfs->old_fs->super->s_inodes_count - in adjust_superblock()
1052 rfs->old_fs->super->s_free_inodes_count) > in adjust_superblock()
1062 if (rfs->old_fs->group_desc_count > fs->group_desc_count) { in adjust_superblock()
1072 if (rfs->old_fs->group_desc_count >= fs->group_desc_count) { in adjust_superblock()
1097 rfs->old_fs->group_desc_count); in adjust_superblock()
1098 adj = rfs->old_fs->group_desc_count; in adjust_superblock()
1106 for (i = rfs->old_fs->group_desc_count; in adjust_superblock()
1225 for (i = 0; i < rfs->old_fs->group_desc_count; i++) { in mark_fs_metablock()
1251 } else if (blk < ext2fs_blocks_count(rfs->old_fs->super) && in mark_fs_metablock()
1252 ext2fs_test_block_bitmap2(rfs->old_fs->block_map, blk) && in mark_fs_metablock()
1275 ext2_filsys fs, old_fs; in blocks_to_move() local
1280 old_fs = rfs->old_fs; in blocks_to_move()
1281 if (ext2fs_blocks_count(old_fs->super) > ext2fs_blocks_count(fs->super)) in blocks_to_move()
1282 fs = rfs->old_fs; in blocks_to_move()
1294 retval = mark_table_blocks(old_fs, meta_bmap); in blocks_to_move()
1307 if (new_size < ext2fs_blocks_count(old_fs->super)) { in blocks_to_move()
1341 blk < ext2fs_blocks_count(old_fs->super); blk++) { in blocks_to_move()
1344 ext2fs_bg_flags_test(old_fs, g, EXT2_BG_BLOCK_UNINIT)) { in blocks_to_move()
1352 if (ext2fs_test_block_bitmap2(old_fs->block_map, blk) && in blocks_to_move()
1360 if (ext2fs_has_feature_meta_bg(old_fs->super)) in blocks_to_move()
1361 old_blocks = old_fs->super->s_first_meta_bg; in blocks_to_move()
1363 old_blocks = old_fs->desc_blocks + in blocks_to_move()
1364 old_fs->super->s_reserved_gdt_blocks; in blocks_to_move()
1374 if (EXT2_DESC_SIZE(rfs->old_fs->super) == in blocks_to_move()
1382 if (max_groups > old_fs->group_desc_count) in blocks_to_move()
1383 max_groups = old_fs->group_desc_count; in blocks_to_move()
1384 group_blk = old_fs->super->s_first_data_block; in blocks_to_move()
1404 if (!ext2fs_bg_has_super(old_fs, i)) { in blocks_to_move()
1477 else if (flex_bg && i < old_fs->group_desc_count) in blocks_to_move()
1479 ext2fs_block_bitmap_loc(old_fs, i)); in blocks_to_move()
1484 else if (flex_bg && i < old_fs->group_desc_count) in blocks_to_move()
1486 ext2fs_inode_bitmap_loc(old_fs, i)); in blocks_to_move()
1492 else if (flex_bg && i < old_fs->group_desc_count) in blocks_to_move()
1494 ext2fs_inode_table_loc(old_fs, i), in blocks_to_move()
1495 old_fs->inode_blocks_per_group); in blocks_to_move()
1516 if (ext2fs_block_bitmap_loc(old_fs, i) != in blocks_to_move()
1519 if (blk < ext2fs_blocks_count(old_fs->super) && in blocks_to_move()
1520 ext2fs_test_block_bitmap2(old_fs->block_map, blk) && in blocks_to_move()
1525 if (ext2fs_inode_bitmap_loc(old_fs, i) != in blocks_to_move()
1528 if (blk < ext2fs_blocks_count(old_fs->super) && in blocks_to_move()
1529 ext2fs_test_block_bitmap2(old_fs->block_map, blk) && in blocks_to_move()
1542 if (ext2fs_inode_table_loc(fs, i) == ext2fs_inode_table_loc(old_fs, i)) in blocks_to_move()
1555 if (blk < ext2fs_blocks_count(old_fs->super) && in blocks_to_move()
1556 ext2fs_test_block_bitmap2(old_fs->block_map, blk) && in blocks_to_move()
1566 for (blk = ext2fs_inode_table_loc(rfs->old_fs, i), j=0; in blocks_to_move()
1605 ext2fs_blocks_count(rfs->old_fs->super)) in init_block_alloc()
1606 rfs->new_blk = ext2fs_blocks_count(rfs->old_fs->super); in init_block_alloc()
1632 (rfs->new_blk < ext2fs_blocks_count(rfs->old_fs->super)) && in get_new_block()
1633 ext2fs_test_block_bitmap2(rfs->old_fs->block_map, in get_new_block()
1660 ext2fs_mark_block_bitmap2(rfs->old_fs->block_map, blk); in resize2fs_get_alloc_block()
1663 group = ext2fs_group_of_blk2(rfs->old_fs, blk); in resize2fs_get_alloc_block()
1664 ext2fs_clear_block_uninit(rfs->old_fs, group); in resize2fs_get_alloc_block()
1676 ext2_filsys old_fs = rfs->old_fs; in block_mover() local
1684 old_fs->get_alloc_block = resize2fs_get_alloc_block; in block_mover()
1686 retval = ext2fs_read_bb_inode(old_fs, &badblock_list); in block_mover()
1708 for (blk = B2C(old_fs->super->s_first_data_block); in block_mover()
1709 blk < ext2fs_blocks_count(old_fs->super); in block_mover()
1711 if (!ext2fs_test_block_bitmap2(old_fs->block_map, blk)) in block_mover()
1796 retval = ext2fs_update_bb_inode(old_fs, in block_mover()
1913 if (ext2fs_file_acl_block(rfs->old_fs, inode) == 0 || !rfs->bmap) in migrate_ea_block()
1915 new_block = extent_translate(rfs->old_fs, rfs->bmap, in migrate_ea_block()
1916 ext2fs_file_acl_block(rfs->old_fs, inode)); in migrate_ea_block()
1921 ext2fs_file_acl_block_set(rfs->old_fs, inode, new_block); in migrate_ea_block()
1925 err = ext2fs_get_mem(rfs->old_fs->blocksize, &buf); in migrate_ea_block()
1928 rfs->old_fs->flags |= EXT2_FLAG_IGNORE_CSUM_ERRORS; in migrate_ea_block()
1929 err = ext2fs_read_ext_attr3(rfs->old_fs, new_block, buf, ino); in migrate_ea_block()
1930 rfs->old_fs->flags &= ~EXT2_FLAG_IGNORE_CSUM_ERRORS; in migrate_ea_block()
1933 err = ext2fs_write_ext_attr3(rfs->old_fs, new_block, buf, ino); in migrate_ea_block()
2103 if ((rfs->old_fs->group_desc_count <= in inode_scan_and_fix()
2110 retval = ext2fs_open_inode_scan(rfs->old_fs, 0, &scan); in inode_scan_and_fix()
2113 retval = ext2fs_init_dblist(rfs->old_fs, 0); in inode_scan_and_fix()
2115 retval = ext2fs_get_array(rfs->old_fs->blocksize, 3, &block_buf); in inode_scan_and_fix()
2123 0, rfs->old_fs->group_desc_count); in inode_scan_and_fix()
2183 retval = ext2fs_write_inode_full(rfs->old_fs, new_inode, in inode_scan_and_fix()
2202 retval = ext2fs_write_inode_full(rfs->old_fs, in inode_scan_and_fix()
2213 rfs->old_fs->flags |= EXT2_FLAG_IGNORE_CSUM_ERRORS; in inode_scan_and_fix()
2214 if (ext2fs_inode_has_valid_blocks2(rfs->old_fs, inode) && in inode_scan_and_fix()
2219 retval = ext2fs_block_iterate3(rfs->old_fs, in inode_scan_and_fix()
2231 retval = ext2fs_add_dir_block2(rfs->old_fs->dblist, in inode_scan_and_fix()
2238 if (ext2fs_has_feature_metadata_csum(rfs->old_fs->super) && in inode_scan_and_fix()
2240 retval = ext2fs_fix_extents_checksums(rfs->old_fs, in inode_scan_and_fix()
2254 io_channel_flush(rfs->old_fs->io); in inode_scan_and_fix()
2258 rfs->old_fs->flags &= ~EXT2_FLAG_IGNORE_CSUM_ERRORS; in inode_scan_and_fix()
2299 io_channel_flush(is->rfs->old_fs->io); in check_and_change_inodes()
2311 if (ext2fs_has_feature_metadata_csum(is->rfs->old_fs->super) && in check_and_change_inodes()
2312 !ext2fs_test_inode_bitmap2(is->rfs->old_fs->inode_map, dir)) in check_and_change_inodes()
2332 retval = ext2fs_read_inode(is->rfs->old_fs, dir, &inode); in check_and_change_inodes()
2335 is->err = ext2fs_write_inode(is->rfs->old_fs, dir, &inode); in check_and_change_inodes()
2356 is.max_dirs = ext2fs_dblist_count2(rfs->old_fs->dblist); in inode_ref_fix()
2367 rfs->old_fs->flags |= EXT2_FLAG_IGNORE_CSUM_ERRORS; in inode_ref_fix()
2368 retval = ext2fs_dblist_dir_iterate(rfs->old_fs->dblist, in inode_ref_fix()
2371 rfs->old_fs->flags &= ~EXT2_FLAG_IGNORE_CSUM_ERRORS; in inode_ref_fix()
2424 if (max_groups > rfs->old_fs->group_desc_count) in move_itables()
2425 max_groups = rfs->old_fs->group_desc_count; in move_itables()
2450 if (ext2fs_inode_table_loc(rfs->old_fs, i) != in move_itables()
2466 rfs->old_fs->flags |= EXT2_FLAG_MASTER_SB_ONLY; in move_itables()
2469 old_blk = ext2fs_inode_table_loc(rfs->old_fs, i); in move_itables()
2526 for (blk = ext2fs_inode_table_loc(rfs->old_fs, i), j=0; in move_itables()
2541 ext2fs_inode_table_loc_set(rfs->old_fs, i, new_blk); in move_itables()
2542 ext2fs_group_desc_csum_set(rfs->old_fs, i); in move_itables()
2543 ext2fs_mark_super_dirty(rfs->old_fs); in move_itables()
2544 ext2fs_flush(rfs->old_fs); in move_itables()
2575 ext2_filsys old_fs = rfs->old_fs; in clear_sparse_super2_last_group() local
2577 dgrp_t old_last_bg = rfs->old_fs->group_desc_count - 1; in clear_sparse_super2_last_group()
2588 if (fs->super->s_backup_bgs[0] == old_fs->super->s_backup_bgs[0] && in clear_sparse_super2_last_group()
2589 fs->super->s_backup_bgs[1] == old_fs->super->s_backup_bgs[1]) in clear_sparse_super2_last_group()
2592 if (old_fs->super->s_backup_bgs[0] != old_last_bg && in clear_sparse_super2_last_group()
2593 old_fs->super->s_backup_bgs[1] != old_last_bg) in clear_sparse_super2_last_group()
2603 retval = ext2fs_super_and_bgd_loc2(rfs->old_fs, old_last_bg, in clear_sparse_super2_last_group()
2626 ext2_filsys old_fs = rfs->old_fs; in reserve_sparse_super2_last_group() local
2628 dgrp_t old_last_bg = rfs->old_fs->group_desc_count - 1; in reserve_sparse_super2_last_group()
2641 if (fs->super->s_backup_bgs[0] == old_fs->super->s_backup_bgs[0] && in reserve_sparse_super2_last_group()
2642 fs->super->s_backup_bgs[1] == old_fs->super->s_backup_bgs[1]) in reserve_sparse_super2_last_group()
2649 if (old_fs->super->s_backup_bgs[0] == last_bg || in reserve_sparse_super2_last_group()
2650 old_fs->super->s_backup_bgs[1] == last_bg) in reserve_sparse_super2_last_group()
2701 if (ext2fs_test_block_bitmap2(old_fs->block_map, blk) && in reserve_sparse_super2_last_group()