Many files:
bmove.c (ext2fs_move_blocks): New function which takes a bitmap of
blocks which need to be moved, and moves those blocks to another
location in the filesystem.
rs_bitmap.c (ext2fs_resize_generic_bitmap): When expanding a bitmap,
make sure all of the new parts of the bitmap are zero.
bitmaps.c (ext2fs_copy_bitmap): Fix bug; the destination bitmap wasn't
being returned to the caller.
alloc_tables.c (ext2fs_allocate_group_table): Add new function
ext2fs_allocate_group_table() which sets the group tables for a
particular block group. The relevant code was factored out of
ext2fs_allocate_tables().
dblist.c (make_dblist): Adjust the initial size of the directory block
list to be a bit more realize (ten plus twice the number of
directories in the filesystem).
Check in interim work.
diff --git a/resize/main.c b/resize/main.c
index b664664..d8b2200 100644
--- a/resize/main.c
+++ b/resize/main.c
@@ -49,13 +49,13 @@
device_name = argv[optind++];
new_size = atoi(argv[optind++]);
initialize_ext2_error_table();
-#if 1
+#if 0
io_ptr = unix_io_manager;
#else
io_ptr = test_io_manager;
test_io_backing_manager = unix_io_manager;
#endif
- retval = ext2fs_open (device_name, 0, 0, 0,
+ retval = ext2fs_open (device_name, EXT2_FLAG_RW, 0, 0,
io_ptr, &fs);
if (retval) {
com_err (program_name, retval, "while trying to open %s",
@@ -70,7 +70,11 @@
ext2fs_close (fs);
exit (1);
}
- resize_fs(fs, new_size);
- ext2fs_close (fs);
+ retval = resize_fs(fs, new_size);
+ if (retval) {
+ com_err(program_name, retval, "while trying to resize %s",
+ device_name);
+ ext2fs_close (fs);
+ }
exit (0);
}