Blame SOURCES/e2fsprogs-1.45.6-Revert-libext2fs-revamp-bitmap-types-to-fix-LTO-warn.patch

1e8c27
From 1c25e64066e861f273b785b06ef3bc7636552eab Mon Sep 17 00:00:00 2001
393826
From: Lukas Czerner <lczerner@redhat.com>
393826
Date: Tue, 14 Jan 2020 09:49:19 +0100
1e8c27
Subject: [PATCH 5/7] Revert "libext2fs: revamp bitmap types to fix LTO
393826
 warnings"
393826
393826
This reverts commit 83d9ffccf3ee6ad4e165eeb6912acf1f6149be28 because it
393826
breaks ABI.
393826
393826
Signed-off-by: Lukas Czerner <lczerner@redhat.com>
393826
---
393826
 lib/ext2fs/bitmaps.c      |   6 +-
393826
 lib/ext2fs/blkmap64_ba.c  |  38 ++++----
393826
 lib/ext2fs/blkmap64_rb.c  |  38 ++++----
393826
 lib/ext2fs/bmap64.h       |  38 ++++----
393826
 lib/ext2fs/ext2fs.h       |  11 +--
393826
 lib/ext2fs/gen_bitmap.c   | 113 ++++++++---------------
393826
 lib/ext2fs/gen_bitmap64.c | 185 ++++++++++++++++----------------------
393826
 7 files changed, 173 insertions(+), 256 deletions(-)
