Lines Matching refs:newsize
326 static int ext2_grow_group(struct ext2_fs *fs, blk_t newsize)
343 if (newsize < gblocks)
351 if (gblocks == newsize)
358 for (i=gblocks;i<newsize;i++)
362 EXT2_SUPER_BLOCKS_COUNT(fs->sb) + newsize - gblocks);
371 static int ext2_shrink_group(struct ext2_fs *fs, blk_t newsize)
394 if (newsize < admin)
398 "to %i blocks\n", newsize);
403 if (newsize > gblocks)
411 if (gblocks == newsize)
420 for (i=newsize;i<gblocks;i++)
435 i = gblocks - newsize;
456 static int ext2_grow_fs(struct ext2_fs *fs, blk_t newsize, PedTimer* timer)
465 if (!ext2_block_relocate(fs, newsize))
468 if (!ext2_metadata_push(fs, newsize))
471 diff = newsize - EXT2_SUPER_BLOCKS_COUNT(fs->sb);
496 1.0 - 1.0 * diff / (newsize - origsize));
510 static int ext2_shrink_fs(struct ext2_fs *fs, blk_t newsize,
521 newgroups = ped_div_round_up (newsize
525 - EXT2_SUPER_FREE_BLOCKS_COUNT(fs->sb) > newsize)
529 "blocks. Sorry."), newsize);
539 "resize it to %i blocks. Sorry."), newsize);
546 if (!ext2_block_relocate(fs, newsize))
549 diff = EXT2_SUPER_BLOCKS_COUNT(fs->sb) - newsize;
557 1.0 - 1.0 * diff / (origsize - newsize));
649 int ext2_resize_fs(struct ext2_fs *fs, blk_t newsize, PedTimer* timer)
705 residue = (newsize - EXT2_SUPER_FIRST_DATA_BLOCK(fs->sb))
708 newsize -= residue;
710 if (newsize == EXT2_SUPER_BLOCKS_COUNT(fs->sb))
720 if (newsize < EXT2_SUPER_BLOCKS_COUNT(fs->sb))
721 status = ext2_shrink_fs(fs, newsize, timer);
723 status = ext2_grow_fs(fs, newsize, timer);