Home | History | Annotate | Download | only in resize

Lines Matching refs:rfs

45 static errcode_t adjust_superblock(ext2_resize_t rfs, blk64_t new_size);
46 static errcode_t blocks_to_move(ext2_resize_t rfs);
47 static errcode_t block_mover(ext2_resize_t rfs);
48 static errcode_t inode_scan_and_fix(ext2_resize_t rfs);
49 static errcode_t inode_ref_fix(ext2_resize_t rfs);
50 static errcode_t move_itables(ext2_resize_t rfs);
56 static errcode_t clear_sparse_super2_last_group(ext2_resize_t rfs);
57 static errcode_t reserve_sparse_super2_last_group(ext2_resize_t rfs,
59 static errcode_t resize_group_descriptors(ext2_resize_t rfs, blk64_t new_size);
60 static errcode_t move_bg_metadata(ext2_resize_t rfs);
61 static errcode_t zero_high_bits_in_inodes(ext2_resize_t rfs);
98 errcode_t (*progress)(ext2_resize_t rfs, int pass,
102 ext2_resize_t rfs;
109 retval = ext2fs_get_mem(sizeof(struct ext2_resize_struct), &rfs);
113 memset(rfs, 0, sizeof(struct ext2_resize_struct));
114 fs->priv_data = rfs;
115 rfs->old_fs = fs;
116 rfs->flags = flags;
117 rfs->itable_buf = 0;
118 rfs->progress = progress;
125 print_resource_track(rfs, &rtrack, fs->io);
133 print_resource_track(rfs, &rtrack, fs->io);
134 retval = ext2fs_dup_handle(fs, &rfs->new_fs);
139 retval = resize_group_descriptors(rfs, *new_size);
142 print_resource_track(rfs, &rtrack, fs->io);
145 retval = move_bg_metadata(rfs);
148 print_resource_track(rfs, &rtrack, fs->io);
151 retval = zero_high_bits_in_inodes(rfs);
154 print_resource_track(rfs, &rtrack, fs->io);
157 retval = adjust_superblock(rfs, *new_size);
160 print_resource_track(rfs, &rtrack, fs->io);
163 fix_uninit_block_bitmaps(rfs->new_fs);
164 print_resource_track(rfs, &rtrack, fs->io);
166 ext2fs_bg_flags_clear(rfs->new_fs, rfs->new_fs->group_desc_count - 1,
169 *new_size = ext2fs_blocks_count(rfs->new_fs->super);
172 retval = blocks_to_move(rfs);
175 print_resource_track(rfs, &rtrack, fs->io);
178 if (rfs->flags & RESIZE_DEBUG_BMOVE)
180 ext2fs_free_blocks_count(rfs->old_fs->super),
181 ext2fs_free_blocks_count(rfs->new_fs->super),
182 rfs->needed_blocks);
186 retval = block_mover(rfs);
189 print_resource_track(rfs, &rtrack, fs->io);
192 retval = inode_scan_and_fix(rfs);
195 print_resource_track(rfs, &rtrack, fs->io);
198 retval = inode_ref_fix(rfs);
201 print_resource_track(rfs, &rtrack, fs->io);
204 retval = move_itables(rfs);
207 print_resource_track(rfs, &rtrack, fs->io);
209 retval = clear_sparse_super2_last_group(rfs);
214 retval = ext2fs_calculate_summary_stats(rfs->new_fs);
217 print_resource_track(rfs, &rtrack, fs->io);
220 retval = fix_resize_inode(rfs->new_fs);
223 print_resource_track(rfs, &rtrack, fs->io);
226 retval = fix_sb_journal_backup(rfs->new_fs);
229 print_resource_track(rfs, &rtrack, fs->io);
231 retval = ext2fs_set_gdt_csum(rfs->new_fs);
235 rfs->new_fs->super->s_state &= ~EXT2_ERROR_FS;
236 rfs->new_fs->flags &= ~EXT2_FLAG_MASTER_SB_ONLY;
238 print_resource_track(rfs, &overall_track, fs->io);
239 retval = ext2fs_close_free(&rfs->new_fs);
243 rfs->flags = flags;
245 ext2fs_free(rfs->old_fs);
246 rfs->old_fs = NULL;
247 if (rfs->itable_buf)
248 ext2fs_free_mem(&rfs->itable_buf);
249 if (rfs->reserve_blocks)
250 ext2fs_free_block_bitmap(rfs->reserve_blocks);
251 if (rfs->move_blocks)
252 ext2fs_free_block_bitmap(rfs->move_blocks);
253 ext2fs_free_mem(&rfs);
258 if (rfs->new_fs) {
259 ext2fs_free(rfs->new_fs);
260 rfs->new_fs = NULL;
262 if (rfs->itable_buf)
263 ext2fs_free_mem(&rfs->itable_buf);
264 ext2fs_free_mem(&rfs);
286 static errcode_t resize_group_descriptors(ext2_resize_t rfs, blk64_t new_size)
293 if (!(rfs->flags & (RESIZE_DISABLE_64BIT | RESIZE_ENABLE_64BIT)))
296 if (new_size != ext2fs_blocks_count(rfs->new_fs->super) ||
297 ext2fs_blocks_count(rfs->new_fs->super) >= (1ULL << 32) ||
298 (rfs->flags & RESIZE_DISABLE_64BIT &&
299 rfs->flags & RESIZE_ENABLE_64BIT))
302 if (rfs->flags & RESIZE_DISABLE_64BIT) {
303 ext2fs_clear_feature_64bit(rfs->new_fs->super);
304 rfs->new_fs->super->s_desc_size = EXT2_MIN_DESC_SIZE;
305 } else if (rfs->flags & RESIZE_ENABLE_64BIT) {
306 ext2fs_set_feature_64bit(rfs->new_fs->super);
307 rfs->new_fs->super->s_desc_size = EXT2_MIN_DESC_SIZE_64BIT;
310 if (EXT2_DESC_SIZE(rfs->old_fs->super) ==
311 EXT2_DESC_SIZE(rfs->new_fs->super))
314 o = rfs->new_fs->group_desc;
315 rfs->new_fs->desc_blocks = ext2fs_div_ceil(
316 rfs->old_fs->group_desc_count,
317 EXT2_DESC_PER_BLOCK(rfs->new_fs->super));
318 retval = ext2fs_get_arrayzero(rfs->new_fs->desc_blocks,
319 rfs->old_fs->blocksize, &new_group_desc);
325 if (EXT2_DESC_SIZE(rfs->old_fs->super) <=
326 EXT2_DESC_SIZE(rfs->new_fs->super))
327 copy_size = EXT2_DESC_SIZE(rfs->old_fs->super);
329 copy_size = EXT2_DESC_SIZE(rfs->new_fs->super);
330 for (i = 0; i < rfs->old_fs->group_desc_count; i++) {
332 n = (char *)n + EXT2_DESC_SIZE(rfs->new_fs->super);
333 o = (char *)o + EXT2_DESC_SIZE(rfs->old_fs->super);
336 ext2fs_free_mem(&rfs->new_fs->group_desc);
337 rfs->new_fs->group_desc = new_group_desc;
339 for (i = 0; i < rfs->old_fs->group_desc_count; i++)
340 ext2fs_group_desc_csum_set(rfs->new_fs, i);
342 adjust_reserved_gdt_blocks(rfs->old_fs, rfs->new_fs);
348 static errcode_t move_bg_metadata(ext2_resize_t rfs)
357 if (!(rfs->flags & (RESIZE_DISABLE_64BIT | RESIZE_ENABLE_64BIT)))
360 retval = ext2fs_allocate_block_bitmap(rfs->old_fs, "oldfs", &old_map);
364 retval = ext2fs_allocate_block_bitmap(rfs->new_fs, "newfs", &new_map);
368 if (ext2fs_has_feature_meta_bg(rfs->old_fs->super)) {
369 old_desc_blocks = rfs->old_fs->super->s_first_meta_bg;
370 new_desc_blocks = rfs->new_fs->super->s_first_meta_bg;
372 old_desc_blocks = rfs->old_fs->desc_blocks +
373 rfs->old_fs->super->s_reserved_gdt_blocks;
374 new_desc_blocks = rfs->new_fs->desc_blocks +
375 rfs->new_fs->super->s_reserved_gdt_blocks;
379 for (i = 0; i < rfs->old_fs->group_desc_count; i++) {
380 retval = ext2fs_super_and_bgd_loc2(rfs->old_fs, i, &b, &c, &d,
391 retval = ext2fs_super_and_bgd_loc2(rfs->new_fs, i, &b, &c, &d,
403 cluster_ratio = EXT2FS_CLUSTER_RATIO(rfs->new_fs);
406 for (b = EXT2FS_B2C(rfs->old_fs,
407 rfs->old_fs->super->s_first_data_block);
408 b < ext2fs_blocks_count(rfs->new_fs->super);
417 rfs->new_fs->block_map, b);
435 for (i = 0; i < rfs->old_fs->group_desc_count; i++) {
436 b = ext2fs_block_bitmap_loc(rfs->new_fs, i);
438 ext2fs_block_bitmap_loc_set(rfs->new_fs, i, 0);
442 b = ext2fs_inode_bitmap_loc(rfs->new_fs, i);
444 ext2fs_inode_bitmap_loc_set(rfs->new_fs, i, 0);
448 c = ext2fs_inode_table_loc(rfs->new_fs, i);
450 b < rfs->new_fs->inode_blocks_per_group;
453 ext2fs_inode_table_loc_set(rfs->new_fs, i, 0);
461 cluster_ratio > 1 && b < ext2fs_blocks_count(rfs->new_fs->super);
464 ext2fs_unmark_block_bitmap2(rfs->new_fs->block_map, b);
512 static errcode_t zero_high_bits_in_inodes(ext2_resize_t rfs)
514 ext2_filsys fs = rfs->old_fs;
521 if (!(rfs->flags & (RESIZE_DISABLE_64BIT | RESIZE_ENABLE_64BIT)))
1024 static errcode_t adjust_superblock(ext2_resize_t rfs, blk64_t new_size)
1026 ext2_filsys fs = rfs->new_fs;
1038 &rfs->reserve_blocks);
1042 retval = adjust_fs_info(fs, rfs->old_fs, rfs->reserve_blocks, new_size);
1049 if ((rfs->old_fs->super->s_inodes_count -
1050 rfs->old_fs->super->s_free_inodes_count) >
1051 rfs->new_fs->super->s_inodes_count) {
1060 if (rfs->old_fs->group_desc_count > fs->group_desc_count) {
1070 if (rfs->old_fs->group_desc_count >= fs->group_desc_count) {
1089 &rfs->itable_buf);
1093 memset(rfs->itable_buf, 0, fs->blocksize * fs->inode_blocks_per_group);
1095 rfs->old_fs->group_desc_count);
1096 adj = rfs->old_fs->group_desc_count;
1098 if (rfs->progress) {
1099 retval = rfs->progress(rfs, E2_RSZ_EXTEND_ITABLE_PASS,
1104 for (i = rfs->old_fs->group_desc_count;
1116 if (rfs->progress) {
1117 retval = rfs->progress(rfs, E2_RSZ_EXTEND_ITABLE_PASS,
1186 static void mark_fs_metablock(ext2_resize_t rfs,
1190 ext2_filsys fs = rfs->new_fs;
1192 ext2fs_mark_block_bitmap2(rfs->reserve_blocks, blk);
1202 rfs->needed_blocks++;
1207 rfs->needed_blocks++;
1212 rfs->needed_blocks++;
1218 for (i = 0; i < rfs->old_fs->group_desc_count; i++) {
1221 rfs->needed_blocks++;
1226 rfs->needed_blocks++;
1231 rfs->needed_blocks++;
1244 } else if (ext2fs_test_block_bitmap2(rfs->old_fs->block_map, blk) &&
1246 ext2fs_mark_block_bitmap2(rfs->move_blocks, blk);
1247 rfs->needed_blocks++;
1257 static errcode_t blocks_to_move(ext2_resize_t rfs)
1271 fs = rfs->new_fs;
1272 old_fs = rfs->old_fs;
1274 fs = rfs->old_fs;
1277 &rfs->move_blocks);
1290 fs = rfs->new_fs;
1346 ext2fs_mark_block_bitmap2(rfs->move_blocks, blk);
1347 rfs->needed_blocks++;
1349 ext2fs_mark_block_bitmap2(rfs->reserve_blocks, blk);
1362 retval = reserve_sparse_super2_last_group(rfs, meta_bmap);
1366 if (EXT2_DESC_SIZE(rfs->old_fs->super) ==
1367 EXT2_DESC_SIZE(rfs->new_fs->super) &&
1414 rfs->needed_blocks -= cluster_freed;
1417 rfs->needed_blocks--;
1435 mark_fs_metablock(rfs, meta_bmap, i, group_blk);
1443 mark_fs_metablock(rfs, meta_bmap,
1452 mark_fs_metablock(rfs, meta_bmap, i,
1467 ext2fs_mark_block_bitmap2(rfs->reserve_blocks,
1470 ext2fs_mark_block_bitmap2(rfs->reserve_blocks,
1474 ext2fs_mark_block_bitmap2(rfs->reserve_blocks,
1477 ext2fs_mark_block_bitmap2(rfs->reserve_blocks,
1481 ext2fs_mark_block_bitmap_range2(rfs->reserve_blocks,
1485 ext2fs_mark_block_bitmap_range2(rfs->reserve_blocks,
1489 group_blk += rfs->new_fs->super->s_blocks_per_group;
1500 rfs->reserve_blocks);
1513 ext2fs_mark_block_bitmap2(rfs->move_blocks,
1521 ext2fs_mark_block_bitmap2(rfs->move_blocks,
1535 rfs->needed_blocks += fs->inode_blocks_per_group;
1547 ext2fs_mark_block_bitmap2(rfs->move_blocks,
1555 for (blk = ext2fs_inode_table_loc(rfs->old_fs, i), j=0;
1557 ext2fs_mark_block_bitmap2(rfs->reserve_blocks, blk);
1587 static void init_block_alloc(ext2_resize_t rfs)
1589 rfs->alloc_state = AVOID_OLD;
1590 rfs->new_blk = rfs->new_fs->super->s_first_data_block;
1593 if (ext2fs_blocks_count(rfs->new_fs->super) >
1594 ext2fs_blocks_count(rfs->old_fs->super))
1595 rfs->new_blk = ext2fs_blocks_count(rfs->old_fs->super);
1599 static blk64_t get_new_block(ext2_resize_t rfs)
1601 ext2_filsys fs = rfs->new_fs;
1604 if (rfs->new_blk >= ext2fs_blocks_count(fs->super)) {
1605 if (rfs->alloc_state == DESPERATION)
1609 if (rfs->flags & RESIZE_DEBUG_BMOVE)
1613 rfs->alloc_state = DESPERATION;
1614 rfs->new_blk = fs->super->s_first_data_block;
1617 if (ext2fs_test_block_bitmap2(fs->block_map, rfs->new_blk) ||
1618 ext2fs_test_block_bitmap2(rfs->reserve_blocks,
1619 rfs->new_blk) ||
1620 ((rfs->alloc_state == AVOID_OLD) &&
1621 (rfs->new_blk < ext2fs_blocks_count(rfs->old_fs->super)) &&
1622 ext2fs_test_block_bitmap2(rfs->old_fs->block_map,
1623 rfs->new_blk))) {
1624 rfs->new_blk++;
1627 return rfs->new_blk;
1635 ext2_resize_t rfs = (ext2_resize_t) fs->priv_data;
1639 blk = get_new_block(rfs);
1644 if (rfs->flags & 0xF)
1648 ext2fs_mark_block_bitmap2(rfs->old_fs->block_map, blk);
1649 ext2fs_mark_block_bitmap2(rfs->new_fs->block_map, blk);
1651 group = ext2fs_group_of_blk2(rfs->old_fs, blk);
1652 ext2fs_clear_block_uninit(rfs->old_fs, group);
1653 group = ext2fs_group_of_blk2(rfs->new_fs, blk);
1654 ext2fs_clear_block_uninit(rfs->new_fs, group);
1660 static errcode_t block_mover(ext2_resize_t rfs)
1663 ext2_filsys fs = rfs->new_fs;
1664 ext2_filsys old_fs = rfs->old_fs;
1679 if (!rfs->itable_buf) {
1682 &rfs->itable_buf);
1686 retval = ext2fs_create_extent_table(&rfs->bmap, 0);
1695 init_block_alloc(rfs);
1701 if (!ext2fs_test_block_bitmap2(rfs->move_blocks, blk))
1709 new_blk = get_new_block(rfs);
1715 ext2fs_add_extent_entry(rfs->bmap, B2C(blk), B2C(new_blk));
1720 if (rfs->bmap) {
1721 ext2fs_free_extent_table(rfs->bmap);
1722 rfs->bmap = 0;
1731 retval = ext2fs_iterate_extent(rfs->bmap, 0, 0, 0);
1734 if (rfs->progress) {
1735 retval = (rfs->progress)(rfs, E2_RSZ_BLOCK_RELOC_PASS,
1741 retval = ext2fs_iterate_extent(rfs->bmap, &old_blk, &new_blk, &size);
1749 if (rfs->flags & RESIZE_DEBUG_BMOVE)
1758 rfs->itable_buf);
1761 rfs->itable_buf);
1767 if (rfs->progress) {
1769 retval = (rfs->progress)(rfs,
1813 ext2_resize_t rfs;
1835 if (pb->rfs->bmap) {
1836 new_block = extent_translate(fs, pb->rfs->bmap, block);
1842 if (pb->rfs->flags & RESIZE_DEBUG_BMOVE)
1869 ext2_resize_t rfs = (ext2_resize_t) priv_data;
1879 if (rfs->progress) {
1881 retval = (rfs->progress)(rfs, E2_RSZ_INODE_SCAN_PASS,
1890 static errcode_t migrate_ea_block(ext2_resize_t rfs, ext2_ino_t ino,
1898 if (ext2fs_file_acl_block(rfs->old_fs, inode) == 0 || !rfs->bmap)
1900 new_block = extent_translate(rfs->old_fs, rfs->bmap,
1901 ext2fs_file_acl_block(rfs->old_fs, inode));
1906 ext2fs_file_acl_block_set(rfs->old_fs, inode, new_block);
1909 if (ext2fs_has_feature_metadata_csum(rfs->new_fs->super)) {
1910 err = ext2fs_get_mem(rfs->old_fs->blocksize, &buf);
1913 rfs->old_fs->flags |= EXT2_FLAG_IGNORE_CSUM_ERRORS;
1914 err = ext2fs_read_ext_attr3(rfs->old_fs, new_block, buf, ino);
1915 rfs->old_fs->flags &= ~EXT2_FLAG_IGNORE_CSUM_ERRORS;
1918 err = ext2fs_write_ext_attr3(rfs->old_fs, new_block, buf, ino);
1989 static errcode_t inode_scan_and_fix(ext2_resize_t rfs)
2000 if ((rfs->old_fs->group_desc_count <=
2001 rfs->new_fs->group_desc_count) &&
2002 !rfs->bmap)
2007 retval = ext2fs_open_inode_scan(rfs->old_fs, 0, &scan);
2010 retval = ext2fs_init_dblist(rfs->old_fs, 0);
2012 retval = ext2fs_get_array(rfs->old_fs->blocksize, 3, &block_buf);
2015 start_to_move = (rfs->new_fs->group_desc_count *
2016 rfs->new_fs->super->s_inodes_per_group);
2018 if (rfs->progress) {
2019 retval = (rfs->progress)(rfs, E2_RSZ_INODE_SCAN_PASS,
2020 0, rfs->old_fs->group_desc_count);
2024 ext2fs_set_inode_callback(scan, progress_callback, (void *) rfs);
2025 pb.rfs = rfs;
2028 new_inode = EXT2_FIRST_INODE(rfs->new_fs->super);
2029 inode_size = EXT2_INODE_SIZE(rfs->new_fs->super);
2052 retval = migrate_ea_block(rfs, ino, inode, &pb.changed);
2065 retval = ext2fs_new_inode(rfs->new_fs, 0, 0, 0, &new_inode);
2069 ext2fs_inode_alloc_stats2(rfs->new_fs, new_inode, +1,
2072 retval = ext2fs_write_inode_full(rfs->old_fs, new_inode,
2079 if (rfs->flags & RESIZE_DEBUG_INODEMAP)
2082 if (!rfs->imap) {
2083 retval = ext2fs_create_extent_table(&rfs->imap, 0);
2087 ext2fs_add_extent_entry(rfs->imap, ino, new_inode);
2091 retval = ext2fs_write_inode_full(rfs->old_fs,
2098 if (ext2fs_has_feature_metadata_csum(rfs->old_fs->super) &&
2100 rfs->old_fs->flags |= EXT2_FLAG_IGNORE_CSUM_ERRORS;
2101 retval = rewrite_extents(rfs->old_fs, new_inode);
2102 rfs->old_fs->flags &= ~EXT2_FLAG_IGNORE_CSUM_ERRORS;
2112 if (ext2fs_inode_has_valid_blocks2(rfs->old_fs, inode) &&
2113 (rfs->bmap || pb.is_dir)) {
2117 rfs->old_fs->flags |= EXT2_FLAG_IGNORE_CSUM_ERRORS;
2118 retval = ext2fs_block_iterate3(rfs->old_fs,
2121 rfs->old_fs->flags &= ~EXT2_FLAG_IGNORE_CSUM_ERRORS;
2129 (rfs->bmap || pb.is_dir)) {
2131 retval = ext2fs_add_dir_block2(rfs->old_fs->dblist,
2137 io_channel_flush(rfs->old_fs->io);
2141 if (rfs->bmap) {
2142 ext2fs_free_extent_table(rfs->bmap);
2143 rfs->bmap = 0;
2161 ext2_resize_t rfs;
2180 if (is->rfs->progress && offset == 0) {
2181 io_channel_flush(is->rfs->old_fs->io);
2182 is->err = (is->rfs->progress)(is->rfs,
2193 if (ext2fs_has_feature_metadata_csum(is->rfs->old_fs->super) &&
2194 !ext2fs_test_inode_bitmap2(is->rfs->old_fs->inode_map, dir))
2200 new_inode = ext2fs_extent_translate(is->rfs->imap, dirent->inode);
2205 if (is->rfs->flags & RESIZE_DEBUG_INODEMAP)
2214 retval = ext2fs_read_inode(is->rfs->old_fs, dir, &inode);
2217 is->err = ext2fs_write_inode(is->rfs->old_fs, dir, &inode);
2225 static errcode_t inode_ref_fix(ext2_resize_t rfs)
2230 if (!rfs->imap)
2238 is.max_dirs = ext2fs_dblist_count2(rfs->old_fs->dblist);
2239 is.rfs = rfs;
2242 if (rfs->progress) {
2243 retval = (rfs->progress)(rfs, E2_RSZ_INODE_REF_UPD_PASS,
2249 rfs->old_fs->flags |= EXT2_FLAG_IGNORE_CSUM_ERRORS;
2250 retval = ext2fs_dblist_dir_iterate(rfs->old_fs->dblist,
2253 rfs->old_fs->flags &= ~EXT2_FLAG_IGNORE_CSUM_ERRORS;
2261 if (rfs->progress && (is.num < is.max_dirs))
2262 (rfs->progress)(rfs, E2_RSZ_INODE_REF_UPD_PASS,
2266 ext2fs_free_extent_table(rfs->imap);
2267 rfs->imap = 0;
2289 * After this you have to use the rfs->new_fs file handle to read and
2292 static errcode_t move_itables(ext2_resize_t rfs)
2297 ext2_filsys fs = rfs->new_fs;
2306 if (max_groups > rfs->old_fs->group_desc_count)
2307 max_groups = rfs->old_fs->group_desc_count;
2310 if (!rfs->itable_buf) {
2311 retval = ext2fs_get_mem(size, &rfs->itable_buf);
2332 if (ext2fs_inode_table_loc(rfs->old_fs, i) !=
2341 if (rfs->progress) {
2342 retval = rfs->progress(rfs, E2_RSZ_MOVE_ITABLE_PASS,
2348 rfs->old_fs->flags |= EXT2_FLAG_MASTER_SB_ONLY;
2351 old_blk = ext2fs_inode_table_loc(rfs->old_fs, i);
2356 if (rfs->flags & RESIZE_DEBUG_ITABLEMOVE)
2368 rfs->itable_buf);
2378 for (cp = rfs->itable_buf+size-1, n=0; n < size; n++, cp--)
2383 if (rfs->flags & RESIZE_DEBUG_ITABLEMOVE)
2391 num, rfs->itable_buf);
2394 num, rfs->itable_buf);
2400 diff, (rfs->itable_buf +
2407 for (blk = ext2fs_inode_table_loc(rfs->old_fs, i), j=0;
2422 ext2fs_inode_table_loc_set(rfs->old_fs, i, new_blk);
2423 ext2fs_group_desc_csum_set(rfs->old_fs, i);
2424 ext2fs_mark_super_dirty(rfs->old_fs);
2425 ext2fs_flush(rfs->old_fs);
2427 if (rfs->progress) {
2428 retval = rfs->progress(rfs, E2_RSZ_MOVE_ITABLE_PASS,
2437 if (rfs->flags & RESIZE_DEBUG_ITABLEMOVE)
2453 static errcode_t clear_sparse_super2_last_group(ext2_resize_t rfs)
2455 ext2_filsys fs = rfs->new_fs;
2456 ext2_filsys old_fs = rfs->old_fs;
2458 dgrp_t old_last_bg = rfs->old_fs->group_desc_count - 1;
2484 retval = ext2fs_super_and_bgd_loc2(rfs->old_fs, old_last_bg,
2503 static errcode_t reserve_sparse_super2_last_group(ext2_resize_t rfs,
2506 ext2_filsys fs = rfs->new_fs;
2507 ext2_filsys old_fs = rfs->old_fs;
2509 dgrp_t old_last_bg = rfs->old_fs->group_desc_count - 1;
2534 retval = ext2fs_super_and_bgd_loc2(rfs->new_fs, last_bg,
2584 ext2fs_mark_block_bitmap2(rfs->move_blocks, blk);
2585 rfs->needed_blocks++;
2587 ext2fs_mark_block_bitmap2(rfs->reserve_blocks, blk);