393826
393826
diff --git a/lib/ext2fs/bitmaps.c b/lib/ext2fs/bitmaps.c
1e8c27
index 834a3962..e0b1f7cd 100644
393826
--- a/lib/ext2fs/bitmaps.c
393826
+++ b/lib/ext2fs/bitmaps.c
1e8c27
@@ -126,7 +126,6 @@ errcode_t ext2fs_allocate_subcluster_bitmap(ext2_filsys fs,
393826
 {
393826
 	__u64			start, end, real_end;
393826
 	ext2fs_generic_bitmap	bmap;
393826
-	ext2fs_generic_bitmap_64 bmap64;
393826
 	errcode_t		retval;
393826
 
393826
 	EXT2_CHECK_MAGIC(fs, EXT2_ET_MAGIC_EXT2FS_FILSYS);
1e8c27
@@ -149,15 +148,14 @@ errcode_t ext2fs_allocate_subcluster_bitmap(ext2_filsys fs,
393826
 					   end, real_end, descr, &bmap);
393826
 	if (retval)
393826
 		return retval;
393826
-	bmap64 = (ext2fs_generic_bitmap_64) bmap;
393826
-	bmap64->cluster_bits = 0;
393826
+	bmap->cluster_bits = 0;
393826
 	*ret = bmap;
393826
 	return 0;
393826
 }
393826
 
393826
 int ext2fs_get_bitmap_granularity(ext2fs_block_bitmap bitmap)
393826
 {
393826
-	ext2fs_generic_bitmap_64 bmap = (ext2fs_generic_bitmap_64) bitmap;
393826
+	ext2fs_generic_bitmap bmap = bitmap;
393826
 
393826
 	if (!EXT2FS_IS_64_BITMAP(bmap))
393826
 		return 0;
393826
diff --git a/lib/ext2fs/blkmap64_ba.c b/lib/ext2fs/blkmap64_ba.c
393826
index 85cb38d2..3707a61e 100644
393826
--- a/lib/ext2fs/blkmap64_ba.c
393826
+++ b/lib/ext2fs/blkmap64_ba.c
393826
@@ -40,7 +40,7 @@ struct ext2fs_ba_private_struct {
393826
 
393826
 typedef struct ext2fs_ba_private_struct *ext2fs_ba_private;
393826
 
393826
-static errcode_t ba_alloc_private_data (ext2fs_generic_bitmap_64 bitmap)
393826
+static errcode_t ba_alloc_private_data (ext2fs_generic_bitmap bitmap)
393826
 {
393826
 	ext2fs_ba_private bp;
393826
 	errcode_t	retval;
393826
@@ -69,7 +69,7 @@ static errcode_t ba_alloc_private_data (ext2fs_generic_bitmap_64 bitmap)
393826
 }
393826
 
393826
 static errcode_t ba_new_bmap(ext2_filsys fs EXT2FS_ATTR((unused)),
393826
-			     ext2fs_generic_bitmap_64 bitmap)
393826
+			     ext2fs_generic_bitmap bitmap)
393826
 {
393826
 	ext2fs_ba_private bp;
393826
 	errcode_t	retval;
393826
@@ -86,7 +86,7 @@ static errcode_t ba_new_bmap(ext2_filsys fs EXT2FS_ATTR((unused)),
393826
 	return 0;
393826
 }
393826
 
393826
-static void ba_free_bmap(ext2fs_generic_bitmap_64 bitmap)
393826
+static void ba_free_bmap(ext2fs_generic_bitmap bitmap)
393826
 {
393826
 	ext2fs_ba_private bp = (ext2fs_ba_private) bitmap->private;
393826
 
393826
@@ -101,8 +101,8 @@ static void ba_free_bmap(ext2fs_generic_bitmap_64 bitmap)
393826
 	bp = 0;
393826
 }
393826
 
393826
-static errcode_t ba_copy_bmap(ext2fs_generic_bitmap_64 src,
393826
-			      ext2fs_generic_bitmap_64 dest)
393826
+static errcode_t ba_copy_bmap(ext2fs_generic_bitmap src,
393826
+			      ext2fs_generic_bitmap dest)
393826
 {
393826
 	ext2fs_ba_private src_bp = (ext2fs_ba_private) src->private;
393826
 	ext2fs_ba_private dest_bp;
393826
@@ -121,7 +121,7 @@ static errcode_t ba_copy_bmap(ext2fs_generic_bitmap_64 src,
393826
 	return 0;
393826
 }
393826
 
393826
-static errcode_t ba_resize_bmap(ext2fs_generic_bitmap_64 bmap,
393826
+static errcode_t ba_resize_bmap(ext2fs_generic_bitmap bmap,
393826
 				__u64 new_end, __u64 new_real_end)
393826
 {
393826
 	ext2fs_ba_private bp = (ext2fs_ba_private) bmap->private;
393826
@@ -162,7 +162,7 @@ static errcode_t ba_resize_bmap(ext2fs_generic_bitmap_64 bmap,
393826
 
393826
 }
393826
 
393826
-static int ba_mark_bmap(ext2fs_generic_bitmap_64 bitmap, __u64 arg)
393826
+static int ba_mark_bmap(ext2fs_generic_bitmap bitmap, __u64 arg)
393826
 {
393826
 	ext2fs_ba_private bp = (ext2fs_ba_private) bitmap->private;
393826
 	blk64_t bitno = (blk64_t) arg;
393826
@@ -170,7 +170,7 @@ static int ba_mark_bmap(ext2fs_generic_bitmap_64 bitmap, __u64 arg)
393826
 	return ext2fs_set_bit64(bitno - bitmap->start, bp->bitarray);
393826
 }
393826
 
393826
-static int ba_unmark_bmap(ext2fs_generic_bitmap_64 bitmap, __u64 arg)
393826
+static int ba_unmark_bmap(ext2fs_generic_bitmap bitmap, __u64 arg)
393826
 {
393826
 	ext2fs_ba_private bp = (ext2fs_ba_private) bitmap->private;
393826
 	blk64_t bitno = (blk64_t) arg;
393826
@@ -178,7 +178,7 @@ static int ba_unmark_bmap(ext2fs_generic_bitmap_64 bitmap, __u64 arg)
393826
 	return ext2fs_clear_bit64(bitno - bitmap->start, bp->bitarray);
393826
 }
393826
 
393826
-static int ba_test_bmap(ext2fs_generic_bitmap_64 bitmap, __u64 arg)
393826
+static int ba_test_bmap(ext2fs_generic_bitmap bitmap, __u64 arg)
393826
 {
393826
 	ext2fs_ba_private bp = (ext2fs_ba_private) bitmap->private;
393826
 	blk64_t bitno = (blk64_t) arg;
393826
@@ -186,7 +186,7 @@ static int ba_test_bmap(ext2fs_generic_bitmap_64 bitmap, __u64 arg)
393826
 	return ext2fs_test_bit64(bitno - bitmap->start, bp->bitarray);
393826
 }
393826
 
393826
-static void ba_mark_bmap_extent(ext2fs_generic_bitmap_64 bitmap, __u64 arg,
393826
+static void ba_mark_bmap_extent(ext2fs_generic_bitmap bitmap, __u64 arg,
393826
 				unsigned int num)
393826
 {
393826
 	ext2fs_ba_private bp = (ext2fs_ba_private) bitmap->private;
393826
@@ -197,7 +197,7 @@ static void ba_mark_bmap_extent(ext2fs_generic_bitmap_64 bitmap, __u64 arg,
393826
 		ext2fs_fast_set_bit64(bitno + i - bitmap->start, bp->bitarray);
393826
 }
393826
 
393826
-static void ba_unmark_bmap_extent(ext2fs_generic_bitmap_64 bitmap, __u64 arg,
393826
+static void ba_unmark_bmap_extent(ext2fs_generic_bitmap bitmap, __u64 arg,
393826
 				  unsigned int num)
393826
 {
393826
 	ext2fs_ba_private bp = (ext2fs_ba_private) bitmap->private;
393826
@@ -208,7 +208,7 @@ static void ba_unmark_bmap_extent(ext2fs_generic_bitmap_64 bitmap, __u64 arg,
393826
 		ext2fs_fast_clear_bit64(bitno + i - bitmap->start, bp->bitarray);
393826
 }
393826
 
393826
-static int ba_test_clear_bmap_extent(ext2fs_generic_bitmap_64 bitmap,
393826
+static int ba_test_clear_bmap_extent(ext2fs_generic_bitmap bitmap,
393826
 				     __u64 start, unsigned int len)
393826
 {
393826
 	ext2fs_ba_private bp = (ext2fs_ba_private) bitmap->private;
393826
@@ -282,7 +282,7 @@ static int ba_test_clear_bmap_extent(ext2fs_generic_bitmap_64 bitmap,
393826
 }
393826
 
393826
 
393826
-static errcode_t ba_set_bmap_range(ext2fs_generic_bitmap_64 bitmap,
393826
+static errcode_t ba_set_bmap_range(ext2fs_generic_bitmap bitmap,
393826
 				     __u64 start, size_t num, void *in)
393826
 {
393826
 	ext2fs_ba_private bp = (ext2fs_ba_private) bitmap->private;
393826
@@ -292,7 +292,7 @@ static errcode_t ba_set_bmap_range(ext2fs_generic_bitmap_64 bitmap,
393826
 	return 0;
393826
 }
393826
 
393826
-static errcode_t ba_get_bmap_range(ext2fs_generic_bitmap_64 bitmap,
393826
+static errcode_t ba_get_bmap_range(ext2fs_generic_bitmap bitmap,
393826
 				     __u64 start, size_t num, void *out)
393826
 {
393826
 	ext2fs_ba_private bp = (ext2fs_ba_private) bitmap->private;
393826
@@ -302,7 +302,7 @@ static errcode_t ba_get_bmap_range(ext2fs_generic_bitmap_64 bitmap,
393826
 	return 0;
393826
 }
393826
 
393826
-static void ba_clear_bmap(ext2fs_generic_bitmap_64 bitmap)
393826
+static void ba_clear_bmap(ext2fs_generic_bitmap bitmap)
393826
 {
393826
 	ext2fs_ba_private bp = (ext2fs_ba_private) bitmap->private;
393826
 
393826
@@ -311,20 +311,20 @@ static void ba_clear_bmap(ext2fs_generic_bitmap_64 bitmap)
393826
 }
393826
 
393826
 #ifdef ENABLE_BMAP_STATS
393826
-static void ba_print_stats(ext2fs_generic_bitmap_64 bitmap)
393826
+static void ba_print_stats(ext2fs_generic_bitmap bitmap)
393826
 {
393826
 	fprintf(stderr, "%16llu Bytes used by bitarray\n",
393826
 		((bitmap->real_end - bitmap->start) >> 3) + 1 +
393826
 		sizeof(struct ext2fs_ba_private_struct));
393826
 }
393826
 #else
393826
-static void ba_print_stats(ext2fs_generic_bitmap_64 bitmap EXT2FS_ATTR((unused)))
393826
+static void ba_print_stats(ext2fs_generic_bitmap bitmap EXT2FS_ATTR((unused)))
393826
 {
393826
 }
393826
 #endif
393826
 
393826
 /* Find the first zero bit between start and end, inclusive. */
393826
-static errcode_t ba_find_first_zero(ext2fs_generic_bitmap_64 bitmap,
393826
+static errcode_t ba_find_first_zero(ext2fs_generic_bitmap bitmap,
393826
 				    __u64 start, __u64 end, __u64 *out)
393826
 {
393826
 	ext2fs_ba_private bp = (ext2fs_ba_private)bitmap->private;
393826
@@ -398,7 +398,7 @@ static errcode_t ba_find_first_zero(ext2fs_generic_bitmap_64 bitmap,
393826
 }
393826
 
393826
 /* Find the first one bit between start and end, inclusive. */
393826
-static errcode_t ba_find_first_set(ext2fs_generic_bitmap_64 bitmap,
393826
+static errcode_t ba_find_first_set(ext2fs_generic_bitmap bitmap,
393826
 				    __u64 start, __u64 end, __u64 *out)
393826
 {
393826
 	ext2fs_ba_private bp = (ext2fs_ba_private)bitmap->private;
393826
diff --git a/lib/ext2fs/blkmap64_rb.c b/lib/ext2fs/blkmap64_rb.c
393826
index 1fd55274..4cbfb1ed 100644
393826
--- a/lib/ext2fs/blkmap64_rb.c
393826
+++ b/lib/ext2fs/blkmap64_rb.c
393826
@@ -177,7 +177,7 @@ static void rb_free_extent(struct ext2fs_rb_private *bp,
393826
 	ext2fs_free_mem(&ext;;
393826
 }
393826
 
393826
-static errcode_t rb_alloc_private_data (ext2fs_generic_bitmap_64 bitmap)
393826
+static errcode_t rb_alloc_private_data (ext2fs_generic_bitmap bitmap)
393826
 {
393826
 	struct ext2fs_rb_private *bp;
393826
 	errcode_t	retval;
393826
@@ -201,7 +201,7 @@ static errcode_t rb_alloc_private_data (ext2fs_generic_bitmap_64 bitmap)
393826
 }
393826
 
393826
 static errcode_t rb_new_bmap(ext2_filsys fs EXT2FS_ATTR((unused)),
393826
-			     ext2fs_generic_bitmap_64 bitmap)
393826
+			     ext2fs_generic_bitmap bitmap)
393826
 {
393826
 	errcode_t	retval;
393826
 
393826
@@ -225,7 +225,7 @@ static void rb_free_tree(struct rb_root *root)
393826
 	}
393826
 }
393826
 
393826
-static void rb_free_bmap(ext2fs_generic_bitmap_64 bitmap)
393826
+static void rb_free_bmap(ext2fs_generic_bitmap bitmap)
393826
 {
393826
 	struct ext2fs_rb_private *bp;
393826
 
393826
@@ -236,8 +236,8 @@ static void rb_free_bmap(ext2fs_generic_bitmap_64 bitmap)
393826
 	bp = 0;
393826
 }
393826
 
393826
-static errcode_t rb_copy_bmap(ext2fs_generic_bitmap_64 src,
393826
-			      ext2fs_generic_bitmap_64 dest)
393826
+static errcode_t rb_copy_bmap(ext2fs_generic_bitmap src,
393826
+			      ext2fs_generic_bitmap dest)
393826
 {
393826
 	struct ext2fs_rb_private *src_bp, *dest_bp;
393826
 	struct bmap_rb_extent *src_ext, *dest_ext;
393826
@@ -302,7 +302,7 @@ static void rb_truncate(__u64 new_max, struct rb_root *root)
393826
 	}
393826
 }
393826
 
393826
-static errcode_t rb_resize_bmap(ext2fs_generic_bitmap_64 bmap,
393826
+static errcode_t rb_resize_bmap(ext2fs_generic_bitmap bmap,
393826
 				__u64 new_end, __u64 new_real_end)
393826
 {
393826
 	struct ext2fs_rb_private *bp;
393826
@@ -575,7 +575,7 @@ static int rb_remove_extent(__u64 start, __u64 count,
393826
 	return retval;
393826
 }
393826
 
393826
-static int rb_mark_bmap(ext2fs_generic_bitmap_64 bitmap, __u64 arg)
393826
+static int rb_mark_bmap(ext2fs_generic_bitmap bitmap, __u64 arg)
393826
 {
393826
 	struct ext2fs_rb_private *bp;
393826
 	int retval;
393826
@@ -588,7 +588,7 @@ static int rb_mark_bmap(ext2fs_generic_bitmap_64 bitmap, __u64 arg)
393826
 	return retval;
393826
 }
393826
 
393826
-static int rb_unmark_bmap(ext2fs_generic_bitmap_64 bitmap, __u64 arg)
393826
+static int rb_unmark_bmap(ext2fs_generic_bitmap bitmap, __u64 arg)
393826
 {
393826
 	struct ext2fs_rb_private *bp;
393826
 	int retval;
393826
@@ -603,7 +603,7 @@ static int rb_unmark_bmap(ext2fs_generic_bitmap_64 bitmap, __u64 arg)
393826
 }
393826
 
393826
 inline
393826
-static int rb_test_bmap(ext2fs_generic_bitmap_64 bitmap, __u64 arg)
393826
+static int rb_test_bmap(ext2fs_generic_bitmap bitmap, __u64 arg)
393826
 {
393826
 	struct ext2fs_rb_private *bp;
393826
 
393826
@@ -613,7 +613,7 @@ static int rb_test_bmap(ext2fs_generic_bitmap_64 bitmap, __u64 arg)
393826
 	return rb_test_bit(bp, arg);
393826
 }
393826
 
393826
-static void rb_mark_bmap_extent(ext2fs_generic_bitmap_64 bitmap, __u64 arg,
393826
+static void rb_mark_bmap_extent(ext2fs_generic_bitmap bitmap, __u64 arg,
393826
 				unsigned int num)
393826
 {
393826
 	struct ext2fs_rb_private *bp;
393826
@@ -625,7 +625,7 @@ static void rb_mark_bmap_extent(ext2fs_generic_bitmap_64 bitmap, __u64 arg,
393826
 	check_tree(&bp->root, __func__);
393826
 }
393826
 
393826
-static void rb_unmark_bmap_extent(ext2fs_generic_bitmap_64 bitmap, __u64 arg,
393826
+static void rb_unmark_bmap_extent(ext2fs_generic_bitmap bitmap, __u64 arg,
393826
 				  unsigned int num)
393826
 {
393826
 	struct ext2fs_rb_private *bp;
393826
@@ -637,7 +637,7 @@ static void rb_unmark_bmap_extent(ext2fs_generic_bitmap_64 bitmap, __u64 arg,
393826
 	check_tree(&bp->root, __func__);
393826
 }
393826
 
393826
-static int rb_test_clear_bmap_extent(ext2fs_generic_bitmap_64 bitmap,
393826
+static int rb_test_clear_bmap_extent(ext2fs_generic_bitmap bitmap,
393826
 				     __u64 start, unsigned int len)
393826
 {
393826
 	struct rb_node *parent = NULL, **n;
393826
@@ -693,7 +693,7 @@ static int rb_test_clear_bmap_extent(ext2fs_generic_bitmap_64 bitmap,
393826
 	return retval;
393826
 }
393826
 
393826
-static errcode_t rb_set_bmap_range(ext2fs_generic_bitmap_64 bitmap,
393826
+static errcode_t rb_set_bmap_range(ext2fs_generic_bitmap bitmap,
393826
 				     __u64 start, size_t num, void *in)
393826
 {
393826
 	struct ext2fs_rb_private *bp;
393826
@@ -739,7 +739,7 @@ static errcode_t rb_set_bmap_range(ext2fs_generic_bitmap_64 bitmap,
393826
 	return 0;
393826
 }
393826
 
393826
-static errcode_t rb_get_bmap_range(ext2fs_generic_bitmap_64 bitmap,
393826
+static errcode_t rb_get_bmap_range(ext2fs_generic_bitmap bitmap,
393826
 				     __u64 start, size_t num, void *out)
393826
 {
393826
 
393826
@@ -804,7 +804,7 @@ static errcode_t rb_get_bmap_range(ext2fs_generic_bitmap_64 bitmap,
393826
 	return 0;
393826
 }
393826
 
393826
-static void rb_clear_bmap(ext2fs_generic_bitmap_64 bitmap)
393826
+static void rb_clear_bmap(ext2fs_generic_bitmap bitmap)
393826
 {
393826
 	struct ext2fs_rb_private *bp;
393826
 
393826
@@ -817,7 +817,7 @@ static void rb_clear_bmap(ext2fs_generic_bitmap_64 bitmap)
393826
 	check_tree(&bp->root, __func__);
393826
 }
393826
 
393826
-static errcode_t rb_find_first_zero(ext2fs_generic_bitmap_64 bitmap,
393826
+static errcode_t rb_find_first_zero(ext2fs_generic_bitmap bitmap,
393826
 				   __u64 start, __u64 end, __u64 *out)
393826
 {
393826
 	struct rb_node *parent = NULL, **n;
393826
@@ -853,7 +853,7 @@ static errcode_t rb_find_first_zero(ext2fs_generic_bitmap_64 bitmap,
393826
 	return 0;
393826
 }
393826
 
393826
-static errcode_t rb_find_first_set(ext2fs_generic_bitmap_64 bitmap,
393826
+static errcode_t rb_find_first_set(ext2fs_generic_bitmap bitmap,
393826
 				   __u64 start, __u64 end, __u64 *out)
393826
 {
393826
 	struct rb_node *parent = NULL, **n;
393826
@@ -902,7 +902,7 @@ static errcode_t rb_find_first_set(ext2fs_generic_bitmap_64 bitmap,
393826
 }
393826
 
393826
 #ifdef ENABLE_BMAP_STATS
393826
-static void rb_print_stats(ext2fs_generic_bitmap_64 bitmap)
393826
+static void rb_print_stats(ext2fs_generic_bitmap bitmap)
393826
 {
393826
 	struct ext2fs_rb_private *bp;
393826
 	struct rb_node *node = NULL;
393826
@@ -963,7 +963,7 @@ static void rb_print_stats(ext2fs_generic_bitmap_64 bitmap)
393826
 		eff);
393826
 }
393826
 #else
393826
-static void rb_print_stats(ext2fs_generic_bitmap_64 bitmap EXT2FS_ATTR((unused)))
393826
+static void rb_print_stats(ext2fs_generic_bitmap bitmap EXT2FS_ATTR((unused)))
393826
 {
393826
 }
393826
 #endif
393826
diff --git a/lib/ext2fs/bmap64.h b/lib/ext2fs/bmap64.h
393826
index de334548..d8c7a3c3 100644
393826
--- a/lib/ext2fs/bmap64.h
393826
+++ b/lib/ext2fs/bmap64.h
393826
@@ -37,7 +37,7 @@ struct ext2_bmap_statistics {
393826
 };
393826
 
393826
 
393826
-struct ext2fs_struct_generic_bitmap_64 {
393826
+struct ext2fs_struct_generic_bitmap {
393826
 	errcode_t		magic;
393826
 	ext2_filsys 		fs;
393826
 	struct ext2_bitmap_ops	*bitmap_ops;
393826
@@ -53,8 +53,6 @@ struct ext2fs_struct_generic_bitmap_64 {
393826
 #endif
393826
 };
393826
 
393826
-typedef struct ext2fs_struct_generic_bitmap_64 *ext2fs_generic_bitmap_64;
393826
-
393826
 #define EXT2FS_IS_32_BITMAP(bmap) \
393826
 	(((bmap)->magic == EXT2_ET_MAGIC_GENERIC_BITMAP) || \
393826
 	 ((bmap)->magic == EXT2_ET_MAGIC_BLOCK_BITMAP) || \
393826
@@ -68,37 +66,37 @@ typedef struct ext2fs_struct_generic_bitmap_64 *ext2fs_generic_bitmap_64;
393826
 struct ext2_bitmap_ops {
393826
 	int	type;
393826
 	/* Generic bmap operators */
393826
-	errcode_t (*new_bmap)(ext2_filsys fs, ext2fs_generic_bitmap_64 bmap);
393826
-	void	(*free_bmap)(ext2fs_generic_bitmap_64 bitmap);
393826
-	errcode_t (*copy_bmap)(ext2fs_generic_bitmap_64 src,
393826
-			     ext2fs_generic_bitmap_64 dest);
393826
-	errcode_t (*resize_bmap)(ext2fs_generic_bitmap_64 bitmap,
393826
+	errcode_t (*new_bmap)(ext2_filsys fs, ext2fs_generic_bitmap bmap);
393826
+	void	(*free_bmap)(ext2fs_generic_bitmap bitmap);
393826
+	errcode_t (*copy_bmap)(ext2fs_generic_bitmap src,
393826
+			     ext2fs_generic_bitmap dest);
393826
+	errcode_t (*resize_bmap)(ext2fs_generic_bitmap bitmap,
393826
 			       __u64 new_end,
393826
 			       __u64 new_real_end);
393826
 	/* bit set/test operators */
393826
-	int	(*mark_bmap)(ext2fs_generic_bitmap_64 bitmap, __u64 arg);
393826
-	int	(*unmark_bmap)(ext2fs_generic_bitmap_64 bitmap, __u64 arg);
393826
-	int	(*test_bmap)(ext2fs_generic_bitmap_64 bitmap, __u64 arg);
393826
-	void	(*mark_bmap_extent)(ext2fs_generic_bitmap_64 bitmap, __u64 arg,
393826
+	int	(*mark_bmap)(ext2fs_generic_bitmap bitmap, __u64 arg);
393826
+	int	(*unmark_bmap)(ext2fs_generic_bitmap bitmap, __u64 arg);
393826
+	int	(*test_bmap)(ext2fs_generic_bitmap bitmap, __u64 arg);
393826
+	void	(*mark_bmap_extent)(ext2fs_generic_bitmap bitmap, __u64 arg,
393826
 				    unsigned int num);
393826
-	void	(*unmark_bmap_extent)(ext2fs_generic_bitmap_64 bitmap, __u64 arg,
393826
+	void	(*unmark_bmap_extent)(ext2fs_generic_bitmap bitmap, __u64 arg,
393826
 				      unsigned int num);
393826
-	int	(*test_clear_bmap_extent)(ext2fs_generic_bitmap_64 bitmap,
393826
+	int	(*test_clear_bmap_extent)(ext2fs_generic_bitmap bitmap,
393826
 					  __u64 arg, unsigned int num);
393826
-	errcode_t (*set_bmap_range)(ext2fs_generic_bitmap_64 bitmap,
393826
+	errcode_t (*set_bmap_range)(ext2fs_generic_bitmap bitmap,
393826
 				    __u64 start, size_t num, void *in);
393826
-	errcode_t (*get_bmap_range)(ext2fs_generic_bitmap_64 bitmap,
393826
+	errcode_t (*get_bmap_range)(ext2fs_generic_bitmap bitmap,
393826
 				    __u64 start, size_t num, void *out);
393826
-	void (*clear_bmap)(ext2fs_generic_bitmap_64 bitmap);
393826
-	void (*print_stats)(ext2fs_generic_bitmap_64);
393826
+	void (*clear_bmap)(ext2fs_generic_bitmap bitmap);
393826
+	void (*print_stats)(ext2fs_generic_bitmap);
393826
 
393826
 	/* Find the first zero bit between start and end, inclusive.
393826
 	 * May be NULL, in which case a generic function is used. */
393826
-	errcode_t (*find_first_zero)(ext2fs_generic_bitmap_64 bitmap,
393826
+	errcode_t (*find_first_zero)(ext2fs_generic_bitmap bitmap,
393826
 				     __u64 start, __u64 end, __u64 *out);
393826
 	/* Find the first set bit between start and end, inclusive.
393826
 	 * May be NULL, in which case a generic function is used. */
393826
-	errcode_t (*find_first_set)(ext2fs_generic_bitmap_64 bitmap,
393826
+	errcode_t (*find_first_set)(ext2fs_generic_bitmap bitmap,
393826
 				    __u64 start, __u64 end, __u64 *out);
393826
 };
393826
 
393826
diff --git a/lib/ext2fs/ext2fs.h b/lib/ext2fs/ext2fs.h
1e8c27
index 4b7c836a..ba83534c 100644
393826
--- a/lib/ext2fs/ext2fs.h
393826
+++ b/lib/ext2fs/ext2fs.h
393826
@@ -111,14 +111,9 @@ typedef struct struct_ext2_filsys *ext2_filsys;
393826
 #define EXT2FS_UNMARK_ERROR 	1
393826
 #define EXT2FS_TEST_ERROR	2
393826
 
393826
-struct ext2fs_struct_generic_bitmap_base {
393826
-	errcode_t		magic;
393826
-	ext2_filsys 		fs;
393826
-};
393826
-
393826
-typedef struct ext2fs_struct_generic_bitmap_base *ext2fs_generic_bitmap;
393826
-typedef struct ext2fs_struct_generic_bitmap_base *ext2fs_inode_bitmap;
393826
-typedef struct ext2fs_struct_generic_bitmap_base *ext2fs_block_bitmap;
393826
+typedef struct ext2fs_struct_generic_bitmap *ext2fs_generic_bitmap;
393826
+typedef struct ext2fs_struct_generic_bitmap *ext2fs_inode_bitmap;
393826
+typedef struct ext2fs_struct_generic_bitmap *ext2fs_block_bitmap;
393826
 
393826
 #define EXT2_FIRST_INODE(s)	EXT2_FIRST_INO(s)
393826
 
393826
diff --git a/lib/ext2fs/gen_bitmap.c b/lib/ext2fs/gen_bitmap.c
1e8c27
index 1536d4b3..b545ed7f 100644
393826
--- a/lib/ext2fs/gen_bitmap.c
393826
+++ b/lib/ext2fs/gen_bitmap.c
393826
@@ -28,7 +28,7 @@
393826
 #include "ext2_fs.h"
393826
 #include "ext2fsP.h"
393826
 
393826
-struct ext2fs_struct_generic_bitmap_32 {
393826
+struct ext2fs_struct_generic_bitmap {
393826
 	errcode_t	magic;
393826
 	ext2_filsys 	fs;
393826
 	__u32		start, end;
393826
@@ -39,8 +39,6 @@ struct ext2fs_struct_generic_bitmap_32 {
393826
 	__u32		reserved[7];
393826
 };
393826
 
393826
-typedef struct ext2fs_struct_generic_bitmap_32 *ext2fs_generic_bitmap_32;
393826
-
393826
 #define EXT2FS_IS_32_BITMAP(bmap) \
393826
 	(((bmap)->magic == EXT2_ET_MAGIC_GENERIC_BITMAP) || \
393826
 	 ((bmap)->magic == EXT2_ET_MAGIC_BLOCK_BITMAP) || \
393826
@@ -55,11 +53,9 @@ typedef struct ext2fs_struct_generic_bitmap_32 *ext2fs_generic_bitmap_32;
393826
  * Used by previously inlined function, so we have to export this and
393826
  * not change the function signature
393826
  */
393826
-void ext2fs_warn_bitmap2(ext2fs_generic_bitmap gen_bitmap,
393826
+void ext2fs_warn_bitmap2(ext2fs_generic_bitmap bitmap,
393826
 			    int code, unsigned long arg)
393826
 {
393826
-	ext2fs_generic_bitmap_32 bitmap = (ext2fs_generic_bitmap_32) gen_bitmap;
393826
-
393826
 #ifndef OMIT_COM_ERR
393826
 	if (bitmap->description)
393826
 		com_err(0, bitmap->base_error_code+code,
393826
@@ -83,11 +79,11 @@ errcode_t ext2fs_make_generic_bitmap(errcode_t magic, ext2_filsys fs,
393826
 				     const char *descr, char *init_map,
393826
 				     ext2fs_generic_bitmap *ret)
393826
 {
393826
-	ext2fs_generic_bitmap_32 bitmap;
393826
+	ext2fs_generic_bitmap	bitmap;
393826
 	errcode_t		retval;
393826
 	size_t			size;
393826
 
393826
-	retval = ext2fs_get_mem(sizeof(struct ext2fs_struct_generic_bitmap_32),
393826
+	retval = ext2fs_get_mem(sizeof(struct ext2fs_struct_generic_bitmap),
393826
 				&bitmap);
393826
 	if (retval)
393826
 		return retval;
393826
@@ -131,7 +127,7 @@ errcode_t ext2fs_make_generic_bitmap(errcode_t magic, ext2_filsys fs,
393826
 		memcpy(bitmap->bitmap, init_map, size);
393826
 	else
393826
 		memset(bitmap->bitmap, 0, size);
393826
-	*ret = (ext2fs_generic_bitmap) bitmap;
393826
+	*ret = bitmap;
393826
 	return 0;
393826
 }
393826
 
393826
@@ -145,11 +141,9 @@ errcode_t ext2fs_allocate_generic_bitmap(__u32 start,
393826
 					  start, end, real_end, descr, 0, ret);
393826
 }
393826
 
393826
-errcode_t ext2fs_copy_generic_bitmap(ext2fs_generic_bitmap gen_src,
393826
+errcode_t ext2fs_copy_generic_bitmap(ext2fs_generic_bitmap src,
393826
 				     ext2fs_generic_bitmap *dest)
393826
 {
393826
-	ext2fs_generic_bitmap_32 src = (ext2fs_generic_bitmap_32) gen_src;
393826
-
393826
 	return (ext2fs_make_generic_bitmap(src->magic, src->fs,
393826
 					   src->start, src->end,
393826
 					   src->real_end,
393826
@@ -157,11 +151,9 @@ errcode_t ext2fs_copy_generic_bitmap(ext2fs_generic_bitmap gen_src,
393826
 					   dest));
393826
 }
393826
 
393826
-void ext2fs_free_generic_bitmap(ext2fs_inode_bitmap gen_bitmap)
393826
+void ext2fs_free_generic_bitmap(ext2fs_inode_bitmap bitmap)
393826
 {
393826
-	ext2fs_generic_bitmap_32 bitmap = (ext2fs_generic_bitmap_32) gen_bitmap;
393826
-
393826
-	if (check_magic(gen_bitmap))
393826
+	if (check_magic(bitmap))
393826
 		return;
393826
 
393826
 	bitmap->magic = 0;
393826
@@ -179,8 +171,6 @@ void ext2fs_free_generic_bitmap(ext2fs_inode_bitmap gen_bitmap)
393826
 int ext2fs_test_generic_bitmap(ext2fs_generic_bitmap bitmap,
393826
 					blk_t bitno)
393826
 {
393826
-	ext2fs_generic_bitmap_32 bitmap32 = (ext2fs_generic_bitmap_32) bitmap;
393826
-
393826
 	if (!EXT2FS_IS_32_BITMAP(bitmap)) {
393826
 		if (EXT2FS_IS_64_BITMAP(bitmap)) {
393826
 			ext2fs_warn_bitmap32(bitmap, __func__);
393826
@@ -193,18 +183,16 @@ int ext2fs_test_generic_bitmap(ext2fs_generic_bitmap bitmap,
393826
 		return 0;
393826
 	}
393826
 
393826
-	if ((bitno < bitmap32->start) || (bitno > bitmap32->end)) {
393826
+	if ((bitno < bitmap->start) || (bitno > bitmap->end)) {
393826
 		ext2fs_warn_bitmap2(bitmap, EXT2FS_TEST_ERROR, bitno);
393826
 		return 0;
393826
 	}
393826
-	return ext2fs_test_bit(bitno - bitmap32->start, bitmap32->bitmap);
393826
+	return ext2fs_test_bit(bitno - bitmap->start, bitmap->bitmap);
393826
 }
393826
 
393826
 int ext2fs_mark_generic_bitmap(ext2fs_generic_bitmap bitmap,
393826
 					 __u32 bitno)
393826
 {
393826
-	ext2fs_generic_bitmap_32 bitmap32 = (ext2fs_generic_bitmap_32) bitmap;
393826
-
393826
 	if (!EXT2FS_IS_32_BITMAP(bitmap)) {
393826
 		if (EXT2FS_IS_64_BITMAP(bitmap)) {
393826
 			ext2fs_warn_bitmap32(bitmap, __func__);
393826
@@ -217,18 +205,16 @@ int ext2fs_mark_generic_bitmap(ext2fs_generic_bitmap bitmap,
393826
 		return 0;
393826
 	}
393826
 
393826
-	if ((bitno < bitmap32->start) || (bitno > bitmap32->end)) {
393826
+	if ((bitno < bitmap->start) || (bitno > bitmap->end)) {
393826
 		ext2fs_warn_bitmap2(bitmap, EXT2FS_MARK_ERROR, bitno);
393826
 		return 0;
393826
 	}
393826
-	return ext2fs_set_bit(bitno - bitmap32->start, bitmap32->bitmap);
393826
+	return ext2fs_set_bit(bitno - bitmap->start, bitmap->bitmap);
393826
 }
393826
 
393826
 int ext2fs_unmark_generic_bitmap(ext2fs_generic_bitmap bitmap,
393826
 					   blk_t bitno)
393826
 {
393826
-	ext2fs_generic_bitmap_32 bitmap32 = (ext2fs_generic_bitmap_32) bitmap;
393826
-
393826
 	if (!EXT2FS_IS_32_BITMAP(bitmap)) {
393826
 		if (EXT2FS_IS_64_BITMAP(bitmap)) {
393826
 			ext2fs_warn_bitmap32(bitmap, __func__);
393826
@@ -241,17 +227,15 @@ int ext2fs_unmark_generic_bitmap(ext2fs_generic_bitmap bitmap,
393826
 		return 0;
393826
 	}
393826
 
393826
-	if ((bitno < bitmap32->start) || (bitno > bitmap32->end)) {
393826
+	if ((bitno < bitmap->start) || (bitno > bitmap->end)) {
393826
 		ext2fs_warn_bitmap2(bitmap, EXT2FS_UNMARK_ERROR, bitno);
393826
 		return 0;
393826
 	}
393826
-	return ext2fs_clear_bit(bitno - bitmap32->start, bitmap32->bitmap);
393826
+	return ext2fs_clear_bit(bitno - bitmap->start, bitmap->bitmap);
393826
 }
393826
 
393826
 __u32 ext2fs_get_generic_bitmap_start(ext2fs_generic_bitmap bitmap)
393826
 {
393826
-	ext2fs_generic_bitmap_32 bitmap32 = (ext2fs_generic_bitmap_32) bitmap;
393826
-
393826
 	if (!EXT2FS_IS_32_BITMAP(bitmap)) {
393826
 		if (EXT2FS_IS_64_BITMAP(bitmap)) {
393826
 			ext2fs_warn_bitmap32(bitmap, __func__);
393826
@@ -264,13 +248,11 @@ __u32 ext2fs_get_generic_bitmap_start(ext2fs_generic_bitmap bitmap)
393826
 		return 0;
393826
 	}
393826
 
393826
-	return bitmap32->start;
393826
+	return bitmap->start;
393826
 }
393826
 
393826
 __u32 ext2fs_get_generic_bitmap_end(ext2fs_generic_bitmap bitmap)
393826
 {
393826
-	ext2fs_generic_bitmap_32 bitmap32 = (ext2fs_generic_bitmap_32) bitmap;
393826
-
393826
 	if (!EXT2FS_IS_32_BITMAP(bitmap)) {
393826
 		if (EXT2FS_IS_64_BITMAP(bitmap)) {
393826
 			ext2fs_warn_bitmap32(bitmap, __func__);
393826
@@ -282,13 +264,11 @@ __u32 ext2fs_get_generic_bitmap_end(ext2fs_generic_bitmap bitmap)
393826
 #endif
393826
 		return 0;
393826
 	}
393826
-	return bitmap32->end;
393826
+	return bitmap->end;
393826
 }
393826
 
393826
 void ext2fs_clear_generic_bitmap(ext2fs_generic_bitmap bitmap)
393826
 {
393826
-	ext2fs_generic_bitmap_32 bitmap32 = (ext2fs_generic_bitmap_32) bitmap;
393826
-
393826
 	if (!EXT2FS_IS_32_BITMAP(bitmap)) {
393826
 		if (EXT2FS_IS_64_BITMAP(bitmap)) {
393826
 			ext2fs_warn_bitmap32(bitmap, __func__);
393826
@@ -302,16 +282,14 @@ void ext2fs_clear_generic_bitmap(ext2fs_generic_bitmap bitmap)
393826
 		return;
393826
 	}
393826
 
393826
-	memset(bitmap32->bitmap, 0,
393826
-	       (size_t) (((bitmap32->real_end - bitmap32->start) / 8) + 1));
393826
+	memset(bitmap->bitmap, 0,
393826
+	       (size_t) (((bitmap->real_end - bitmap->start) / 8) + 1));
393826
 }
393826
 
393826
-errcode_t ext2fs_fudge_generic_bitmap_end(ext2fs_inode_bitmap gen_bitmap,
393826
+errcode_t ext2fs_fudge_generic_bitmap_end(ext2fs_inode_bitmap bitmap,
393826
 					  errcode_t magic, errcode_t neq,
393826
 					  ext2_ino_t end, ext2_ino_t *oend)
393826
 {
393826
-	ext2fs_generic_bitmap_32 bitmap = (ext2fs_generic_bitmap_32) gen_bitmap;
393826
-
393826
 	EXT2_CHECK_MAGIC(bitmap, magic);
393826
 
393826
 	if (end > bitmap->real_end)
393826
@@ -324,9 +302,8 @@ errcode_t ext2fs_fudge_generic_bitmap_end(ext2fs_inode_bitmap gen_bitmap,
393826
 
393826
 errcode_t ext2fs_resize_generic_bitmap(errcode_t magic,
393826
 				       __u32 new_end, __u32 new_real_end,
393826
-				       ext2fs_generic_bitmap gen_bmap)
393826
+				       ext2fs_generic_bitmap bmap)
393826
 {
393826
-	ext2fs_generic_bitmap_32 bmap = (ext2fs_generic_bitmap_32) gen_bmap;
393826
 	errcode_t	retval;
393826
 	size_t		size, new_size;
393826
 	__u32		bitno;
393826
@@ -367,11 +344,9 @@ errcode_t ext2fs_resize_generic_bitmap(errcode_t magic,
393826
 }
393826
 
393826
 errcode_t ext2fs_compare_generic_bitmap(errcode_t magic, errcode_t neq,
393826
-					ext2fs_generic_bitmap gen_bm1,
393826
-					ext2fs_generic_bitmap gen_bm2)
393826
+					ext2fs_generic_bitmap bm1,
393826
+					ext2fs_generic_bitmap bm2)
393826
 {
393826
-	ext2fs_generic_bitmap_32 bm1 = (ext2fs_generic_bitmap_32) gen_bm1;
393826
-	ext2fs_generic_bitmap_32 bm2 = (ext2fs_generic_bitmap_32) gen_bm2;
393826
 	blk_t	i;
393826
 
393826
 	if (!bm1 || bm1->magic != magic)
393826
@@ -386,16 +361,15 @@ errcode_t ext2fs_compare_generic_bitmap(errcode_t magic, errcode_t neq,
393826
 		return neq;
393826
 
393826
 	for (i = bm1->end - ((bm1->end - bm1->start) % 8); i <= bm1->end; i++)
393826
-		if (ext2fs_fast_test_block_bitmap(gen_bm1, i) !=
393826
-		    ext2fs_fast_test_block_bitmap(gen_bm2, i))
393826
+		if (ext2fs_fast_test_block_bitmap(bm1, i) !=
393826
+		    ext2fs_fast_test_block_bitmap(bm2, i))
393826
 			return neq;
393826
 
393826
 	return 0;
393826
 }
393826
 
393826
-void ext2fs_set_generic_bitmap_padding(ext2fs_generic_bitmap gen_map)
393826
+void ext2fs_set_generic_bitmap_padding(ext2fs_generic_bitmap map)
393826
 {
393826
-	ext2fs_generic_bitmap_32 map = (ext2fs_generic_bitmap_32) gen_map;
393826
 	__u32	i, j;
393826
 
393826
 	/* Protect loop from wrap-around if map->real_end is maxed */
393826
@@ -405,13 +379,11 @@ void ext2fs_set_generic_bitmap_padding(ext2fs_generic_bitmap gen_map)
393826
 		ext2fs_set_bit(j, map->bitmap);
393826
 }
393826
 
393826
-errcode_t ext2fs_get_generic_bitmap_range(ext2fs_generic_bitmap gen_bmap,
393826
+errcode_t ext2fs_get_generic_bitmap_range(ext2fs_generic_bitmap bmap,
393826
 					  errcode_t magic,
393826
 					  __u32 start, __u32 num,
393826
 					  void *out)
393826
 {
393826
-	ext2fs_generic_bitmap_32 bmap = (ext2fs_generic_bitmap_32) gen_bmap;
393826
-
393826
 	if (!bmap || (bmap->magic != magic))
393826
 		return magic;
393826
 
393826
@@ -422,13 +394,11 @@ errcode_t ext2fs_get_generic_bitmap_range(ext2fs_generic_bitmap gen_bmap,
393826
 	return 0;
393826
 }
393826
 
393826
-errcode_t ext2fs_set_generic_bitmap_range(ext2fs_generic_bitmap gen_bmap,
393826
+errcode_t ext2fs_set_generic_bitmap_range(ext2fs_generic_bitmap bmap,
393826
 					  errcode_t magic,
393826
 					  __u32 start, __u32 num,
393826
 					  void *in)
393826
 {
393826
-	ext2fs_generic_bitmap_32 bmap = (ext2fs_generic_bitmap_32) gen_bmap;
393826
-
393826
 	if (!bmap || (bmap->magic != magic))
393826
 		return magic;
393826
 
393826
@@ -462,11 +432,10 @@ int ext2fs_mem_is_zero(const char *mem, size_t len)
393826
 /*
393826
  * Return true if all of the bits in a specified range are clear
393826
  */
393826
-static int ext2fs_test_clear_generic_bitmap_range(ext2fs_generic_bitmap gen_bitmap,
393826
+static int ext2fs_test_clear_generic_bitmap_range(ext2fs_generic_bitmap bitmap,
393826
 						  unsigned int start,
393826
 						  unsigned int len)
393826
 {
393826
-	ext2fs_generic_bitmap_32 bitmap = (ext2fs_generic_bitmap_32) gen_bitmap;
393826
 	size_t start_byte, len_byte = len >> 3;
393826
 	unsigned int start_bit, len_bit = len % 8;
393826
 	int first_bit = 0;
393826
@@ -535,15 +504,14 @@ static int ext2fs_test_clear_generic_bitmap_range(ext2fs_generic_bitmap gen_bitm
393826
 	return ext2fs_mem_is_zero(ADDR + start_byte, len_byte);
393826
 }
393826
 
393826
-errcode_t ext2fs_find_first_zero_generic_bitmap(ext2fs_generic_bitmap gen_bitmap,
393826
+errcode_t ext2fs_find_first_zero_generic_bitmap(ext2fs_generic_bitmap bitmap,
393826
 						__u32 start, __u32 end,
393826
 						__u32 *out)
393826
 {
393826
-	ext2fs_generic_bitmap_32 bitmap = (ext2fs_generic_bitmap_32) gen_bitmap;
393826
 	blk_t b;
393826
 
393826
 	if (start < bitmap->start || end > bitmap->end || start > end) {
393826
-		ext2fs_warn_bitmap2(gen_bitmap, EXT2FS_TEST_ERROR, start);
393826
+		ext2fs_warn_bitmap2(bitmap, EXT2FS_TEST_ERROR, start);
393826
 		return EINVAL;
393826
 	}
393826
 
393826
@@ -559,15 +527,14 @@ errcode_t ext2fs_find_first_zero_generic_bitmap(ext2fs_generic_bitmap gen_bitmap
393826
 	return ENOENT;
393826
 }
393826
 
393826
-errcode_t ext2fs_find_first_set_generic_bitmap(ext2fs_generic_bitmap gen_bitmap,
393826
+errcode_t ext2fs_find_first_set_generic_bitmap(ext2fs_generic_bitmap bitmap,
393826
 					       __u32 start, __u32 end,
393826
 					       __u32 *out)
393826
 {
393826
-	ext2fs_generic_bitmap_32 bitmap = (ext2fs_generic_bitmap_32) gen_bitmap;
393826
 	blk_t b;
393826
 
393826
 	if (start < bitmap->start || end > bitmap->end || start > end) {
393826
-		ext2fs_warn_bitmap2(gen_bitmap, EXT2FS_TEST_ERROR, start);
393826
+		ext2fs_warn_bitmap2(bitmap, EXT2FS_TEST_ERROR, start);
393826
 		return EINVAL;
393826
 	}
393826
 
393826
@@ -583,11 +550,9 @@ errcode_t ext2fs_find_first_set_generic_bitmap(ext2fs_generic_bitmap gen_bitmap,
393826
 	return ENOENT;
393826
 }
393826
 
393826
-int ext2fs_test_block_bitmap_range(ext2fs_block_bitmap gen_bitmap,
393826
+int ext2fs_test_block_bitmap_range(ext2fs_block_bitmap bitmap,
393826
 				   blk_t block, int num)
393826
 {
393826
-	ext2fs_generic_bitmap_32 bitmap = (ext2fs_generic_bitmap_32) gen_bitmap;
393826
-
393826
 	EXT2_CHECK_MAGIC(bitmap, EXT2_ET_MAGIC_BLOCK_BITMAP);
393826
 	if ((block < bitmap->start) || (block > bitmap->real_end) ||
393826
 	    (block+num-1 > bitmap->real_end)) {
393826
@@ -599,11 +564,9 @@ int ext2fs_test_block_bitmap_range(ext2fs_block_bitmap gen_bitmap,
393826
 						      bitmap, block, num);
393826
 }
393826
 
393826
-int ext2fs_test_inode_bitmap_range(ext2fs_inode_bitmap gen_bitmap,
393826
+int ext2fs_test_inode_bitmap_range(ext2fs_inode_bitmap bitmap,
393826
 				   ext2_ino_t inode, int num)
393826
 {
393826
-	ext2fs_generic_bitmap_32 bitmap = (ext2fs_generic_bitmap_32) gen_bitmap;
393826
-
393826
 	EXT2_CHECK_MAGIC(bitmap, EXT2_ET_MAGIC_INODE_BITMAP);
393826
 	if ((inode < bitmap->start) || (inode > bitmap->real_end) ||
393826
 	    (inode+num-1 > bitmap->real_end)) {
393826
@@ -615,10 +578,9 @@ int ext2fs_test_inode_bitmap_range(ext2fs_inode_bitmap gen_bitmap,
393826
 						      bitmap, inode, num);
393826
 }
393826
 
393826
-void ext2fs_mark_block_bitmap_range(ext2fs_block_bitmap gen_bitmap,
393826
+void ext2fs_mark_block_bitmap_range(ext2fs_block_bitmap bitmap,
393826
 				    blk_t block, int num)
393826
 {
393826
-	ext2fs_generic_bitmap_32 bitmap = (ext2fs_generic_bitmap_32) gen_bitmap;
393826
 	int	i;
393826
 
393826
 	if ((block < bitmap->start) || (block > bitmap->end) ||
393826
@@ -631,10 +593,9 @@ void ext2fs_mark_block_bitmap_range(ext2fs_block_bitmap gen_bitmap,
393826
 		ext2fs_fast_set_bit(block + i - bitmap->start, bitmap->bitmap);
393826
 }
393826
 
393826
-void ext2fs_unmark_block_bitmap_range(ext2fs_block_bitmap gen_bitmap,
393826
-				      blk_t block, int num)
393826
+void ext2fs_unmark_block_bitmap_range(ext2fs_block_bitmap bitmap,
393826
+					       blk_t block, int num)
393826
 {
393826
-	ext2fs_generic_bitmap_32 bitmap = (ext2fs_generic_bitmap_32) gen_bitmap;
393826
 	int	i;
393826
 
393826
 	if ((block < bitmap->start) || (block > bitmap->end) ||
393826
diff --git a/lib/ext2fs/gen_bitmap64.c b/lib/ext2fs/gen_bitmap64.c
393826
index 6e4d8b71..47ba2baf 100644
393826
--- a/lib/ext2fs/gen_bitmap64.c
393826
+++ b/lib/ext2fs/gen_bitmap64.c
393826
@@ -68,7 +68,7 @@
393826
  * e2fsck can request an encoding which is optimized for that.
393826
  */
393826
 
393826
-static void warn_bitmap(ext2fs_generic_bitmap_64 bitmap,
393826
+static void warn_bitmap(ext2fs_generic_bitmap bitmap,
393826
 			int code, __u64 arg)
393826
 {
393826
 #ifndef OMIT_COM_ERR
393826
@@ -93,7 +93,7 @@ errcode_t ext2fs_alloc_generic_bmap(ext2_filsys fs, errcode_t magic,
393826
 				    const char *descr,
393826
 				    ext2fs_generic_bitmap *ret)
393826
 {
393826
-	ext2fs_generic_bitmap_64 bitmap;
393826
+	ext2fs_generic_bitmap	bitmap;
393826
 	struct ext2_bitmap_ops	*ops;
393826
 	ext2_ino_t num_dirs;
393826
 	errcode_t retval;
393826
@@ -119,7 +119,7 @@ errcode_t ext2fs_alloc_generic_bmap(ext2_filsys fs, errcode_t magic,
393826
 		return EINVAL;
393826
 	}
393826
 
393826
-	retval = ext2fs_get_memzero(sizeof(struct ext2fs_struct_generic_bitmap_64),
393826
+	retval = ext2fs_get_memzero(sizeof(struct ext2fs_struct_generic_bitmap),
393826
 				    &bitmap);
393826
 	if (retval)
393826
 		return retval;
393826
@@ -170,12 +170,12 @@ errcode_t ext2fs_alloc_generic_bmap(ext2_filsys fs, errcode_t magic,
393826
 		return retval;
393826
 	}
393826
 
393826
-	*ret = (ext2fs_generic_bitmap) bitmap;
393826
+	*ret = bitmap;
393826
 	return 0;
393826
 }
393826
 
393826
 #ifdef ENABLE_BMAP_STATS
393826
-static void ext2fs_print_bmap_statistics(ext2fs_generic_bitmap_64 bitmap)
393826
+static void ext2fs_print_bmap_statistics(ext2fs_generic_bitmap bitmap)
393826
 {
393826
 	struct ext2_bmap_statistics *stats = &bitmap->stats;
393826
 #ifdef ENABLE_BMAP_STATS_OPS
393826
@@ -241,15 +241,13 @@ static void ext2fs_print_bmap_statistics(ext2fs_generic_bitmap_64 bitmap)
393826
 }
393826
 #endif
393826
 
393826
-void ext2fs_free_generic_bmap(ext2fs_generic_bitmap gen_bmap)
393826
+void ext2fs_free_generic_bmap(ext2fs_generic_bitmap bmap)
393826
 {
393826
-	ext2fs_generic_bitmap_64 bmap = (ext2fs_generic_bitmap_64) gen_bmap;
393826
-
393826
 	if (!bmap)
393826
 		return;
393826
 
393826
 	if (EXT2FS_IS_32_BITMAP(bmap)) {
393826
-		ext2fs_free_generic_bitmap(gen_bmap);
393826
+		ext2fs_free_generic_bitmap(bmap);
393826
 		return;
393826
 	}
393826
 
393826
@@ -273,25 +271,24 @@ void ext2fs_free_generic_bmap(ext2fs_generic_bitmap gen_bmap)
393826
 	ext2fs_free_mem(&bmap);
393826
 }
393826
 
393826
-errcode_t ext2fs_copy_generic_bmap(ext2fs_generic_bitmap gen_src,
393826
+errcode_t ext2fs_copy_generic_bmap(ext2fs_generic_bitmap src,
393826
 				   ext2fs_generic_bitmap *dest)
393826
 {
393826
-	ext2fs_generic_bitmap_64 src = (ext2fs_generic_bitmap_64) gen_src;
393826
 	char *descr, *new_descr;
393826
-	ext2fs_generic_bitmap_64 new_bmap;
393826
+	ext2fs_generic_bitmap	new_bmap;
393826
 	errcode_t retval;
393826
 
393826
 	if (!src)
393826
 		return EINVAL;
393826
 
393826
 	if (EXT2FS_IS_32_BITMAP(src))
393826
-		return ext2fs_copy_generic_bitmap(gen_src, dest);
393826
+		return ext2fs_copy_generic_bitmap(src, dest);
393826
 
393826
 	if (!EXT2FS_IS_64_BITMAP(src))
393826
 		return EINVAL;
393826
 
393826
 	/* Allocate a new bitmap struct */
393826
-	retval = ext2fs_get_memzero(sizeof(struct ext2fs_struct_generic_bitmap_64),
393826
+	retval = ext2fs_get_memzero(sizeof(struct ext2fs_struct_generic_bitmap),
393826
 				    &new_bmap);
393826
 	if (retval)
393826
 		return retval;
393826
@@ -339,23 +336,21 @@ errcode_t ext2fs_copy_generic_bmap(ext2fs_generic_bitmap gen_src,
393826
 		return retval;
393826
 	}
393826
 
393826
-	*dest = (ext2fs_generic_bitmap) new_bmap;
393826
+	*dest = new_bmap;
393826
 
393826
 	return 0;
393826
 }
393826
 
393826
-errcode_t ext2fs_resize_generic_bmap(ext2fs_generic_bitmap gen_bmap,
393826
+errcode_t ext2fs_resize_generic_bmap(ext2fs_generic_bitmap bmap,
393826
 				     __u64 new_end,
393826
 				     __u64 new_real_end)
393826
 {
393826
-	ext2fs_generic_bitmap_64 bmap = (ext2fs_generic_bitmap_64) gen_bmap;
393826
-
393826
 	if (!bmap)
393826
 		return EINVAL;
393826
 
393826
 	if (EXT2FS_IS_32_BITMAP(bmap))
393826
-		return ext2fs_resize_generic_bitmap(gen_bmap->magic, new_end,
393826
-						    new_real_end, gen_bmap);
393826
+		return ext2fs_resize_generic_bitmap(bmap->magic, new_end,
393826
+						    new_real_end, bmap);
393826
 
393826
 	if (!EXT2FS_IS_64_BITMAP(bmap))
393826
 		return EINVAL;
393826
@@ -365,12 +360,10 @@ errcode_t ext2fs_resize_generic_bmap(ext2fs_generic_bitmap gen_bmap,
393826
 	return bmap->bitmap_ops->resize_bmap(bmap, new_end, new_real_end);
393826
 }
393826
 
393826
-errcode_t ext2fs_fudge_generic_bmap_end(ext2fs_generic_bitmap gen_bitmap,
393826
+errcode_t ext2fs_fudge_generic_bmap_end(ext2fs_generic_bitmap bitmap,
393826
 					errcode_t neq,
393826
 					__u64 end, __u64 *oend)
393826
 {
393826
-	ext2fs_generic_bitmap_64 bitmap = (ext2fs_generic_bitmap_64) gen_bitmap;
393826
-
393826
 	if (!bitmap)
393826
 		return EINVAL;
393826
 
393826
@@ -378,8 +371,7 @@ errcode_t ext2fs_fudge_generic_bmap_end(ext2fs_generic_bitmap gen_bitmap,
393826
 		ext2_ino_t tmp_oend;
393826
 		int retval;
393826
 
393826
-		retval = ext2fs_fudge_generic_bitmap_end(gen_bitmap,
393826
-							 bitmap->magic,
393826
+		retval = ext2fs_fudge_generic_bitmap_end(bitmap, bitmap->magic,
393826
 							 neq, end, &tmp_oend);
393826
 		if (oend)
393826
 			*oend = tmp_oend;
393826
@@ -397,15 +389,13 @@ errcode_t ext2fs_fudge_generic_bmap_end(ext2fs_generic_bitmap gen_bitmap,
393826
 	return 0;
393826
 }
393826
 
393826
-__u64 ext2fs_get_generic_bmap_start(ext2fs_generic_bitmap gen_bitmap)
393826
+__u64 ext2fs_get_generic_bmap_start(ext2fs_generic_bitmap bitmap)
393826
 {
393826
-	ext2fs_generic_bitmap_64 bitmap = (ext2fs_generic_bitmap_64) gen_bitmap;
393826
-
393826
 	if (!bitmap)
393826
 		return EINVAL;
393826
 
393826
 	if (EXT2FS_IS_32_BITMAP(bitmap))
393826
-		return ext2fs_get_generic_bitmap_start(gen_bitmap);
393826
+		return ext2fs_get_generic_bitmap_start(bitmap);
393826
 
393826
 	if (!EXT2FS_IS_64_BITMAP(bitmap))
393826
 		return EINVAL;
393826
@@ -413,15 +403,13 @@ __u64 ext2fs_get_generic_bmap_start(ext2fs_generic_bitmap gen_bitmap)
393826
 	return bitmap->start;
393826
 }
393826
 
393826
-__u64 ext2fs_get_generic_bmap_end(ext2fs_generic_bitmap gen_bitmap)
393826
+__u64 ext2fs_get_generic_bmap_end(ext2fs_generic_bitmap bitmap)
393826
 {
393826
-	ext2fs_generic_bitmap_64 bitmap = (ext2fs_generic_bitmap_64) gen_bitmap;
393826
-
393826
 	if (!bitmap)
393826
 		return EINVAL;
393826
 
393826
 	if (EXT2FS_IS_32_BITMAP(bitmap))
393826
-		return ext2fs_get_generic_bitmap_end(gen_bitmap);
393826
+		return ext2fs_get_generic_bitmap_end(bitmap);
393826
 
393826
 	if (!EXT2FS_IS_64_BITMAP(bitmap))
393826
 		return EINVAL;
393826
@@ -429,31 +417,27 @@ __u64 ext2fs_get_generic_bmap_end(ext2fs_generic_bitmap gen_bitmap)
393826
 	return bitmap->end;
393826
 }
393826
 
393826
-void ext2fs_clear_generic_bmap(ext2fs_generic_bitmap gen_bitmap)
393826
+void ext2fs_clear_generic_bmap(ext2fs_generic_bitmap bitmap)
393826
 {
393826
-	ext2fs_generic_bitmap_64 bitmap = (ext2fs_generic_bitmap_64) gen_bitmap;
393826
-
393826
 	if (EXT2FS_IS_32_BITMAP(bitmap))
393826
-		ext2fs_clear_generic_bitmap(gen_bitmap);
393826
+		ext2fs_clear_generic_bitmap(bitmap);
393826
 	else
393826
-		bitmap->bitmap_ops->clear_bmap(bitmap);
393826
+		bitmap->bitmap_ops->clear_bmap (bitmap);
393826
 }
393826
 
393826
-int ext2fs_mark_generic_bmap(ext2fs_generic_bitmap gen_bitmap,
393826
+int ext2fs_mark_generic_bmap(ext2fs_generic_bitmap bitmap,
393826
 			     __u64 arg)
393826
 {
393826
-	ext2fs_generic_bitmap_64 bitmap = (ext2fs_generic_bitmap_64) gen_bitmap;
393826
-
393826
 	if (!bitmap)
393826
 		return 0;
393826
 
393826
 	if (EXT2FS_IS_32_BITMAP(bitmap)) {
393826
 		if (arg & ~0xffffffffULL) {
393826
-			ext2fs_warn_bitmap2(gen_bitmap,
393826
+			ext2fs_warn_bitmap2(bitmap,
393826
 					    EXT2FS_MARK_ERROR, 0xffffffff);
393826
 			return 0;
393826
 		}
393826
-		return ext2fs_mark_generic_bitmap(gen_bitmap, arg);
393826
+		return ext2fs_mark_generic_bitmap(bitmap, arg);
393826
 	}
393826
 
393826
 	if (!EXT2FS_IS_64_BITMAP(bitmap))
393826
@@ -478,21 +462,19 @@ int ext2fs_mark_generic_bmap(ext2fs_generic_bitmap gen_bitmap,
393826
 	return bitmap->bitmap_ops->mark_bmap(bitmap, arg);
393826
 }
393826
 
393826
-int ext2fs_unmark_generic_bmap(ext2fs_generic_bitmap gen_bitmap,
393826
+int ext2fs_unmark_generic_bmap(ext2fs_generic_bitmap bitmap,
393826
 			       __u64 arg)
393826
 {
393826
-	ext2fs_generic_bitmap_64 bitmap = (ext2fs_generic_bitmap_64) gen_bitmap;
393826
-
393826
 	if (!bitmap)
393826
 		return 0;
393826
 
393826
 	if (EXT2FS_IS_32_BITMAP(bitmap)) {
393826
 		if (arg & ~0xffffffffULL) {
393826
-			ext2fs_warn_bitmap2(gen_bitmap, EXT2FS_UNMARK_ERROR,
393826
+			ext2fs_warn_bitmap2(bitmap, EXT2FS_UNMARK_ERROR,
393826
 					    0xffffffff);
393826
 			return 0;
393826
 		}
393826
-		return ext2fs_unmark_generic_bitmap(gen_bitmap, arg);
393826
+		return ext2fs_unmark_generic_bitmap(bitmap, arg);
393826
 	}
393826
 
393826
 	if (!EXT2FS_IS_64_BITMAP(bitmap))
393826
@@ -510,20 +492,19 @@ int ext2fs_unmark_generic_bmap(ext2fs_generic_bitmap gen_bitmap,
393826
 	return bitmap->bitmap_ops->unmark_bmap(bitmap, arg);
393826
 }
393826
 
393826
-int ext2fs_test_generic_bmap(ext2fs_generic_bitmap gen_bitmap,
393826
+int ext2fs_test_generic_bmap(ext2fs_generic_bitmap bitmap,
393826
 			     __u64 arg)
393826
 {
393826
-	ext2fs_generic_bitmap_64 bitmap = (ext2fs_generic_bitmap_64) gen_bitmap;
393826
 	if (!bitmap)
393826
 		return 0;
393826
 
393826
 	if (EXT2FS_IS_32_BITMAP(bitmap)) {
393826
 		if (arg & ~0xffffffffULL) {
393826
-			ext2fs_warn_bitmap2(gen_bitmap, EXT2FS_TEST_ERROR,
393826
+			ext2fs_warn_bitmap2(bitmap, EXT2FS_TEST_ERROR,
393826
 					    0xffffffff);
393826
 			return 0;
393826
 		}
393826
-		return ext2fs_test_generic_bitmap(gen_bitmap, arg);
393826
+		return ext2fs_test_generic_bitmap(bitmap, arg);
393826
 	}
393826
 
393826
 	if (!EXT2FS_IS_64_BITMAP(bitmap))
393826
@@ -548,22 +529,20 @@ int ext2fs_test_generic_bmap(ext2fs_generic_bitmap gen_bitmap,
393826
 	return bitmap->bitmap_ops->test_bmap(bitmap, arg);
393826
 }
393826
 
393826
-errcode_t ext2fs_set_generic_bmap_range(ext2fs_generic_bitmap gen_bmap,
393826
+errcode_t ext2fs_set_generic_bmap_range(ext2fs_generic_bitmap bmap,
393826
 					__u64 start, unsigned int num,
393826
 					void *in)
393826
 {
393826
-	ext2fs_generic_bitmap_64 bmap = (ext2fs_generic_bitmap_64) gen_bmap;
393826
-
393826
 	if (!bmap)
393826
 		return EINVAL;
393826
 
393826
 	if (EXT2FS_IS_32_BITMAP(bmap)) {
393826
 		if ((start+num-1) & ~0xffffffffULL) {
393826
-			ext2fs_warn_bitmap2(gen_bmap, EXT2FS_UNMARK_ERROR,
393826
+			ext2fs_warn_bitmap2(bmap, EXT2FS_UNMARK_ERROR,
393826
 					    0xffffffff);
393826
 			return EINVAL;
393826
 		}
393826
-		return ext2fs_set_generic_bitmap_range(gen_bmap, bmap->magic,
393826
+		return ext2fs_set_generic_bitmap_range(bmap, bmap->magic,
393826
 						       start, num, in);
393826
 	}
393826
 
393826
@@ -575,22 +554,20 @@ errcode_t ext2fs_set_generic_bmap_range(ext2fs_generic_bitmap gen_bmap,
393826
 	return bmap->bitmap_ops->set_bmap_range(bmap, start, num, in);
393826
 }
393826
 
393826
-errcode_t ext2fs_get_generic_bmap_range(ext2fs_generic_bitmap gen_bmap,
393826
+errcode_t ext2fs_get_generic_bmap_range(ext2fs_generic_bitmap bmap,
393826
 					__u64 start, unsigned int num,
393826
 					void *out)
393826
 {
393826
-	ext2fs_generic_bitmap_64 bmap = (ext2fs_generic_bitmap_64) gen_bmap;
393826
-
393826
 	if (!bmap)
393826
 		return EINVAL;
393826
 
393826
 	if (EXT2FS_IS_32_BITMAP(bmap)) {
393826
 		if ((start+num-1) & ~0xffffffffULL) {
393826
-			ext2fs_warn_bitmap2(gen_bmap,
393826
+			ext2fs_warn_bitmap2(bmap,
393826
 					    EXT2FS_UNMARK_ERROR, 0xffffffff);
393826
 			return EINVAL;
393826
 		}
393826
-		return ext2fs_get_generic_bitmap_range(gen_bmap, bmap->magic,
393826
+		return ext2fs_get_generic_bitmap_range(bmap, bmap->magic,
393826
 						       start, num, out);
393826
 	}
393826
 
393826
@@ -603,11 +580,9 @@ errcode_t ext2fs_get_generic_bmap_range(ext2fs_generic_bitmap gen_bmap,
393826
 }
393826
 
393826
 errcode_t ext2fs_compare_generic_bmap(errcode_t neq,
393826
-				      ext2fs_generic_bitmap gen_bm1,
393826
-				      ext2fs_generic_bitmap gen_bm2)
393826
+				      ext2fs_generic_bitmap bm1,
393826
+				      ext2fs_generic_bitmap bm2)
393826
 {
393826
-	ext2fs_generic_bitmap_64 bm1 = (ext2fs_generic_bitmap_64) gen_bm1;
393826
-	ext2fs_generic_bitmap_64 bm2 = (ext2fs_generic_bitmap_64) gen_bm2;
393826
 	blk64_t	i;
393826
 
393826
 	if (!bm1 || !bm2)
393826
@@ -617,8 +592,7 @@ errcode_t ext2fs_compare_generic_bmap(errcode_t neq,
393826
 
393826
 	/* Now we know both bitmaps have the same magic */
393826
 	if (EXT2FS_IS_32_BITMAP(bm1))
393826
-		return ext2fs_compare_generic_bitmap(bm1->magic, neq,
393826
-						     gen_bm1, gen_bm2);
393826
+		return ext2fs_compare_generic_bitmap(bm1->magic, neq, bm1, bm2);
393826
 
393826
 	if (!EXT2FS_IS_64_BITMAP(bm1))
393826
 		return EINVAL;
393826
@@ -628,20 +602,19 @@ errcode_t ext2fs_compare_generic_bmap(errcode_t neq,
393826
 		return neq;
393826
 
393826
 	for (i = bm1->end - ((bm1->end - bm1->start) % 8); i <= bm1->end; i++)
393826
-		if (ext2fs_test_generic_bmap(gen_bm1, i) !=
393826
-		    ext2fs_test_generic_bmap(gen_bm2, i))
393826
+		if (ext2fs_test_generic_bmap(bm1, i) !=
393826
+		    ext2fs_test_generic_bmap(bm2, i))
393826
 			return neq;
393826
 
393826
 	return 0;
393826
 }
393826
 
393826
-void ext2fs_set_generic_bmap_padding(ext2fs_generic_bitmap gen_bmap)
393826
+void ext2fs_set_generic_bmap_padding(ext2fs_generic_bitmap bmap)
393826
 {
393826
-	ext2fs_generic_bitmap_64 bmap = (ext2fs_generic_bitmap_64) gen_bmap;
393826
 	__u64	start, num;
393826
 
393826
 	if (EXT2FS_IS_32_BITMAP(bmap)) {
393826
-		ext2fs_set_generic_bitmap_padding(gen_bmap);
393826
+		ext2fs_set_generic_bitmap_padding(bmap);
393826
 		return;
393826
 	}
393826
 
393826
@@ -651,10 +624,9 @@ void ext2fs_set_generic_bmap_padding(ext2fs_generic_bitmap gen_bmap)
393826
 	/* XXX ought to warn on error */
393826
 }
393826
 
393826
-int ext2fs_test_block_bitmap_range2(ext2fs_block_bitmap gen_bmap,
393826
+int ext2fs_test_block_bitmap_range2(ext2fs_block_bitmap bmap,
393826
 				    blk64_t block, unsigned int num)
393826
 {
393826
-	ext2fs_generic_bitmap_64 bmap = (ext2fs_generic_bitmap_64) gen_bmap;
393826
 	__u64	end = block + num;
393826
 
393826
 	if (!bmap)
393826
@@ -696,10 +668,9 @@ int ext2fs_test_block_bitmap_range2(ext2fs_block_bitmap gen_bmap,
393826
 	return bmap->bitmap_ops->test_clear_bmap_extent(bmap, block, num);
393826
 }
393826
 
393826
-void ext2fs_mark_block_bitmap_range2(ext2fs_block_bitmap gen_bmap,
393826
+void ext2fs_mark_block_bitmap_range2(ext2fs_block_bitmap bmap,
393826
 				     blk64_t block, unsigned int num)
393826
 {
393826
-	ext2fs_generic_bitmap_64 bmap = (ext2fs_generic_bitmap_64) gen_bmap;
393826
 	__u64	end = block + num;
393826
 
393826
 	if (!bmap)
393826
@@ -737,10 +708,9 @@ void ext2fs_mark_block_bitmap_range2(ext2fs_block_bitmap gen_bmap,
393826
 	bmap->bitmap_ops->mark_bmap_extent(bmap, block, num);
393826
 }
393826
 
393826
-void ext2fs_unmark_block_bitmap_range2(ext2fs_block_bitmap gen_bmap,
393826
+void ext2fs_unmark_block_bitmap_range2(ext2fs_block_bitmap bmap,
393826
 				       blk64_t block, unsigned int num)
393826
 {
393826
-	ext2fs_generic_bitmap_64 bmap = (ext2fs_generic_bitmap_64) gen_bmap;
393826
 	__u64	end = block + num;
393826
 
393826
 	if (!bmap)
393826
@@ -778,10 +748,8 @@ void ext2fs_unmark_block_bitmap_range2(ext2fs_block_bitmap gen_bmap,
393826
 	bmap->bitmap_ops->unmark_bmap_extent(bmap, block, num);
393826
 }
393826
 
393826
-void ext2fs_warn_bitmap32(ext2fs_generic_bitmap gen_bitmap, const char *func)
393826
+void ext2fs_warn_bitmap32(ext2fs_generic_bitmap bitmap, const char *func)
393826
 {
393826
-	ext2fs_generic_bitmap_64 bitmap = (ext2fs_generic_bitmap_64) gen_bitmap;
393826
-
393826
 #ifndef OMIT_COM_ERR
393826
 	if (bitmap && bitmap->description)
393826
 		com_err(0, EXT2_ET_MAGIC_GENERIC_BITMAP,
393826
@@ -796,22 +764,21 @@ void ext2fs_warn_bitmap32(ext2fs_generic_bitmap gen_bitmap, const char *func)
393826
 errcode_t ext2fs_convert_subcluster_bitmap(ext2_filsys fs,
393826
 					   ext2fs_block_bitmap *bitmap)
393826
 {
393826
-	ext2fs_generic_bitmap_64 bmap, cmap;
393826
-	ext2fs_block_bitmap	gen_bmap = *bitmap, gen_cmap;
393826
+	ext2fs_block_bitmap	cmap, bmap;
393826
 	errcode_t		retval;
393826
 	blk64_t			i, b_end, c_end;
393826
 	int			n, ratio;
393826
 
393826
-	bmap = (ext2fs_generic_bitmap_64) gen_bmap;
393826
-	if (fs->cluster_ratio_bits == ext2fs_get_bitmap_granularity(gen_bmap))
393826
+	bmap = *bitmap;
393826
+
393826
+	if (fs->cluster_ratio_bits == ext2fs_get_bitmap_granularity(bmap))
393826
 		return 0;	/* Nothing to do */
393826
 
393826
 	retval = ext2fs_allocate_block_bitmap(fs, "converted cluster bitmap",
393826
-					      &gen_cmap);
393826
+					      &cmap);
393826
 	if (retval)
393826
 		return retval;
393826
 
393826
-	cmap = (ext2fs_generic_bitmap_64) gen_cmap;
393826
 	i = bmap->start;
393826
 	b_end = bmap->end;
393826
 	bmap->end = bmap->real_end;
393826
@@ -820,8 +787,8 @@ errcode_t ext2fs_convert_subcluster_bitmap(ext2_filsys fs,
393826
 	n = 0;
393826
 	ratio = 1 << fs->cluster_ratio_bits;
393826
 	while (i < bmap->real_end) {
393826
-		if (ext2fs_test_block_bitmap2(gen_bmap, i)) {
393826
-			ext2fs_mark_block_bitmap2(gen_cmap, i);
393826
+		if (ext2fs_test_block_bitmap2(bmap, i)) {
393826
+			ext2fs_mark_block_bitmap2(cmap, i);
393826
 			i += ratio - n;
393826
 			n = 0;
393826
 			continue;
393826
@@ -832,15 +799,14 @@ errcode_t ext2fs_convert_subcluster_bitmap(ext2_filsys fs,
393826
 	}
393826
 	bmap->end = b_end;
393826
 	cmap->end = c_end;
393826
-	ext2fs_free_block_bitmap(gen_bmap);
393826
-	*bitmap = (ext2fs_block_bitmap) cmap;
393826
+	ext2fs_free_block_bitmap(bmap);
393826
+	*bitmap = cmap;
393826
 	return 0;
393826
 }
393826
 
393826
 errcode_t ext2fs_find_first_zero_generic_bmap(ext2fs_generic_bitmap bitmap,
393826
 					      __u64 start, __u64 end, __u64 *out)
393826
 {
393826
-	ext2fs_generic_bitmap_64 bmap64 = (ext2fs_generic_bitmap_64) bitmap;
393826
 	__u64 cstart, cend, cout;
393826
 	errcode_t retval;
393826
 
393826
@@ -866,27 +832,27 @@ errcode_t ext2fs_find_first_zero_generic_bmap(ext2fs_generic_bitmap bitmap,
393826
 	if (!EXT2FS_IS_64_BITMAP(bitmap))
393826
 		return EINVAL;
393826
 
393826
-	cstart = start >> bmap64->cluster_bits;
393826
-	cend = end >> bmap64->cluster_bits;
393826
+	cstart = start >> bitmap->cluster_bits;
393826
+	cend = end >> bitmap->cluster_bits;
393826
 
393826
-	if (cstart < bmap64->start || cend > bmap64->end || start > end) {
393826
-		warn_bitmap(bmap64, EXT2FS_TEST_ERROR, start);
393826
+	if (cstart < bitmap->start || cend > bitmap->end || start > end) {
393826
+		warn_bitmap(bitmap, EXT2FS_TEST_ERROR, start);
393826
 		return EINVAL;
393826
 	}
393826
 
393826
-	if (bmap64->bitmap_ops->find_first_zero) {
393826
-		retval = bmap64->bitmap_ops->find_first_zero(bmap64, cstart,
393826
+	if (bitmap->bitmap_ops->find_first_zero) {
393826
+		retval = bitmap->bitmap_ops->find_first_zero(bitmap, cstart,
393826
 							     cend, &cout);
393826
 		if (retval)
393826
 			return retval;
393826
 	found:
393826
-		cout <<= bmap64->cluster_bits;
393826
+		cout <<= bitmap->cluster_bits;
393826
 		*out = (cout >= start) ? cout : start;
393826
 		return 0;
393826
 	}
393826
 
393826
 	for (cout = cstart; cout <= cend; cout++)
393826
-		if (!bmap64->bitmap_ops->test_bmap(bmap64, cout))
393826
+		if (!bitmap->bitmap_ops->test_bmap(bitmap, cout))
393826
 			goto found;
393826
 
393826
 	return ENOENT;
393826
@@ -895,7 +861,6 @@ errcode_t ext2fs_find_first_zero_generic_bmap(ext2fs_generic_bitmap bitmap,
393826
 errcode_t ext2fs_find_first_set_generic_bmap(ext2fs_generic_bitmap bitmap,
393826
 					     __u64 start, __u64 end, __u64 *out)
393826
 {
393826
-	ext2fs_generic_bitmap_64 bmap64 = (ext2fs_generic_bitmap_64) bitmap;
393826
 	__u64 cstart, cend, cout;
393826
 	errcode_t retval;
393826
 
393826
@@ -921,27 +886,27 @@ errcode_t ext2fs_find_first_set_generic_bmap(ext2fs_generic_bitmap bitmap,
393826
 	if (!EXT2FS_IS_64_BITMAP(bitmap))
393826
 		return EINVAL;
393826
 
393826
-	cstart = start >> bmap64->cluster_bits;
393826
-	cend = end >> bmap64->cluster_bits;
393826
+	cstart = start >> bitmap->cluster_bits;
393826
+	cend = end >> bitmap->cluster_bits;
393826
 
393826
-	if (cstart < bmap64->start || cend > bmap64->end || start > end) {
393826
-		warn_bitmap(bmap64, EXT2FS_TEST_ERROR, start);
393826
+	if (cstart < bitmap->start || cend > bitmap->end || start > end) {
393826
+		warn_bitmap(bitmap, EXT2FS_TEST_ERROR, start);
393826
 		return EINVAL;
393826
 	}
393826
 
393826
-	if (bmap64->bitmap_ops->find_first_set) {
393826
-		retval = bmap64->bitmap_ops->find_first_set(bmap64, cstart,
393826
+	if (bitmap->bitmap_ops->find_first_set) {
393826
+		retval = bitmap->bitmap_ops->find_first_set(bitmap, cstart,
393826
 							    cend, &cout);
393826
 		if (retval)
393826
 			return retval;
393826
 	found:
393826
-		cout <<= bmap64->cluster_bits;
393826
+		cout <<= bitmap->cluster_bits;
393826
 		*out = (cout >= start) ? cout : start;
393826
 		return 0;
393826
 	}
393826
 
393826
 	for (cout = cstart; cout <= cend; cout++)
393826
-		if (bmap64->bitmap_ops->test_bmap(bmap64, cout))
393826
+		if (bitmap->bitmap_ops->test_bmap(bitmap, cout))
393826
 			goto found;
393826
 
393826
 	return ENOENT;
393826
-- 
1e8c27
2.21.3
393826