• Home
  • Raw
  • Download

Lines Matching refs:old_fs

115 	rfs->old_fs = fs;  in resize_fs()
180 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
769 blk = ext2fs_blocks_count(old_fs->super); in adjust_fs_info()
782 percent = (ext2fs_r_blocks_count(old_fs->super) * 100.0) / in adjust_fs_info()
783 ext2fs_blocks_count(old_fs->super); in adjust_fs_info()
806 if (reserve_blocks && new_size > ext2fs_blocks_count(old_fs->super)) { in adjust_fs_info()
815 if (EXT2_DESC_SIZE(old_fs->super) == EXT2_DESC_SIZE(fs->super) && in adjust_fs_info()
816 old_fs->desc_blocks != fs->desc_blocks) { in adjust_fs_info()
817 retval = ext2fs_resize_mem(old_fs->desc_blocks * in adjust_fs_info()
823 if (fs->desc_blocks > old_fs->desc_blocks) in adjust_fs_info()
825 (old_fs->desc_blocks * fs->blocksize), 0, in adjust_fs_info()
826 (fs->desc_blocks - old_fs->desc_blocks) * in adjust_fs_info()
838 if (EXT2_DESC_SIZE(old_fs->super) == EXT2_DESC_SIZE(fs->super)) in adjust_fs_info()
839 adjust_reserved_gdt_blocks(old_fs, fs); in adjust_fs_info()
853 dgrp_t old_last_bg = old_fs->group_desc_count - 1; in adjust_fs_info()
856 if (old_fs->group_desc_count == 1) in adjust_fs_info()
858 if ((old_fs->group_desc_count < 3 && in adjust_fs_info()
868 old_fs->super->s_backup_bgs[1] == old_last_bg) in adjust_fs_info()
877 if (old_fs->group_desc_count > fs->group_desc_count) { in adjust_fs_info()
882 retval = free_gdp_blocks(fs, reserve_blocks, old_fs, in adjust_fs_info()
890 old_numblocks = (ext2fs_blocks_count(old_fs->super) - in adjust_fs_info()
891 old_fs->super->s_first_data_block) % in adjust_fs_info()
892 old_fs->super->s_blocks_per_group; in adjust_fs_info()
894 old_numblocks = old_fs->super->s_blocks_per_group; in adjust_fs_info()
895 if (old_fs->group_desc_count == fs->group_desc_count) { in adjust_fs_info()
903 i = old_fs->group_desc_count - 1; in adjust_fs_info()
912 if (old_fs->group_desc_count >= fs->group_desc_count) { in adjust_fs_info()
921 old_fs->group_desc_count); in adjust_fs_info()
937 for (i = 0; i < old_fs->group_desc_count; i++) in adjust_fs_info()
940 for (i = old_fs->group_desc_count; in adjust_fs_info()
1042 retval = adjust_fs_info(fs, rfs->old_fs, rfs->reserve_blocks, new_size); in adjust_superblock()
1049 if ((rfs->old_fs->super->s_inodes_count - in adjust_superblock()
1050 rfs->old_fs->super->s_free_inodes_count) > in adjust_superblock()
1060 if (rfs->old_fs->group_desc_count > fs->group_desc_count) { in adjust_superblock()
1070 if (rfs->old_fs->group_desc_count >= fs->group_desc_count) { in adjust_superblock()
1095 rfs->old_fs->group_desc_count); in adjust_superblock()
1096 adj = rfs->old_fs->group_desc_count; in adjust_superblock()
1104 for (i = rfs->old_fs->group_desc_count; in adjust_superblock()
1218 for (i = 0; i < rfs->old_fs->group_desc_count; i++) { in mark_fs_metablock()
1244 } else if (ext2fs_test_block_bitmap2(rfs->old_fs->block_map, blk) && in mark_fs_metablock()
1267 ext2_filsys fs, old_fs; in blocks_to_move() local
1272 old_fs = rfs->old_fs; in blocks_to_move()
1273 if (ext2fs_blocks_count(old_fs->super) > ext2fs_blocks_count(fs->super)) in blocks_to_move()
1274 fs = rfs->old_fs; in blocks_to_move()
1286 retval = mark_table_blocks(old_fs, meta_bmap); in blocks_to_move()
1299 if (new_size < ext2fs_blocks_count(old_fs->super)) { in blocks_to_move()
1333 blk < ext2fs_blocks_count(old_fs->super); blk++) { in blocks_to_move()
1336 ext2fs_bg_flags_test(old_fs, g, EXT2_BG_BLOCK_UNINIT)) { in blocks_to_move()
1344 if (ext2fs_test_block_bitmap2(old_fs->block_map, blk) && in blocks_to_move()
1352 if (ext2fs_has_feature_meta_bg(old_fs->super)) in blocks_to_move()
1353 old_blocks = old_fs->super->s_first_meta_bg; in blocks_to_move()
1355 old_blocks = old_fs->desc_blocks + in blocks_to_move()
1356 old_fs->super->s_reserved_gdt_blocks; in blocks_to_move()
1366 if (EXT2_DESC_SIZE(rfs->old_fs->super) == in blocks_to_move()
1374 if (max_groups > old_fs->group_desc_count) in blocks_to_move()
1375 max_groups = old_fs->group_desc_count; in blocks_to_move()
1376 group_blk = old_fs->super->s_first_data_block; in blocks_to_move()
1396 if (!ext2fs_bg_has_super(old_fs, i)) { in blocks_to_move()
1469 else if (flex_bg && i < old_fs->group_desc_count) in blocks_to_move()
1471 ext2fs_block_bitmap_loc(old_fs, i)); in blocks_to_move()
1476 else if (flex_bg && i < old_fs->group_desc_count) in blocks_to_move()
1478 ext2fs_inode_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_table_loc(old_fs, i), in blocks_to_move()
1487 old_fs->inode_blocks_per_group); in blocks_to_move()
1508 if (ext2fs_block_bitmap_loc(old_fs, i) != in blocks_to_move()
1511 if (ext2fs_test_block_bitmap2(old_fs->block_map, blk) && in blocks_to_move()
1516 if (ext2fs_inode_bitmap_loc(old_fs, i) != in blocks_to_move()
1519 if (ext2fs_test_block_bitmap2(old_fs->block_map, blk) && in blocks_to_move()
1532 if (ext2fs_inode_table_loc(fs, i) == ext2fs_inode_table_loc(old_fs, i)) in blocks_to_move()
1545 if (ext2fs_test_block_bitmap2(old_fs->block_map, blk) && in blocks_to_move()
1555 for (blk = ext2fs_inode_table_loc(rfs->old_fs, i), j=0; in blocks_to_move()
1594 ext2fs_blocks_count(rfs->old_fs->super)) in init_block_alloc()
1595 rfs->new_blk = ext2fs_blocks_count(rfs->old_fs->super); in init_block_alloc()
1621 (rfs->new_blk < ext2fs_blocks_count(rfs->old_fs->super)) && in get_new_block()
1622 ext2fs_test_block_bitmap2(rfs->old_fs->block_map, in get_new_block()
1648 ext2fs_mark_block_bitmap2(rfs->old_fs->block_map, blk); in resize2fs_get_alloc_block()
1651 group = ext2fs_group_of_blk2(rfs->old_fs, blk); in resize2fs_get_alloc_block()
1652 ext2fs_clear_block_uninit(rfs->old_fs, group); in resize2fs_get_alloc_block()
1664 ext2_filsys old_fs = rfs->old_fs; in block_mover() local
1672 old_fs->get_alloc_block = resize2fs_get_alloc_block; in block_mover()
1674 retval = ext2fs_read_bb_inode(old_fs, &badblock_list); in block_mover()
1696 for (blk = B2C(old_fs->super->s_first_data_block); in block_mover()
1697 blk < ext2fs_blocks_count(old_fs->super); in block_mover()
1699 if (!ext2fs_test_block_bitmap2(old_fs->block_map, blk)) in block_mover()
1782 retval = ext2fs_update_bb_inode(old_fs, in block_mover()
1898 if (ext2fs_file_acl_block(rfs->old_fs, inode) == 0 || !rfs->bmap) in migrate_ea_block()
1900 new_block = extent_translate(rfs->old_fs, rfs->bmap, in migrate_ea_block()
1901 ext2fs_file_acl_block(rfs->old_fs, inode)); in migrate_ea_block()
1906 ext2fs_file_acl_block_set(rfs->old_fs, inode, new_block); in migrate_ea_block()
1910 err = ext2fs_get_mem(rfs->old_fs->blocksize, &buf); in migrate_ea_block()
1913 rfs->old_fs->flags |= EXT2_FLAG_IGNORE_CSUM_ERRORS; in migrate_ea_block()
1914 err = ext2fs_read_ext_attr3(rfs->old_fs, new_block, buf, ino); in migrate_ea_block()
1915 rfs->old_fs->flags &= ~EXT2_FLAG_IGNORE_CSUM_ERRORS; in migrate_ea_block()
1918 err = ext2fs_write_ext_attr3(rfs->old_fs, new_block, buf, ino); in migrate_ea_block()
2000 if ((rfs->old_fs->group_desc_count <= in inode_scan_and_fix()
2007 retval = ext2fs_open_inode_scan(rfs->old_fs, 0, &scan); in inode_scan_and_fix()
2010 retval = ext2fs_init_dblist(rfs->old_fs, 0); in inode_scan_and_fix()
2012 retval = ext2fs_get_array(rfs->old_fs->blocksize, 3, &block_buf); in inode_scan_and_fix()
2020 0, rfs->old_fs->group_desc_count); in inode_scan_and_fix()
2072 retval = ext2fs_write_inode_full(rfs->old_fs, new_inode, in inode_scan_and_fix()
2091 retval = ext2fs_write_inode_full(rfs->old_fs, in inode_scan_and_fix()
2098 if (ext2fs_has_feature_metadata_csum(rfs->old_fs->super) && in inode_scan_and_fix()
2100 rfs->old_fs->flags |= EXT2_FLAG_IGNORE_CSUM_ERRORS; in inode_scan_and_fix()
2101 retval = rewrite_extents(rfs->old_fs, new_inode); in inode_scan_and_fix()
2102 rfs->old_fs->flags &= ~EXT2_FLAG_IGNORE_CSUM_ERRORS; in inode_scan_and_fix()
2112 if (ext2fs_inode_has_valid_blocks2(rfs->old_fs, inode) && in inode_scan_and_fix()
2117 rfs->old_fs->flags |= EXT2_FLAG_IGNORE_CSUM_ERRORS; in inode_scan_and_fix()
2118 retval = ext2fs_block_iterate3(rfs->old_fs, in inode_scan_and_fix()
2121 rfs->old_fs->flags &= ~EXT2_FLAG_IGNORE_CSUM_ERRORS; in inode_scan_and_fix()
2131 retval = ext2fs_add_dir_block2(rfs->old_fs->dblist, in inode_scan_and_fix()
2137 io_channel_flush(rfs->old_fs->io); in inode_scan_and_fix()
2181 io_channel_flush(is->rfs->old_fs->io); in check_and_change_inodes()
2193 if (ext2fs_has_feature_metadata_csum(is->rfs->old_fs->super) && in check_and_change_inodes()
2194 !ext2fs_test_inode_bitmap2(is->rfs->old_fs->inode_map, dir)) in check_and_change_inodes()
2214 retval = ext2fs_read_inode(is->rfs->old_fs, dir, &inode); in check_and_change_inodes()
2217 is->err = ext2fs_write_inode(is->rfs->old_fs, dir, &inode); in check_and_change_inodes()
2238 is.max_dirs = ext2fs_dblist_count2(rfs->old_fs->dblist); in inode_ref_fix()
2249 rfs->old_fs->flags |= EXT2_FLAG_IGNORE_CSUM_ERRORS; in inode_ref_fix()
2250 retval = ext2fs_dblist_dir_iterate(rfs->old_fs->dblist, in inode_ref_fix()
2253 rfs->old_fs->flags &= ~EXT2_FLAG_IGNORE_CSUM_ERRORS; in inode_ref_fix()
2306 if (max_groups > rfs->old_fs->group_desc_count) in move_itables()
2307 max_groups = rfs->old_fs->group_desc_count; in move_itables()
2332 if (ext2fs_inode_table_loc(rfs->old_fs, i) != in move_itables()
2348 rfs->old_fs->flags |= EXT2_FLAG_MASTER_SB_ONLY; in move_itables()
2351 old_blk = ext2fs_inode_table_loc(rfs->old_fs, i); in move_itables()
2407 for (blk = ext2fs_inode_table_loc(rfs->old_fs, i), j=0; in move_itables()
2422 ext2fs_inode_table_loc_set(rfs->old_fs, i, new_blk); in move_itables()
2423 ext2fs_group_desc_csum_set(rfs->old_fs, i); in move_itables()
2424 ext2fs_mark_super_dirty(rfs->old_fs); in move_itables()
2425 ext2fs_flush(rfs->old_fs); in move_itables()
2456 ext2_filsys old_fs = rfs->old_fs; in clear_sparse_super2_last_group() local
2458 dgrp_t old_last_bg = rfs->old_fs->group_desc_count - 1; in clear_sparse_super2_last_group()
2469 if (fs->super->s_backup_bgs[0] == old_fs->super->s_backup_bgs[0] && in clear_sparse_super2_last_group()
2470 fs->super->s_backup_bgs[1] == old_fs->super->s_backup_bgs[1]) in clear_sparse_super2_last_group()
2473 if (old_fs->super->s_backup_bgs[0] != old_last_bg && in clear_sparse_super2_last_group()
2474 old_fs->super->s_backup_bgs[1] != old_last_bg) in clear_sparse_super2_last_group()
2484 retval = ext2fs_super_and_bgd_loc2(rfs->old_fs, old_last_bg, in clear_sparse_super2_last_group()
2507 ext2_filsys old_fs = rfs->old_fs; in reserve_sparse_super2_last_group() local
2509 dgrp_t old_last_bg = rfs->old_fs->group_desc_count - 1; in reserve_sparse_super2_last_group()
2522 if (fs->super->s_backup_bgs[0] == old_fs->super->s_backup_bgs[0] && in reserve_sparse_super2_last_group()
2523 fs->super->s_backup_bgs[1] == old_fs->super->s_backup_bgs[1]) in reserve_sparse_super2_last_group()
2530 if (old_fs->super->s_backup_bgs[0] == last_bg || in reserve_sparse_super2_last_group()
2531 old_fs->super->s_backup_bgs[1] == last_bg) in reserve_sparse_super2_last_group()
2582 if (ext2fs_test_block_bitmap2(old_fs->block_map, blk) && in reserve_sparse_super2_last_group()