Update of /cvsroot/ext2resize/ext2resize/src
In directory sc8-pr-cvs5.sourceforge.net:/tmp/cvs-serv23746/src
Modified Files:
ext2.c
Log Message:
Fix ext2_move_blocks() to not move overlapping block ranges.
Handle large inodes.
Don't always print message about itable offsets.
Index: ext2.c
===================================================================
RCS file: /cvsroot/ext2resize/ext2resize/src/ext2.c,v
retrieving revision 1.30
retrieving revision 1.31
diff -C2 -d -r1.30 -r1.31
*** ext2.c 9 May 2005 05:46:52 -0000 1.30
--- ext2.c 5 Jun 2006 05:36:04 -0000 1.31
***************
*** 129,138 ****
free(buf);
! } else if (src > dest)
for (i = 0; i < num; i++)
ext2_copy_block(fs, src + i, dest + i);
! else
! for (i = num - 1; i >= 0; i--)
! ext2_copy_block(fs, src + i, dest + i);
}
--- 129,139 ----
free(buf);
! } else if (src > dest) {
for (i = 0; i < num; i++)
ext2_copy_block(fs, src + i, dest + i);
! } else {
! for (i = num; i > 0; i--)
! ext2_copy_block(fs, src + i - 1, dest + i - 1);
! }
}
***************
*** 220,224 ****
group = inode / fs->sb.s_inodes_per_group;
! offset = (inode % fs->sb.s_inodes_per_group) * sizeof(struct ext2_inode);
*block = fs->gd[group].bg_inode_table + (offset >> fs->logsize);
--- 221,227 ----
group = inode / fs->sb.s_inodes_per_group;
! offset = (inode % fs->sb.s_inodes_per_group) *
! (fs->sb.s_rev_level == EXT2_GOOD_OLD_REV ?
! EXT2_GOOD_OLD_INODE_SIZE : fs->sb.s_inode_size);
*block = fs->gd[group].bg_inode_table + (offset >> fs->logsize);
***************
*** 294,298 ****
__u32 *udata;
blk_t curblock;
! int count = 0;
int i;
int i512perblock = 1 << (fs->logsize - 9);
--- 297,301 ----
__u32 *udata;
blk_t curblock;
! __u32 count = 0;
int i;
int i512perblock = 1 << (fs->logsize - 9);
***************
*** 741,758 ****
"group %d inode bitmap has offset %d, not %d\n",
group, fs->gd[group].bg_inode_bitmap, ib);
! if (fs->gd[group].bg_inode_table != it) {
fprintf(stderr,
"group %d inode table has offset %d, not %d\n",
group, fs->gd[group].bg_inode_table-start,
it-start);
- /*
- fprintf(stderr,
- "This ext2 filesystem has a strange layout!\n"
- "Please use dumpe2fs and send output to: "
- "<ext...@li...>.\n"
- "I won't resize it, sorry.\n");
- return 0;
- */
- }
}
--- 744,752 ----
"group %d inode bitmap has offset %d, not %d\n",
group, fs->gd[group].bg_inode_bitmap, ib);
! if (fs->gd[group].bg_inode_table != it && fs->flags & FL_DEBUG)
fprintf(stderr,
"group %d inode table has offset %d, not %d\n",
group, fs->gd[group].bg_inode_table-start,
it-start);
}
|