aboutsummaryrefslogtreecommitdiff
path: root/lib/ext2fs/rw_bitmaps.c
diff options
context:
space:
mode:
authorTheodore Ts'o <tytso@mit.edu>2001-05-03 04:02:29 +0000
committerTheodore Ts'o <tytso@mit.edu>2001-05-03 04:02:29 +0000
commita78926effb15bbabb1c0ed3e438b03be25c4d48c (patch)
tree07d507999a0d36ad6d64d4672a898e86f37728e7 /lib/ext2fs/rw_bitmaps.c
parentae8160e6921437b3a88adca505f0b56008c519b1 (diff)
downloade2fsprogs-a78926effb15bbabb1c0ed3e438b03be25c4d48c.tar.gz
Many files:
ext2fs.h (EXT2_FLAG_IMAGE_FILE): Add new flag, and add image_header field in the ext2_filsys structure block.c (block_iterate_ind, block_iterate_dind, block_iterate_tind): inode.c (ext2fs_read_inode): rw_bitmaps.c (read_bitmaps): openfs.c (ext2fs_open): Add support for EXT2_FLAG_IMAGE_FILE imager.c (ext2fs_image_bitmap_read): Fix bug in imager to make sure the full bitmap is saved.
Diffstat (limited to 'lib/ext2fs/rw_bitmaps.c')
-rw-r--r--lib/ext2fs/rw_bitmaps.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/lib/ext2fs/rw_bitmaps.c b/lib/ext2fs/rw_bitmaps.c
index 73979fdb..093dddf4 100644
--- a/lib/ext2fs/rw_bitmaps.c
+++ b/lib/ext2fs/rw_bitmaps.c
@@ -30,6 +30,7 @@
#endif
#include "ext2fs.h"
+#include "e2image.h"
#ifdef __powerpc__
/*
@@ -188,6 +189,28 @@ static errcode_t read_bitmaps(ext2_filsys fs, int do_inode, int do_block)
}
ext2fs_free_mem((void **) &buf);
+ if (fs->flags & EXT2_FLAG_IMAGE_FILE) {
+ if (inode_bitmap) {
+ blk = (fs->image_header->offset_inodemap /
+ fs->blocksize);
+ retval = io_channel_read_blk(fs->io, blk,
+ -(inode_nbytes * fs->group_desc_count),
+ inode_bitmap);
+ if (retval)
+ goto cleanup;
+ }
+ if (block_bitmap) {
+ blk = (fs->image_header->offset_blockmap /
+ fs->blocksize);
+ retval = io_channel_read_blk(fs->io, blk,
+ -(block_nbytes * fs->group_desc_count),
+ block_bitmap);
+ if (retval)
+ goto cleanup;
+ }
+ return 0;
+ }
+
for (i = 0; i < fs->group_desc_count; i++) {
if (block_bitmap) {
blk = fs->group_desc[i].bg_block_bitmap;