--- linux-2.4.21/drivers/md/dm-io.c.orig	2003-08-27 00:34:17.000000000 +0200
+++ linux-2.4.21/drivers/md/dm-io.c	2003-08-27 00:41:43.000000000 +0200
@@ -10,6 +10,7 @@
 #include <linux/module.h>
 #include <linux/slab.h>
 #include <linux/sched.h>
+#include <asm/bitops.h>  /* for fls(int x) */
 
 /* FIXME: can we shrink this ? */
 struct io_context {
@@ -177,17 +178,17 @@
 /*
  * Primitives for alignment calculations.
  */
-int fls(unsigned n)
+/* int fls(int n)
 {
 	return generic_fls32(n);
 }
-
+*/
 static inline int log2_floor(unsigned n)
 {
 	return ffs(n) - 1;
 }
 
-static inline int log2_align(unsigned n)
+static inline int log2_align(int n)
 {
 	return fls(n) - 1;
 }
@@ -204,7 +205,7 @@
 	sector_t b = *block;
 	sector_t blocks_per_page = PAGE_SIZE / block_size;
 	unsigned int this_size; /* holds the size of the current io */
-	unsigned int len;
+	int len;
 
 	while ((offset < PAGE_SIZE) && (b != end_block)) {
 		bh = mempool_alloc(_buffer_pool, GFP_NOIO);
--- linux-2.4.21/drivers/md/dm-io.h.orig	2003-08-27 00:31:16.000000000 +0200
+++ linux-2.4.21/drivers/md/dm-io.h	2003-08-27 00:48:55.000000000 +0200
@@ -11,28 +11,6 @@
 
 #include <linux/list.h>
 
-/* Move these to bitops.h eventually */
-/* Improved generic_fls algorithm (in 2.4 there is no generic_fls so far) */
-/* (c) 2002, D.Phillips and Sistina Software */
-/* Licensed under Version 2 of the GPL */
-
-static unsigned generic_fls8(unsigned n)
-{
-	return n & 0xf0 ?
-	    n & 0xc0 ? (n >> 7) + 7 : (n >> 5) + 5:
-	    n & 0x0c ? (n >> 3) + 3 : n - ((n + 1) >> 2);
-}
-
-static inline unsigned generic_fls16(unsigned n)
-{
-	return	n & 0xff00? generic_fls8(n >> 8) + 8 : generic_fls8(n);
-}
-
-static inline unsigned generic_fls32(unsigned n)
-{
-	return	n & 0xffff0000 ? generic_fls16(n >> 16) + 16 : generic_fls16(n);
-}
-
 /* FIXME make this configurable */
 #define DM_MAX_IO_REGIONS 8
 
