Whamcloud - gitweb
Disconnect e4defrag from build on non-Linux hosts.
[tools/e2fsprogs.git] / misc / e2image.c
index abbf641..0ee2b1e 100644 (file)
@@ -267,8 +267,8 @@ static void mark_table_blocks(ext2_filsys fs)
                /*
                 * Mark the blocks used for the inode table
                 */
-               if (fs->group_desc[i].bg_inode_table) {
-                       for (j = 0, b = fs->group_desc[i].bg_inode_table;
+               if (ext2fs_inode_table_loc(fs, i)) {
+                       for (j = 0, b = ext2fs_inode_table_loc(fs, i);
                             j < (unsigned) fs->inode_blocks_per_group;
                             j++, b++)
                                ext2fs_mark_block_bitmap2(meta_block_map, b);
@@ -277,17 +277,17 @@ static void mark_table_blocks(ext2_filsys fs)
                /*
                 * Mark block used for the block bitmap
                 */
-               if (fs->group_desc[i].bg_block_bitmap) {
+               if (ext2fs_block_bitmap_loc(fs, i)) {
                        ext2fs_mark_block_bitmap2(meta_block_map,
-                                    fs->group_desc[i].bg_block_bitmap);
+                                    ext2fs_block_bitmap_loc(fs, i));
                }
 
                /*
                 * Mark block used for the inode bitmap
                 */
-               if (fs->group_desc[i].bg_inode_bitmap) {
+               if (ext2fs_inode_bitmap_loc(fs, i)) {
                        ext2fs_mark_block_bitmap2(meta_block_map,
-                                fs->group_desc[i].bg_inode_bitmap);
+                                ext2fs_inode_bitmap_loc(fs, i));
                }
        }
 }
@@ -421,7 +421,7 @@ static void output_meta_data_blocks(ext2_filsys fs, int fd)
                exit(1);
        }
        memset(zero_buf, 0, fs->blocksize);
-       for (blk = 0; blk < fs->super->s_blocks_count; blk++) {
+       for (blk = 0; blk < ext2fs_blocks_count(fs->super); blk++) {
                if ((blk >= fs->super->s_first_data_block) &&
                    ext2fs_test_block_bitmap2(meta_block_map, blk)) {
                        retval = io_channel_read_blk64(fs->io, blk, 1, buf);