
From: Andrew Morton <akpm@osdl.org>

There's no implementation of __div64_32().   Nor should there be.

This needs checking...

Cc: Hans Reiser <reiser@namesys.com>
CC: vs <vs@thebsh.namesys.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
---

 fs/reiser4/plugin/space/bitmap.c |   11 ++++++-----
 fs/reiser4/plugin/space/bitmap.h |    2 --
 2 files changed, 6 insertions(+), 7 deletions(-)

diff -puN fs/reiser4/plugin/space/bitmap.c~reiser4-big-update-div64-fix fs/reiser4/plugin/space/bitmap.c
--- devel/fs/reiser4/plugin/space/bitmap.c~reiser4-big-update-div64-fix	2005-09-15 23:41:43.000000000 -0700
+++ devel-akpm/fs/reiser4/plugin/space/bitmap.c	2005-09-15 23:41:43.000000000 -0700
@@ -15,6 +15,7 @@
 #include <linux/fs.h>		/* for struct super_block  */
 #include <asm/semaphore.h>
 #include <linux/vmalloc.h>
+#include <asm/div64.h>
 
 /* Proposed (but discarded) optimization: dynamic loading/unloading of bitmap
  * blocks
@@ -573,11 +574,12 @@ adler32_recalc(__u32 adler, unsigned cha
  */
 static bmap_nr_t get_nr_bmap(const struct super_block *super)
 {
+	u64 quotient;
+
 	assert("zam-393", reiser4_block_count(super) != 0);
-	unsigned long long quotient;
 
 	quotient = reiser4_block_count(super) - 1;
-	__div64_32(&quotient, bmap_bit_count(super->s_blocksize));
+	do_div(quotient, bmap_bit_count(super->s_blocksize));
 	return quotient + 1;
 }
 
@@ -596,10 +598,9 @@ parse_blocknr(const reiser4_block_nr *bl
 	      bmap_off_t *offset)
 {
 	struct super_block *super = get_current_context()->super;
-	unsigned long long quotient;
+	u64 quotient = *block;
 
-	quotient = *block;
-	*offset = __div64_32(&quotient, bmap_bit_count(super->s_blocksize));
+	*offset = do_div(quotient, bmap_bit_count(super->s_blocksize));
 	*bmap = quotient;
 
 	assert("zam-433", *bmap < get_nr_bmap(super));
diff -puN fs/reiser4/plugin/space/bitmap.h~reiser4-big-update-div64-fix fs/reiser4/plugin/space/bitmap.h
--- devel/fs/reiser4/plugin/space/bitmap.h~reiser4-big-update-div64-fix	2005-09-15 23:41:43.000000000 -0700
+++ devel-akpm/fs/reiser4/plugin/space/bitmap.h	2005-09-15 23:41:43.000000000 -0700
@@ -33,8 +33,6 @@ extern int pre_commit_hook_bitmap(void);
 typedef __u64 bmap_nr_t;
 typedef __u32 bmap_off_t;
 
-extern uint32_t __div64_32(uint64_t *dividend, uint32_t divisor);
-
 #endif				/* __REISER4_PLUGIN_SPACE_BITMAP_H__ */
 
 /* Make Linus happy.
_
