1 Commits
Author SHA1 Message Date
Brian Behlendorf 658716d19f div64_u64(): improve precision on 32bit platforms
The current implementation of div64_u64 for 32bit systems returns an
approximately correct result when the divisor exceeds 32bits.  Since doing
64bit division using 32bit hardware is a long since solved problem we just
use one of the existing proven methods.

Additionally, add a div64_s64 function to correctly handle doing signed
64bit division.

Addresses https://bugzilla.redhat.com/show_bug.cgi?id=616105

Signed-off-by: Brian Behlendorf <[email protected]>
Signed-off-by: Oleg Nesterov <[email protected]>
Cc: Ben Woodard <[email protected]>
Cc: Jeremy Fitzhardinge <[email protected]>
Cc: Mark Grondona <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
2010-10-26 16:52:19 -07:00