]> git.baikalelectronics.ru Git - kernel.git/commit
Btrfs: fix 64 bit divide problem
authorJosef Bacik <josef@redhat.com>
Sat, 20 Aug 2011 12:29:51 +0000 (08:29 -0400)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sun, 21 Aug 2011 14:02:00 +0000 (07:02 -0700)
commit8bd834cfb9e88d742f40d62bf3ac754a3b8c5d95
tree2faf96d69696df0edfc0ab4d8f0c980ee0b89986
parent36083749c861b511c65ad3d35c1bf37e30f51a02
Btrfs: fix 64 bit divide problem

This fixes a regression introduced by commit 4a1e7e1f16c6 ("Btrfs: check
if there is enough space for balancing smarter").  We can't do 64-bit
divides on 32-bit architectures.

In cases where we need to divide/multiply by 2 we should just left/right
shift respectively, and in cases where theres N number of devices use
do_div.  Also make the counters u64 to match up with rw_devices.
Thanks,

Signed-off-by: Josef Bacik <josef@redhat.com>
Acked-and-tested-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
fs/btrfs/extent-tree.c